]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/bw: Fix 'deinterleave' rounding direction
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 May 2026 20:03:40 +0000 (23:03 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 May 2026 03:50:21 +0000 (06:50 +0300)
For some reason we're rounding up when calculating the deinterleave
value. But the spec says we should round down. Fix it.

But I suppose this doesn't actually matter since the deinterleave
values should always be power of two. The only exception is therefore
the deinterleave==1 case, which gets handled by the max(..., 1).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260522200346.17377-5-ville.syrjala@linux.intel.com
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
drivers/gpu/drm/i915/display/intel_bw.c

index 76aab2965858c0af75ac860d5734a3b614c1f5b7..65f626b1a90eee42989833f73e52dbb1820180e9 100644 (file)
@@ -607,7 +607,7 @@ static int tgl_get_bw_info(struct intel_display *display,
        qi.deinterleave = qi.deinterleave ? : DIV_ROUND_UP(num_channels, is_y_tile ? 4 : 2);
 
        if (num_channels < qi.max_numchannels && DISPLAY_VER(display) >= 12)
-               qi.deinterleave = max(DIV_ROUND_UP(qi.deinterleave, 2), 1);
+               qi.deinterleave = max(qi.deinterleave / 2, 1);
 
        if (DISPLAY_VER(display) >= 12 && num_channels > qi.max_numchannels)
                drm_warn(display->drm, "Number of channels exceeds max number of channels.");