Files
android_kernel_xiaomi_sm8450/drivers/gpu/drm/amd/amdgpu
Arnd Bergmann 826ef15769 drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()
[ Upstream commit 822130b5e8834ab30ad410cf19a582e5014b9a85 ]

On 32-bit architectures comparing a resource against a value larger than
U32_MAX can cause a warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
                    res->start > 0x100000000ull)
                    ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~

As gcc does not warn about this in dead code, add an IS_ENABLED() check at
the start of the function. This will always return success but not actually resize
the BAR on 32-bit architectures without high memory, which is exactly what
we want here, as the driver can fall back to bank switching the VRAM
access.

Fixes: 31b8adab32 ("drm/amdgpu: require a root bus window above 4GB for BAR resize")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:20:11 +02:00
..
2021-06-03 09:00:44 +02:00
2019-09-16 09:59:21 -05:00
2019-06-20 11:36:22 -05:00
2019-06-10 23:00:01 +02:00
2020-10-30 01:17:43 -04:00
2021-03-09 11:11:12 +01:00
2022-04-20 09:23:18 +02:00
2020-05-22 13:41:53 -04:00
2020-07-02 12:02:50 -04:00
2020-07-01 01:59:24 -04:00
2020-08-14 16:22:39 -04:00
2020-11-24 12:30:37 -05:00
2020-07-01 01:59:24 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2023-06-14 11:09:49 +02:00
2020-07-02 12:02:50 -04:00