Skip to content

Commit eb4556f

Browse files
committed
drm/i915/dsb: Fix dewake scanline
Currently we calculate the DEwake scanline based on the delayed vblank start, while in reality it should be computed based on the undelayed vblank start (as that is where the DSB actually starts). Currently it doesn't really matter as we don't have any vblank delay configured, but that may change in the future so let's be accurate in what we do. We can also remove the max() as intel_crtc_scanline_to_hw() can deal with negative numbers, which there really shouldn't be anyway. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Animesh Manna <[email protected]>
1 parent 70a65a5 commit eb4556f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,10 @@ struct intel_dsb {
8686
static int dsb_dewake_scanline(const struct intel_crtc_state *crtc_state)
8787
{
8888
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
89-
const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
9089
unsigned int latency = skl_watermark_max_latency(i915, 0);
91-
int vblank_start;
9290

93-
if (crtc_state->vrr.enable)
94-
vblank_start = intel_vrr_vmin_vblank_start(crtc_state);
95-
else
96-
vblank_start = intel_mode_vblank_start(adjusted_mode);
97-
98-
return max(0, vblank_start - intel_usecs_to_scanlines(adjusted_mode, latency));
91+
return intel_mode_vdisplay(&crtc_state->hw.adjusted_mode) -
92+
intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, latency);
9993
}
10094

10195
static u32 dsb_chicken(struct intel_crtc *crtc)

0 commit comments

Comments
 (0)