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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:19:41 +0000 (17:19 +0000)
commitb58ace0e8c981ab884d5014369aea9f3d611d5e4
tree15ba90e085e29499a4456353aadae4ea510b1709
parent745682e634ca92b3704991ae7b5abb0798e1571e
drm/amd/display: fix num_ways overflow error

[ Upstream commit 79f3f1b66753b3a3a269d73676bf50987921f267 ]

[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c