diff options
| author | Anson Jacob <[email protected]> | 2021-03-01 14:25:44 -0500 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-04-09 16:41:21 -0400 |
| commit | 54718747a6e1037317a8b3610c3be40621b2b75e (patch) | |
| tree | 4373da5a31aa5a5140f1e7c9ddfa582beae2870b /tools/perf/scripts/python | |
| parent | 3d223c5528a387f84ed8bdbed2ce05227be9afe0 (diff) | |
drm/amd/display: Fix UBSAN: shift-out-of-bounds warning
[Why]
On NAVI14 CONFIG_UBSAN reported shift-out-of-bounds at
display_rq_dlg_calc_20v2.c:304:38
rq_param->misc.rq_c.blk256_height is 0 when chroma(*_c) is invalid.
dml_log2 returns -1023 for log2(0), although log2(0) is undefined.
Which ended up as:
rq_param->dlg.rq_c.swath_height = 1 << -1023
[How]
Fix applied on all dml versions.
1. Ensure dml_log2 is only called if the argument is greater than 0.
2. Subtract req128_l/req128_c from log2_swath_height_l/log2_swath_height_c
only when it is greater than 0.
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Anson Jacob <[email protected]>
Reviewed-by: Dmytro Laktyushkin <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Solomon Chiu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions