Skip to content

Commit 4d9e93a

Browse files
Yihan Zhujfvogel
authored andcommitted
drm/amd/display: handle max_downscale_src_width fail check
[ Upstream commit 02a940da2ccc0cc0299811379580852b405a0ea2 ] [WHY] If max_downscale_src_width check fails, we exit early from TAP calculation and left a NULL value to the scaling data structure to cause the zero divide in the DML validation. [HOW] Call set default TAP calculation before early exit in get_optimal_number_of_taps due to max downscale limit exceed. Reviewed-by: Samson Tam <[email protected]> Signed-off-by: Yihan Zhu <[email protected]> Signed-off-by: Zaeem Mohamed <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 54dd746ed8a30175444076c9b4fdd15cf86e0842) Signed-off-by: Jack Vogel <[email protected]>
1 parent 67b44ed commit 4d9e93a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,6 @@ bool dpp3_get_optimal_number_of_taps(
425425
int min_taps_y, min_taps_c;
426426
enum lb_memory_config lb_config;
427427

428-
if (scl_data->viewport.width > scl_data->h_active &&
429-
dpp->ctx->dc->debug.max_downscale_src_width != 0 &&
430-
scl_data->viewport.width > dpp->ctx->dc->debug.max_downscale_src_width)
431-
return false;
432-
433428
/*
434429
* Set default taps if none are provided
435430
* From programming guide: taps = min{ ceil(2*H_RATIO,1), 8} for downscaling
@@ -467,6 +462,12 @@ bool dpp3_get_optimal_number_of_taps(
467462
else
468463
scl_data->taps.h_taps_c = in_taps->h_taps_c;
469464

465+
// Avoid null data in the scl data with this early return, proceed non-adaptive calcualtion first
466+
if (scl_data->viewport.width > scl_data->h_active &&
467+
dpp->ctx->dc->debug.max_downscale_src_width != 0 &&
468+
scl_data->viewport.width > dpp->ctx->dc->debug.max_downscale_src_width)
469+
return false;
470+
470471
/*Ensure we can support the requested number of vtaps*/
471472
min_taps_y = dc_fixpt_ceil(scl_data->ratios.vert);
472473
min_taps_c = dc_fixpt_ceil(scl_data->ratios.vert_c);

0 commit comments

Comments
 (0)