]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Revert DCN4 max buffered cursor size to 64
authorDillon Varone <Dillon.Varone@amd.com>
Thu, 23 Oct 2025 21:07:04 +0000 (17:07 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Nov 2025 16:53:20 +0000 (11:53 -0500)
[Why & How]
The buffered cursor cap is expressed assuming a square cursor, and usage
of the cursor buffer is limited by the request size. For greater than 32
pixels, the request size is fixed at 256 bytes, so the maximum width
must be floored to the nearest 256th byte. At 4bpp this means even with
24kB DCN4 can only hold a 64x64 cursor in the buffer as even 65 pixels
would require 512 bytes per line instead of 256.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c

index df0b664c0cd29da4eba5aa98f668ba12ba898a98..b276fec3e479a27e73662f808ceab819345db670 100644 (file)
@@ -2200,7 +2200,8 @@ static bool dcn32_resource_construct(
        dc->caps.i2c_speed_in_khz_hdcp = 100; /*1.4 w/a applied by default*/
        /* TODO: Bring max_cursor_size back to 256 after subvp cursor corruption is fixed*/
        dc->caps.max_cursor_size = 64;
-       dc->caps.max_buffered_cursor_size = 64; // sqrt(16 * 1024 / 4)
+       /* floor(sqrt(buf_size_bytes / bpp ) * bpp, fixed_req_size) / bpp = max_width */
+       dc->caps.max_buffered_cursor_size = 64; // floor(sqrt(16 * 1024 / 4) * 4, 256) / 4 = 64
        dc->caps.min_horizontal_blanking_period = 80;
        dc->caps.dmdata_alloc_size = 2048;
        dc->caps.mall_size_per_mem_channel = 4;