Skip to content

Commit f127511

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915/dsb: Fix DSB vblank waits when using VRR
Looks like the undelayed vblank gets signalled exactly when the active period ends. That is a problem for DSB+VRR when we are already in vblank and expect DSB to start executing as soon as we send the push. Instead of starting, the DSB just keeps on waiting for the undelayed vblank which won't signal until the end of the next frame's active period, which is far too late. The end result is that DSB won't have even started executing by the time the flips/etc. have completed. We then wait for an extra 1ms, after which we terminate the DSB and report a timeout: [drm] *ERROR* [CRTC:80:pipe A] DSB 0 timed out waiting for idle (current head=0xfedf4000, head=0x0, tail=0x1080) To fix this let's configure DSB to use the so called VRR "safe window" instead of the undelayed vblank to trigger the DSB vblank logic, when VRR is enabled. Cc: [email protected] Fixes: 34d8311 ("drm/i915/dsb: Re-instate DSB for LUT updates") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9927 Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Animesh Manna <[email protected]> (cherry picked from commit 41429d9) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent f7d3b92 commit f127511

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ static int intel_dsb_dewake_scanline(const struct intel_crtc_state *crtc_state)
340340
return max(0, vblank_start - intel_usecs_to_scanlines(adjusted_mode, latency));
341341
}
342342

343+
static u32 dsb_chicken(struct intel_crtc *crtc)
344+
{
345+
if (crtc->mode_flags & I915_MODE_FLAG_VRR)
346+
return DSB_CTRL_WAIT_SAFE_WINDOW |
347+
DSB_CTRL_NO_WAIT_VBLANK |
348+
DSB_INST_WAIT_SAFE_WINDOW |
349+
DSB_INST_NO_WAIT_VBLANK;
350+
else
351+
return 0;
352+
}
353+
343354
static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
344355
int dewake_scanline)
345356
{
@@ -361,6 +372,9 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
361372
intel_de_write_fw(dev_priv, DSB_CTRL(pipe, dsb->id),
362373
ctrl | DSB_ENABLE);
363374

375+
intel_de_write_fw(dev_priv, DSB_CHICKEN(pipe, dsb->id),
376+
dsb_chicken(crtc));
377+
364378
intel_de_write_fw(dev_priv, DSB_HEAD(pipe, dsb->id),
365379
intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf));
366380

0 commit comments

Comments
 (0)