Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit d39799b

Browse files
committed
Merge remote-tracking branch 'drm-intel/drm-intel-next' into drm-tip
2 parents 12359a7 + 859161b commit d39799b

17 files changed

+178
-175
lines changed

drivers/gpu/drm/i915/display/intel_bios.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -2670,8 +2670,6 @@ static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
26702670

26712671
sanitize_device_type(devdata, port);
26722672

2673-
print_ddi_port(devdata, port);
2674-
26752673
if (intel_bios_encoder_supports_dvi(devdata))
26762674
sanitize_ddc_pin(devdata, port);
26772675

@@ -2689,12 +2687,18 @@ static bool has_ddi_port_info(struct drm_i915_private *i915)
26892687
static void parse_ddi_ports(struct drm_i915_private *i915)
26902688
{
26912689
struct intel_bios_encoder_data *devdata;
2690+
enum port port;
26922691

26932692
if (!has_ddi_port_info(i915))
26942693
return;
26952694

26962695
list_for_each_entry(devdata, &i915->vbt.display_devices, node)
26972696
parse_ddi_port(devdata);
2697+
2698+
for_each_port(port) {
2699+
if (i915->vbt.ports[port])
2700+
print_ddi_port(i915->vbt.ports[port], port);
2701+
}
26982702
}
26992703

27002704
static void

drivers/gpu/drm/i915/display/intel_cdclk.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2300,15 +2300,15 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
23002300
min_cdclk = max(min_cdclk, (int)crtc_state->pixel_rate);
23012301

