Skip to content

Commit 665f285

Browse files
AMD-aricalexdeucher
authored andcommitted
drm/amd/display: Fix crash during MPO + ODM combine mode recalculation
[Why] When calculating recout width for an MPO plane on a mode that's using ODM combine, driver can calculate a negative value, resulting in a crash. [How] For negative widths, use zero such that validation will prune the configuration correctly and disallow MPO. Signed-off-by: Aric Cyr <[email protected]> Reviewed-by: Krunoslav Kovac <[email protected]> Acked-by: Stylon Wang <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e4e3678 commit 665f285

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
799799
if (split_idx == split_count) {
800800
/* rightmost pipe is the remainder recout */
801801
data->recout.width -= data->h_active * split_count - data->recout.x;
802+
803+
/* ODM combine cases with MPO we can get negative widths */
804+
if (data->recout.width < 0)
805+
data->recout.width = 0;
806+
802807
data->recout.x = 0;
803808
} else
804809
data->recout.width = data->h_active - data->recout.x;

0 commit comments

Comments
 (0)