For TGL the TRANS_SET_CONTEXT_LATENCY doesn't exist to account for SCL.
However, the VBLANK_START-VACTIVE diffence plays an identical role here ie.
it can be used to create the SCL window ahead of the undelayed vblank.

While readback there is no specific register to read out the SCL, so use
the same helper intel_crtc_compute_scl() and reduce the vblank_start by
this amount.

Signed-off-by: Ankit Nautiyal <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c 
b/drivers/gpu/drm/i915/display/intel_display.c
index 5a7794387ea2..455bbebb50a5 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2822,6 +2822,16 @@ static void intel_get_transcoder_timings(struct 
intel_crtc *crtc,
                adjusted_mode->crtc_vblank_end += 1;
        }
 
+       if (DISPLAY_VER(display) == 12) {
+               /*
+                * There is no specific register for SCL for TGL.
+                * Derive the value from the helper 
intel_crtc_set_context_latency().
+                * crtc_vblank_start needs to be reduced with this amount.
+                */
+               pipe_config->set_context_latency = 
intel_crtc_set_context_latency(pipe_config);
+               adjusted_mode->crtc_vblank_start -= 
pipe_config->set_context_latency;
+       }
+
        if (DISPLAY_VER(display) >= 13 && !transcoder_is_dsi(cpu_transcoder)) {
                pipe_config->set_context_latency =
                        intel_de_read(display,
-- 
2.45.2

Reply via email to