23022302
/*
2303-
* HACK. Currently for TGL platforms we calculate
2303+
* HACK. Currently for TGL/DG2 platforms we calculate
23042304
* min_cdclk initially based on pixel_rate divided
23052305
* by 2, accounting for also plane requirements,
23062306
* however in some cases the lowest possible CDCLK
23072307
* doesn't work and causing the underruns.
23082308
* Explicitly stating here that this seems to be currently
23092309
* rather a Hack, than final solution.
23102310
*/
2311-
if (IS_TIGERLAKE(dev_priv)) {
2311+
if (IS_TIGERLAKE(dev_priv) || IS_DG2(dev_priv)) {
23122312
/*
23132313
* Clamp to max_cdclk_freq in case pixel rate is higher,
23142314
* in order not to break an 8K, but still leave W/A at place.

drivers/gpu/drm/i915/display/intel_color.c

+19-30
Original file line numberDiff line numberDiff line change
@@ -505,30 +505,19 @@ static void ilk_color_commit_noarm(const struct intel_crtc_state *crtc_state)
505505

506506
static void i9xx_color_commit_arm(const struct intel_crtc_state *crtc_state)
507507
{
508-
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
509-
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
510-
enum pipe pipe = crtc->pipe;
511-
u32 val;
512-
513-
val = intel_de_read(dev_priv, PIPECONF(pipe));
514-
val &= ~PIPECONF_GAMMA_MODE_MASK_I9XX;
515-
val |= PIPECONF_GAMMA_MODE(crtc_state->gamma_mode);
516-
intel_de_write(dev_priv, PIPECONF(pipe), val);
508+
/* update PIPECONF GAMMA_MODE */
509+
i9xx_set_pipeconf(crtc_state);
517510
}
518511

519512
static void ilk_color_commit_arm(const struct intel_crtc_state *crtc_state)
520513
{
521514
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
522515
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
523-
enum pipe pipe = crtc->pipe;
524-
u32 val;
525516

526-
val = intel_de_read(dev_priv, PIPECONF(pipe));
527-
val &= ~PIPECONF_GAMMA_MODE_MASK_ILK;
528-
val |= PIPECONF_GAMMA_MODE(crtc_state->gamma_mode);
529-
intel_de_write(dev_priv, PIPECONF(pipe), val);
517+
/* update PIPECONF GAMMA_MODE */
518+
ilk_set_pipeconf(crtc_state);
530519

531-
intel_de_write_fw(dev_priv, PIPE_CSC_MODE(pipe),
520+
intel_de_write_fw(dev_priv, PIPE_CSC_MODE(crtc->pipe),
532521
crtc_state->csc_mode);
533522
}
534523

@@ -852,7 +841,7 @@ static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
852841
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
853842
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
854843
enum pipe pipe = crtc->pipe;
855-
int i, lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size;
844+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.degamma_lut_size;
856845
const struct drm_color_lut *lut = crtc_state->hw.degamma_lut->data;
857846

858847
/*
@@ -894,7 +883,7 @@ static void glk_load_degamma_lut_linear(const struct intel_crtc_state *crtc_stat
894883
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
895884
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
896885
enum pipe pipe = crtc->pipe;
897-
int i, lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size;
886+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.degamma_lut_size;
898887

899888
/*
900889
* When setting the auto-increment bit, the hardware seems to
@@ -1346,10 +1335,10 @@ static int check_luts(const struct intel_crtc_state *crtc_state)
13461335
return -EINVAL;
13471336
}
13481337

1349-
degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size;
1350-
gamma_length = INTEL_INFO(dev_priv)->color.gamma_lut_size;
1351-
degamma_tests = INTEL_INFO(dev_priv)->color.degamma_lut_tests;
1352-
gamma_tests = INTEL_INFO(dev_priv)->color.gamma_lut_tests;
1338+
degamma_length = INTEL_INFO(dev_priv)->display.color.degamma_lut_size;
1339+
gamma_length = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
1340+
degamma_tests = INTEL_INFO(dev_priv)->display.color.degamma_lut_tests;
1341+
gamma_tests = INTEL_INFO(dev_priv)->display.color.gamma_lut_tests;
13531342

13541343
if (check_lut_size(degamma_lut, degamma_length) ||
13551344
check_lut_size(gamma_lut, gamma_length))
@@ -1885,7 +1874,7 @@ static void i9xx_read_luts(struct intel_crtc_state *crtc_state)
18851874
static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
18861875
{
18871876
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1888-
int i, lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
1877+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
18891878
enum pipe pipe = crtc->pipe;
18901879
struct drm_property_blob *blob;
18911880
struct drm_color_lut *lut;
@@ -1928,7 +1917,7 @@ static void i965_read_luts(struct intel_crtc_state *crtc_state)
19281917
static struct drm_property_blob *chv_read_cgm_gamma(struct intel_crtc *crtc)
19291918
{
19301919
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1931-
int i, lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
1920+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
19321921
enum pipe pipe = crtc->pipe;
19331922
struct drm_property_blob *blob;
19341923
struct drm_color_lut *lut;
@@ -1989,7 +1978,7 @@ static struct drm_property_blob *ilk_read_lut_8(struct intel_crtc *crtc)
19891978
static struct drm_property_blob *ilk_read_lut_10(struct intel_crtc *crtc)
19901979
{
19911980
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
1992-
int i, lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
1981+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
19931982
enum pipe pipe = crtc->pipe;
19941983
struct drm_property_blob *blob;
19951984
struct drm_color_lut *lut;
@@ -2040,7 +2029,7 @@ static struct drm_property_blob *bdw_read_lut_10(struct intel_crtc *crtc,
20402029
{
20412030
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
20422031
int i, hw_lut_size = ivb_lut_10_size(prec_index);
2043-
int lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
2032+
int lut_size = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
20442033
enum pipe pipe = crtc->pipe;
20452034
struct drm_property_blob *blob;
20462035
struct drm_color_lut *lut;
@@ -2093,7 +2082,7 @@ static struct drm_property_blob *
20932082
icl_read_lut_multi_segment(struct intel_crtc *crtc)
20942083
{
20952084
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
2096-
int i, lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size;
2085+
int i, lut_size = INTEL_INFO(dev_priv)->display.color.gamma_lut_size;
20972086
enum pipe pipe = crtc->pipe;
20982087
struct drm_property_blob *blob;
20992088
struct drm_color_lut *lut;
@@ -2230,7 +2219,7 @@ static const struct intel_color_funcs ilk_color_funcs = {
22302219
void intel_color_init(struct intel_crtc *crtc)
22312220
{
22322221
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
2233-
bool has_ctm = INTEL_INFO(dev_priv)->color.degamma_lut_size != 0;
2222+
bool has_ctm = INTEL_INFO(dev_priv)->display.color.degamma_lut_size != 0;
22342223

22352224
drm_mode_crtc_set_gamma_size(&crtc->base, 256);
22362225

@@ -2261,7 +2250,7 @@ void intel_color_init(struct intel_crtc *crtc)
22612250
}
22622251

22632252
drm_crtc_enable_color_mgmt(&crtc->base,
2264-
INTEL_INFO(dev_priv)->color.degamma_lut_size,
2253+
INTEL_INFO(dev_priv)->display.color.degamma_lut_size,
22652254
has_ctm,
2266-
INTEL_INFO(dev_priv)->color.gamma_lut_size);
2255+
INTEL_INFO(dev_priv)->display.color.gamma_lut_size);
22672256
}

drivers/gpu/drm/i915/display/intel_ddi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4179,7 +4179,7 @@ static enum hpd_pin ehl_hpd_pin(struct drm_i915_private *dev_priv,
41794179
if (port == PORT_D)
41804180
return HPD_PORT_A;
41814181

4182-
if (HAS_PCH_MCC(dev_priv))
4182+
if (HAS_PCH_TGP(dev_priv))
41834183
return icl_hpd_pin(dev_priv, port);
41844184

41854185
return HPD_PORT_A + port - PORT_A;

drivers/gpu/drm/i915/display/intel_display.c

+22-8
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@
126126

127127
static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state);
128128
static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state);
129-
static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state);
130-
static void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state);
131129
static void hsw_set_transconf(const struct intel_crtc_state *crtc_state);
132130
static void bdw_set_pipemisc(const struct intel_crtc_state *crtc_state);
133131
static void ilk_pfit_enable(const struct intel_crtc_state *crtc_state);
@@ -3015,14 +3013,18 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,
30153013
intel_bigjoiner_adjust_pipe_src(pipe_config);
30163014
}
30173015

3018-
static void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state)
3016+
void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state)
30193017
{
30203018
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
30213019
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
30223020
u32 pipeconf = 0;
30233021

3024-
/* we keep both pipes enabled on 830 */
3025-
if (IS_I830(dev_priv))
3022+
/*
3023+
* - We keep both pipes enabled on 830
3024+
* - During modeset the pipe is still disabled and must remain so
3025+
* - During fastset the pipe is already enabled and must remain so
3026+
*/
3027+
if (IS_I830(dev_priv) || !intel_crtc_needs_modeset(crtc_state))
30263028
pipeconf |= PIPECONF_ENABLE;
30273029

30283030
if (crtc_state->double_wide)
@@ -3335,14 +3337,19 @@ static bool i9xx_get_pipe_config(struct intel_crtc *crtc,
33353337
return ret;
33363338
}
33373339

3338-
static void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state)
3340+
void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state)
33393341
{
33403342
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
33413343
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
33423344
enum pipe pipe = crtc->pipe;
3343-
u32 val;
3345+
u32 val = 0;
33443346

3345-
val = 0;
3347+
/*
3348+
* - During modeset the pipe is still disabled and must remain so
3349+
* - During fastset the pipe is already enabled and must remain so
3350+
*/
3351+
if (!intel_crtc_needs_modeset(crtc_state))
3352+
val |= PIPECONF_ENABLE;
33463353

33473354
switch (crtc_state->pipe_bpp) {
33483355
default:
@@ -3401,6 +3408,13 @@ static void hsw_set_transconf(const struct intel_crtc_state *crtc_state)
34013408
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
34023409
u32 val = 0;
34033410

3411+
/*
3412+
* - During modeset the pipe is still disabled and must remain so
3413+
* - During fastset the pipe is already enabled and must remain so
3414+
*/
3415+
if (!intel_crtc_needs_modeset(crtc_state))
3416+
val |= PIPECONF_ENABLE;
3417+
34043418
if (IS_HASWELL(dev_priv) && crtc_state->dither)
34053419
val |= PIPECONF_DITHER_EN | PIPECONF_DITHER_TYPE_SP;
34063420

drivers/gpu/drm/i915/display/intel_display.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ enum plane_id {
193193

194194
#define for_each_dbuf_slice(__dev_priv, __slice) \
195195
for ((__slice) = DBUF_S1; (__slice) < I915_MAX_DBUF_SLICES; (__slice)++) \
196-
for_each_if(INTEL_INFO(__dev_priv)->dbuf.slice_mask & BIT(__slice))
196+
for_each_if(INTEL_INFO(__dev_priv)->display.dbuf.slice_mask & BIT(__slice))
197197

198198
#define for_each_dbuf_slice_in_mask(__dev_priv, __slice, __mask) \
199199
for_each_dbuf_slice((__dev_priv), (__slice)) \
@@ -567,6 +567,8 @@ bool intel_pipe_config_compare(const struct intel_crtc_state *current_config,
567567
void intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state);
568568

569569
void intel_plane_destroy(struct drm_plane *plane);
570+
void i9xx_set_pipeconf(const struct intel_crtc_state *crtc_state);
571+
void ilk_set_pipeconf(const struct intel_crtc_state *crtc_state);
570572
void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state);
571573
void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state);
572574
void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe);

