]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/bw: Fix rounding direction in clperchgroup calculation
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 May 2026 20:03:41 +0000 (23:03 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 May 2026 03:50:36 +0000 (06:50 +0300)
The '8/num_channels' in the clperchgroup is supposed to be rounded
down according to the spec. Make it so.

Not sure we can ever actually have a non-power of two number of
channels, so this might not matter.

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

index 65f626b1a90eee42989833f73e52dbb1820180e9..53e83eb1a4253bf2725a509c02b0620eb2373257 100644 (file)
@@ -624,7 +624,7 @@ static int tgl_get_bw_info(struct intel_display *display,
         * clperchgroup = 4kpagespermempage * clperchperblock,
         * clperchperblock = 8 / num_channels * interleave
         */
-       clperchgroup = 4 * DIV_ROUND_UP(8, num_channels) * qi.deinterleave;
+       clperchgroup = 4 * (8 / num_channels) * qi.deinterleave;
 
        for (i = 0; i < num_groups; i++) {
                struct intel_bw_info *bi = &display->bw.max[i];