Skip to content

Commit f80c71f

Browse files
committed
Merge tag 'drm-intel-next-2022-10-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
- Hotplug code clean-up and organization (Jani, Gustavo) - More VBT specific code clean-up, doc, organization, and improvements (Ville) - More MTL enabling work (Matt, RK, Anusha, Jose) - FBC related clean-ups and improvements (Ville) - Removing unused sw_fence_await_reservation (Niranjana) - Big chunch of display house clean-up (Ville) - Many Watermark fixes and clean-ups (Ville) - Fix device info for devices without display (Jani) - Fix TC port PLLs after readout (Ville) - DPLL ID clean-ups (Ville) - Prep work for finishing (de)gamma readout (Ville) - PSR fixes and improvements (Jouni, Jose) - Reject excessive dotclocks early (Ville) - DRRS related improvements (Ville) - Simplify uncore register updates (Andrzej) - Fix simulated GPU reset wrt. encoder HW readout (Imre) - Add a ADL-P workaround (Jose) - Fix clear mask in GEN7_MISCCPCTL update (Andrzej) - Temporarily disable runtime_pm for discrete (Anshuman) - Improve fbdev debugs (Nirmoy) - Fix DP FRL link training status (Ankit) - Other small display fixes (Ankit, Suraj) - Allow panel fixed modes to have differing sync polarities (Ville) - Clean up crtc state flag checks (Ville) - Fix race conditions during DKL PHY accesses (Imre) - Prep-work for cdclock squash and crawl modes (Anusha) - ELD precompute and readout (Ville) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2b1966c + a6ebd53 commit f80c71f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2495
-2091
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ i915-y += \
282282
display/intel_ddi.o \
283283
display/intel_ddi_buf_trans.o \
284284
display/intel_display_trace.o \
285+
display/intel_dkl_phy.o \
285286
display/intel_dp.o \
286287
display/intel_dp_aux.o \
287288
display/intel_dp_aux_backlight.o \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,15 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
585585
} else {
586586
intel_encoder->pipe_mask = ~0;
587587
}
588-
intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG;
588+
intel_encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG);
589589
intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
590590
/*
591591
* BSpec is unclear about HDMI+HDMI cloning on g4x, but it seems
592592
* to work on real hardware. And since g4x can send infoframes to
593593
* only one port anyway, nothing is lost by allowing it.
594594
*/
595595
if (IS_G4X(dev_priv))
596-
intel_encoder->cloneable |= 1 << INTEL_OUTPUT_HDMI;
596+
intel_encoder->cloneable |= BIT(INTEL_OUTPUT_HDMI);
597597