drivers/gpu/drm/i915/display/intel_display_power.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ void gen9_dbuf_slices_update(struct drm_i915_private *dev_priv,
10381038
u8 req_slices)
10391039
{
10401040
struct i915_power_domains *power_domains = &dev_priv->power_domains;
1041-
u8 slice_mask = INTEL_INFO(dev_priv)->dbuf.slice_mask;
1041+
u8 slice_mask = INTEL_INFO(dev_priv)->display.dbuf.slice_mask;
10421042
enum dbuf_slice slice;
10431043

10441044
drm_WARN(&dev_priv->drm, req_slices & ~slice_mask,
@@ -1608,7 +1608,7 @@ static void icl_display_core_init(struct drm_i915_private *dev_priv,
16081608
gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
16091609

16101610
/* Wa_14011294188:ehl,jsl,tgl,rkl,adl-s */
1611-
if (INTEL_PCH_TYPE(dev_priv) >= PCH_JSP &&
1611+
if (INTEL_PCH_TYPE(dev_priv) >= PCH_TGP &&
16121612
INTEL_PCH_TYPE(dev_priv) < PCH_DG1)
16131613
intel_de_rmw(dev_priv, SOUTH_DSPCLK_GATE_D, 0,
16141614
PCH_DPMGUNIT_CLOCK_GATE_DISABLE);

drivers/gpu/drm/i915/display/intel_dpll_mgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3184,7 +3184,7 @@ static int icl_compute_combo_phy_dpll(struct intel_atomic_state *state,
31843184
struct icl_port_dpll *port_dpll =
31853185
&crtc_state->icl_port_dplls[ICL_PORT_DPLL_DEFAULT];
31863186
struct skl_wrpll_params pll_params = {};
3187-
bool ret;
3187+
int ret;
31883188

31893189
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ||
31903190
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))

drivers/gpu/drm/i915/display/intel_hdmi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,7 @@ static u8 intel_hdmi_ddc_pin(struct intel_encoder *encoder)
28522852
ddc_pin = rkl_port_to_ddc_pin(dev_priv, port);
28532853
else if (DISPLAY_VER(dev_priv) == 9 && HAS_PCH_TGP(dev_priv))
28542854
ddc_pin = gen9bc_tgp_port_to_ddc_pin(dev_priv, port);
2855-
else if (HAS_PCH_MCC(dev_priv))
2855+
else if (IS_JSL_EHL(dev_priv) && HAS_PCH_TGP(dev_priv))
28562856
ddc_pin = mcc_port_to_ddc_pin(dev_priv, port);
28572857
else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP)
28582858
ddc_pin = icl_port_to_ddc_pin(dev_priv, port);

drivers/gpu/drm/i915/display/intel_psr.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
555555
/*
556556
* TODO: 7 lines of IO_BUFFER_WAKE and FAST_WAKE are default
557557
* values from BSpec. In order to setting an optimal power
558-
* consumption, lower than 4k resoluition mode needs to decrese
558+
* consumption, lower than 4k resolution mode needs to decrease
559559
* IO_BUFFER_WAKE and FAST_WAKE. And higher than 4K resolution
560560
* mode needs to increase IO_BUFFER_WAKE and FAST_WAKE.
561561
*/
@@ -959,7 +959,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
959959
int psr_setup_time;
960960

961961
/*
962-
* Current PSR panels dont work reliably with VRR enabled
962+
* Current PSR panels don't work reliably with VRR enabled
963963
* So if VRR is enabled, do not enable PSR.
964964
*/
965965
if (crtc_state->vrr.enable)
@@ -1664,7 +1664,7 @@ static void intel_psr2_sel_fetch_pipe_alignment(const struct intel_crtc_state *c
16641664
*
16651665
* Plane scaling and rotation is not supported by selective fetch and both
16661666
* properties can change without a modeset, so need to be check at every
1667-
* atomic commmit.
1667+
* atomic commit.
16681668
*/
16691669
static bool psr2_sel_fetch_plane_state_supported(const struct intel_plane_state *plane_state)
16701670
{
@@ -2203,7 +2203,7 @@ static void _psr_invalidate_handle(struct intel_dp *intel_dp)
22032203
}
22042204

22052205
/**
2206-
* intel_psr_invalidate - Invalidade PSR
2206+
* intel_psr_invalidate - Invalidate PSR
22072207
* @dev_priv: i915 device
22082208
* @frontbuffer_bits: frontbuffer plane tracking bits
22092209
* @origin: which operation caused the invalidate

drivers/gpu/drm/i915/i915_driver.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,6 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
828828
*/
829829
int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
830830
{
831-
const struct intel_device_info *match_info =
832-
(struct intel_device_info *)ent->driver_data;
833831
struct drm_i915_private *i915;
834832
int ret;
835833

@@ -838,7 +836,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
838836
return PTR_ERR(i915);
839837

840838
/* Disable nuclear pageflip by default on pre-ILK */
841-
if (!i915->params.nuclear_pageflip && match_info->graphics.ver < 5)
839+
if (!i915->params.nuclear_pageflip && DISPLAY_VER(i915) < 5)
842840
i915->drm.driver_features &= ~DRIVER_ATOMIC;
843841

844842
ret = pci_enable_device(pdev);
@@ -1066,8 +1064,6 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
10661064
intel_runtime_pm_disable(&i915->runtime_pm);
10671065
intel_power_domains_disable(i915);
10681066

1069-
i915_gem_suspend(i915);
1070-
10711067
if (HAS_DISPLAY(i915)) {
10721068
drm_kms_helper_poll_disable(&i915->drm);
10731069

@@ -1084,6 +1080,8 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
10841080

10851081
intel_dmc_ucode_suspend(i915);
10861082

1083+
i915_gem_suspend(i915);
1084+
10871085
/*
10881086
* The only requirement is to reboot with display DC states disabled,
10891087
* for now leaving all display power wells in the INIT power domain
@@ -1167,6 +1165,8 @@ static int i915_drm_suspend(struct drm_device *dev)
11671165

11681166
enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
11691167

1168+
i915_gem_drain_freed_objects(dev_priv);
1169+
11701170
return 0;
11711171
}
11721172

0 commit comments

Comments
 (0)