From: Ville Syrjälä Date: Fri, 22 May 2026 20:03:40 +0000 (+0300) Subject: drm/i915/bw: Fix 'deinterleave' rounding direction X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67309d7fbe2084d5470e46754be9e4ff26068d34;p=thirdparty%2Fkernel%2Flinux.git drm/i915/bw: Fix 'deinterleave' rounding direction 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ä Link: https://patch.msgid.link/20260522200346.17377-5-ville.syrjala@linux.intel.com Reviewed-by: Michał Grzelak --- diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c index 76aab2965858c..65f626b1a90ee 100644 --- a/drivers/gpu/drm/i915/display/intel_bw.c +++ b/drivers/gpu/drm/i915/display/intel_bw.c @@ -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.");