drm/amd/display: fix num_ways overflow error
authorSamson Tam <samson.tam@amd.com>
Thu, 5 Oct 2023 05:31:12 +0000 (01:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Oct 2023 23:00:15 +0000 (19:00 -0400)
commit79f3f1b66753b3a3a269d73676bf50987921f267
treee502153d11a2f07da333d7c0c8c7f8218cbed74e
parentc4066d8be4d8c7c01d74ba1872cab2bc589d4912
drm/amd/display: fix num_ways overflow error

[Why]
Helper function calculates num_ways using 32-bit.  But is
 returned as 8-bit.  If num_ways exceeds 8-bit, then it
 reports back the incorrect num_ways and erroneously
 uses MALL when it should not

[How]
Make returned value 32-bit and convert after it checks
 against caps.cache_num_ways, which is under 8-bit

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Samson Tam <samson.tam@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c