Skip to content

Commit 359bcc9

Browse files
Dillon Varonealexdeucher
authored andcommitted
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 <[email protected]> Acked-by: Jasdeep Dhillon <[email protected]> Signed-off-by: Dillon Varone <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent aaae521 commit 359bcc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_stat
9797
* FLOOR(vp_x_start, blk_width)
9898
*/
9999
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) -
101101
(pipe->plane_res.scl_data.viewport.x / mblk_width * mblk_width);
102102

103103
/* full_vp_height_blk_aligned = FLOOR(vp_y_start + full_vp_height + blk_height - 1, blk_height) -
104104
* FLOOR(vp_y_start, blk_height)
105105
*/
106106
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) -
108108
(pipe->plane_res.scl_data.viewport.y / mblk_height * mblk_height);
109109

110110
/* mall_alloc_width_blk_aligned_l/c = full_vp_width_blk_aligned_l/c */

0 commit comments

Comments
 (0)