Check for if scanline values are updated or not in PIPE_SCANLINE register before we move on from trnascoder enablement. This needs to be done because we need to make sure we are not getting stale values from PIPE_SCANLINE register since we use the scanline value to make a decision if an atomic commit can go through. Without this change we see Atomic update failure warning with the following signature: [drm] *ERROR* Atomic update failure on pipe B (start=457 end=458) time 50 us, min 2128, max 2161, scanline start 411, end 2165 where the atomic commit takes less than 100us but we still see a vblank count jump and a big leap in scanline.
Bspec: 69961 Signed-off-by: Suraj Kandpal <[email protected]> --- drivers/gpu/drm/i915/display/intel_display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7491e00e3858..c6f830033509 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -490,14 +490,15 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) intel_de_posting_read(display, TRANSCONF(display, cpu_transcoder)); /* - * Until the pipe starts PIPEDSL reads will return a stale value, - * which causes an apparent vblank timestamp jump when PIPEDSL + * Until the pipe starts PIPEDSL/PIPE_SCANLINE reads will return a + * stale value, this is because it may take 1 vblank for TRANSCONF + * register to enable the pipe, which causes an apparent vblank + * timestamp and scaline jump jump when PIPEDSL/PIPE_SCANLINE * resets to its proper value. That also messes up the frame count * when it's derived from the timestamps. So let's wait for the * pipe to start properly before we call drm_crtc_vblank_on() */ - if (intel_crtc_max_vblank_count(new_crtc_state) == 0) - intel_wait_for_pipe_scanline_moving(crtc); + intel_wait_for_pipe_scanline_moving(crtc); } void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) -- 2.34.1
