Skip to content

Commit 6b84468

Browse files
committed
drm/i915/dsi: fix DSS CTL register offsets for TGL+
On TGL+ the DSS control registers are at different offsets, and there's one per pipe. Fix the offsets to fix dual link DSI for TGL+. There would be helpers for this in the DSC code, but just do the quick fix now for DSI. Long term, we should probably move all the DSS handling into intel_vdsc.c, so exporting the helpers seems counter-productive. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8232 Cc: Ville Syrjala <[email protected]> Cc: [email protected] Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 1a62dd9)
1 parent 09a9639 commit 6b84468

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,21 @@ static void configure_dual_link_mode(struct intel_encoder *encoder,
300300
{
301301
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
302302
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
303+
i915_reg_t dss_ctl1_reg, dss_ctl2_reg;
303304
u32 dss_ctl1;
304305

305-
dss_ctl1 = intel_de_read(dev_priv, DSS_CTL1);
306+
/* FIXME: Move all DSS handling to intel_vdsc.c */
307+
if (DISPLAY_VER(dev_priv) >= 12) {
308+
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
309+
310+
dss_ctl1_reg = ICL_PIPE_DSS_CTL1(crtc->pipe);
311+
dss_ctl2_reg = ICL_PIPE_DSS_CTL2(crtc->pipe);
312+
} else {
313+
dss_ctl1_reg = DSS_CTL1;
314+
dss_ctl2_reg = DSS_CTL2;
315+
}
316+
317+
dss_ctl1 = intel_de_read(dev_priv, dss_ctl1_reg);
306318
dss_ctl1 |= SPLITTER_ENABLE;
307319
dss_ctl1 &= ~OVERLAP_PIXELS_MASK;
308320
dss_ctl1 |= OVERLAP_PIXELS(intel_dsi->pixel_overlap);
@@ -323,16 +335,16 @@ static void configure_dual_link_mode(struct intel_encoder *encoder,
323335

324336
dss_ctl1 &= ~LEFT_DL_BUF_TARGET_DEPTH_MASK;
325337
dss_ctl1 |= LEFT_DL_BUF_TARGET_DEPTH(dl_buffer_depth);
326-
dss_ctl2 = intel_de_read(dev_priv, DSS_CTL2);
338+
dss_ctl2 = intel_de_read(dev_priv, dss_ctl2_reg);
327339
dss_ctl2 &= ~RIGHT_DL_BUF_TARGET_DEPTH_MASK;
328340
dss_ctl2 |= RIGHT_DL_BUF_TARGET_DEPTH(dl_buffer_depth);
329-
intel_de_write(dev_priv, DSS_CTL2, dss_ctl2);
341+
intel_de_write(dev_priv, dss_ctl2_reg, dss_ctl2);
330342
} else {
331343
/* Interleave */
332344
dss_ctl1 |= DUAL_LINK_MODE_INTERLEAVE;
333345
}
334346

335-
intel_de_write(dev_priv, DSS_CTL1, dss_ctl1);
347+
intel_de_write(dev_priv, dss_ctl1_reg, dss_ctl1);
336348
}
337349

338350
/* aka DSI 8X clock */

0 commit comments

Comments
 (0)