598598
dig_port->hdmi.hdmi_reg = hdmi_reg;
599599
dig_port->dp.output_reg = INVALID_MMIO_REG;

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ static bool hsw_ips_need_disable(struct intel_atomic_state *state,
104104
* Disable IPS before we program the LUT.
105105
*/
106106
if (IS_HASWELL(i915) &&
107-
(new_crtc_state->uapi.color_mgmt_changed ||
108-
new_crtc_state->update_pipe) &&
107+
intel_crtc_needs_color_update(new_crtc_state) &&
109108
new_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)
110109
return true;
111110

@@ -146,16 +145,15 @@ static bool hsw_ips_need_enable(struct intel_atomic_state *state,
146145
* Re-enable IPS after the LUT has been programmed.
147146
*/
148147
if (IS_HASWELL(i915) &&
149-
(new_crtc_state->uapi.color_mgmt_changed ||
150-
new_crtc_state->update_pipe) &&
148+
intel_crtc_needs_color_update(new_crtc_state) &&
151149
new_crtc_state->gamma_mode == GAMMA_MODE_MODE_SPLIT)
152150
return true;
153151

154152
/*
155153
* We can't read out IPS on broadwell, assume the worst and
156154
* forcibly enable IPS on the first fastset.
157155
*/
158-
if (new_crtc_state->update_pipe && old_crtc_state->inherited)
156+
if (intel_crtc_needs_fastset(new_crtc_state) && old_crtc_state->inherited)
159157
return true;
160158

161159
return !old_crtc_state->ips_enabled;

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,16 +1974,8 @@ static void icl_dsi_add_properties(struct intel_connector *connector)
19741974
{
19751975
const struct drm_display_mode *fixed_mode =
19761976
intel_panel_preferred_fixed_mode(connector);
1977-
u32 allowed_scalers;
19781977

1979-
allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) |
1980-
BIT(DRM_MODE_SCALE_FULLSCREEN) |
1981-
BIT(DRM_MODE_SCALE_CENTER);
1982-
1983-
drm_connector_attach_scaling_mode_property(&connector->base,
1984-
allowed_scalers);
1985-
1986-
connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
1978+
intel_attach_scaling_mode_property(&connector->base);
19871979

19881980
drm_connector_set_panel_orientation_with_quirk(&connector->base,
19891981
intel_dsi_get_panel_orientation(connector),
@@ -1993,7 +1985,6 @@ static void icl_dsi_add_properties(struct intel_connector *connector)
19931985

19941986
void icl_dsi_init(struct drm_i915_private *dev_priv)
19951987
{
1996-
struct drm_device *dev = &dev_priv->drm;
19971988
struct intel_dsi *intel_dsi;
19981989
struct intel_encoder *encoder;
19991990
struct intel_connector *intel_connector;
@@ -2018,7 +2009,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
20182009
connector = &intel_connector->base;
20192010

20202011
/* register DSI encoder with DRM subsystem */
2021-
drm_encoder_init(dev, &encoder->base, &gen11_dsi_encoder_funcs,
2012+
drm_encoder_init(&dev_priv->drm, &encoder->base, &gen11_dsi_encoder_funcs,
20222013
DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port));
20232014

20242015
encoder->pre_pll_enable = gen11_dsi_pre_pll_enable;
@@ -2042,22 +2033,20 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
20422033
encoder->is_clock_enabled = gen11_dsi_is_clock_enabled;
20432034

20442035
/* register DSI connector with DRM subsystem */
2045-
drm_connector_init(dev, connector, &gen11_dsi_connector_funcs,
2036+
drm_connector_init(&dev_priv->drm, connector, &gen11_dsi_connector_funcs,
20462037
DRM_MODE_CONNECTOR_DSI);
20472038
drm_connector_helper_add(connector, &gen11_dsi_connector_helper_funcs);
20482039
connector->display_info.subpixel_order = SubPixelHorizontalRGB;
2049-
connector->interlace_allowed = false;
2050-
connector->doublescan_allowed = false;
20512040
intel_connector->get_hw_state = intel_connector_get_hw_state;
20522041

20532042
/* attach connector to encoder */
20542043
intel_connector_attach_encoder(intel_connector, encoder);
20552044

20562045
intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, NULL);
20572046

2058-
mutex_lock(&dev->mode_config.mutex);
2047+
mutex_lock(&dev_priv->drm.mode_config.mutex);
20592048
intel_panel_add_vbt_lfp_fixed_mode(intel_connector);
2060-
mutex_unlock(&dev->mode_config.mutex);
2049+
mutex_unlock(&dev_priv->drm.mode_config.mutex);
20612050

20622051
if (!intel_panel_preferred_fixed_mode(intel_connector)) {
20632052
drm_err(&dev_priv->drm, "DSI fixed mode info missing\n");

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
252252
if (crtc_state->hw.gamma_lut)
253253
drm_property_blob_get(crtc_state->hw.gamma_lut);
254254

255+
if (crtc_state->pre_csc_lut)
256+
drm_property_blob_get(crtc_state->pre_csc_lut);
257+
if (crtc_state->post_csc_lut)
258+
drm_property_blob_get(crtc_state->post_csc_lut);
259+
255260
crtc_state->update_pipe = false;
256261
crtc_state->disable_lp_wm = false;
257262
crtc_state->disable_cxsr = false;
@@ -274,6 +279,9 @@ static void intel_crtc_put_color_blobs(struct intel_crtc_state *crtc_state)
274279
drm_property_blob_put(crtc_state->hw.degamma_lut);
275280
drm_property_blob_put(crtc_state->hw.gamma_lut);
276281
drm_property_blob_put(crtc_state->hw.ctm);
282+
283+
drm_property_blob_put(crtc_state->pre_csc_lut);
284+
drm_property_blob_put(crtc_state->post_csc_lut);
277285
}
278286

279287
void intel_crtc_free_hw_state(struct intel_crtc_state *crtc_state)

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

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,47 @@ static bool intel_plane_do_async_flip(struct intel_plane *plane,
425425
return DISPLAY_VER(i915) < 13 || old_crtc_state->uapi.async_flip;
426426
}
427427

428+
static bool i9xx_must_disable_cxsr(const struct intel_crtc_state *new_crtc_state,
429+
const struct intel_plane_state *old_plane_state,
430+
const struct intel_plane_state *new_plane_state)
431+
{
432+
struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane);
433+
bool old_visible = old_plane_state->uapi.visible;
434+
bool new_visible = new_plane_state->uapi.visible;
435+
u32 old_ctl = old_plane_state->ctl;
436+
u32 new_ctl = new_plane_state->ctl;
437+
bool modeset, turn_on, turn_off;
438+
439+
if (plane->id == PLANE_CURSOR)
440+
return false;
441+
442+
modeset = intel_crtc_needs_modeset(new_crtc_state);
443+
turn_off = old_visible && (!new_visible || modeset);
444+
turn_on = new_visible && (!old_visible || modeset);
445+
446+
/* Must disable CxSR around plane enable/disable */
447+
if (turn_on || turn_off)
448+
return true;
449+
450+
if (!old_visible || !new_visible)
451+
return false;
452+
453+
/*
454+
* Most plane control register updates are blocked while in CxSR.
455+
*
456+
* Tiling mode is one exception where the primary plane can
457+
* apparently handle it, whereas the sprites can not (the
458+
* sprite issue being only relevant on VLV/CHV where CxSR
459+
* is actually possible with a sprite enabled).
460+
*/
461+
if (plane->id == PLANE_PRIMARY) {
462+
old_ctl &= ~DISP_TILED;
463+
new_ctl &= ~DISP_TILED;
464+
}
465+
466+
return old_ctl != new_ctl;
467+
}
468+
428469
static int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_state,
429470
struct intel_crtc_state *new_crtc_state,
430471
const struct intel_plane_state *old_plane_state,
@@ -482,17 +523,9 @@ static int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_cr
482523
if (turn_on) {
483524
if (DISPLAY_VER(dev_priv) < 5 && !IS_G4X(dev_priv))
484525
new_crtc_state->update_wm_pre = true;
485-
486-
/* must disable cxsr around plane enable/disable */
487-
if (plane->id != PLANE_CURSOR)
488-
new_crtc_state->disable_cxsr = true;
489526
} else if (turn_off) {
490527
if (DISPLAY_VER(dev_priv) < 5 && !IS_G4X(dev_priv))
491528
new_crtc_state->update_wm_post = true;
492-
493-
/* must disable cxsr around plane enable/disable */
494-
if (plane->id != PLANE_CURSOR)
495-
new_crtc_state->disable_cxsr = true;
496529
} else if (intel_wm_need_update(old_plane_state, new_plane_state)) {
497530
if (DISPLAY_VER(dev_priv) < 5 && !IS_G4X(dev_priv)) {
498531
/* FIXME bollocks */
@@ -504,6 +537,10 @@ static int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_cr
504537
if (visible || was_visible)
505538
new_crtc_state->fb_bits |= plane->frontbuffer_bit;
506539

540+
if (HAS_GMCH(dev_priv) &&
541+
i9xx_must_disable_cxsr(new_crtc_state, old_plane_state, new_plane_state))
542+
new_crtc_state->disable_cxsr = true;
543+
507544
/*
508545
* ILK/SNB DVSACNTR/Sprite Enable
509546
* IVB SPR_CTL/Sprite Enable
@@ -1005,7 +1042,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
10051042
*/
10061043
if (intel_crtc_needs_modeset(crtc_state)) {
10071044
ret = i915_sw_fence_await_reservation(&state->commit_ready,
1008-
old_obj->base.resv, NULL,
1045+
old_obj->base.resv,
10091046
false, 0,
10101047
GFP_KERNEL);
10111048
if (ret < 0)
@@ -1039,8 +1076,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
10391076
struct dma_fence *fence;
10401077

10411078
ret = i915_sw_fence_await_reservation(&state->commit_ready,
1042-
obj->base.resv, NULL,
1043-
false,
1079+
obj->base.resv, false,
10441080
i915_fence_timeout(dev_priv),
10451081
GFP_KERNEL);
10461082
if (ret < 0)

0 commit comments

Comments
 (0)