aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_vblank.c
diff options
context:
space:
mode:
authorGravatar Ville Syrjälä <ville.syrjala@linux.intel.com> 2023-04-04 20:54:31 +0300
committerGravatar Ville Syrjälä <ville.syrjala@linux.intel.com> 2023-04-13 21:02:49 +0300
commite13b3f65af719e79046df2b1da6599eb387752e0 (patch)
tree67a4f80e4a86e0404f29c62f4a22bc25570d9ebd /drivers/gpu/drm/i915/display/intel_vblank.c
parentdrm/i915: Evade transcoder's vblank when doing seamless M/N changes (diff)
downloadlinux-e13b3f65af719e79046df2b1da6599eb387752e0.tar.gz
linux-e13b3f65af719e79046df2b1da6599eb387752e0.tar.bz2
linux-e13b3f65af719e79046df2b1da6599eb387752e0.zip
drm/i915: Use min() instead of hand rolling it
Most places in the vblank code use min() to clamp scanline counters below vtotal. But we missed one in the gen3/4 pixel counter based codepath. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-3-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_vblank.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_vblank.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
index 2e4f7de199d6..f5659ebd08eb 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.c
+++ b/drivers/gpu/drm/i915/display/intel_vblank.c
@@ -340,8 +340,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc,
* matches how the scanline counter based position works since
* the scanline counter doesn't count the two half lines.
*/
- if (position >= vtotal)
- position = vtotal - 1;
+ position = min(position, vtotal - 1);
/*
* Start of vblank interrupt is triggered at start of hsync,