Commit e13b3f65 authored by Ville Syrjälä's avatar Ville Syrjälä

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-3-ville.syrjala@linux.intel.comReviewed-by: default avatarMitul Golani <mitulkumar.ajitkumar.golani@intel.com>
parent 435db526
...@@ -340,8 +340,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, ...@@ -340,8 +340,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc,
* matches how the scanline counter based position works since * matches how the scanline counter based position works since
* the scanline counter doesn't count the two half lines. * the scanline counter doesn't count the two half lines.
*/ */
if (position >= vtotal) position = min(position, vtotal - 1);
position = vtotal - 1;
/* /*
* Start of vblank interrupt is triggered at start of hsync, * Start of vblank interrupt is triggered at start of hsync,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment