Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Fix arithmetic error in MALL size calculations for subvp

[Description]
Need to subtract unused section of the viewport when calculating required space
in MALL for subvp instead of adding, to prevent over allocation.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Jasdeep Dhillon <jdhillon@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Dillon Varone and committed by
Alex Deucher
359bcc90 aaae5211

+2 -2
+2 -2
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
··· 97 97 * FLOOR(vp_x_start, blk_width) 98 98 */ 99 99 full_vp_width_blk_aligned = ((pipe->plane_res.scl_data.viewport.x + 100 - pipe->plane_res.scl_data.viewport.width + mblk_width - 1) / mblk_width * mblk_width) + 100 + pipe->plane_res.scl_data.viewport.width + mblk_width - 1) / mblk_width * mblk_width) - 101 101 (pipe->plane_res.scl_data.viewport.x / mblk_width * mblk_width); 102 102 103 103 /* full_vp_height_blk_aligned = FLOOR(vp_y_start + full_vp_height + blk_height - 1, blk_height) - 104 104 * FLOOR(vp_y_start, blk_height) 105 105 */ 106 106 full_vp_height_blk_aligned = ((pipe->plane_res.scl_data.viewport.y + 107 - full_vp_height + mblk_height - 1) / mblk_height * mblk_height) + 107 + full_vp_height + mblk_height - 1) / mblk_height * mblk_height) - 108 108 (pipe->plane_res.scl_data.viewport.y / mblk_height * mblk_height); 109 109 110 110 /* mall_alloc_width_blk_aligned_l/c = full_vp_width_blk_aligned_l/c */