]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Update MCIF_ADDR macro to address IGT DWB regression
authorGaghik Khachatrian <gaghik.khachatrian@amd.com>
Mon, 13 Apr 2026 15:11:52 +0000 (11:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2026 19:45:28 +0000 (15:45 -0400)
[Why]
A previous warning-fix commit updated type casts in the DCN3
mmhubbub code but missed updating the MCIF_ADDR macro to the
correct, fully parenthesized and casted version. This caused
a regression during DWB tests, where address values could be
misinterpreted, potentially leading to incorrect hardware
programming.

[How]
Updated the MCIF_ADDR macro in dcn30_mmhubbub.c to use the
proper parenthesization and type casting, ensuring correct
address handling. Removed redundant casts from REG_UPDATE
calls for improved clarity and consistency with current
coding standards.

Fixes: f4cdbb5d5405 ("drm/amd/display: Fix implicit narrowing conversion warnings")
Reviewed-by: Clayton King <clayton.king@amd.com>
Signed-off-by: Gaghik Khachatrian <gaghik.khachatrian@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4f251a5e9f2297023b00b7cab606de111931cfa3)

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mmhubbub.c

index 6f2a0d5d963bd2fc7feff3055620568742574707..62fe5c3b18dc71f576a909c3e73583a81551f8e2 100644 (file)
@@ -40,8 +40,8 @@
 #define FN(reg_name, field_name) \
        mcif_wb30->mcif_wb_shift->field_name, mcif_wb30->mcif_wb_mask->field_name
 
-#define MCIF_ADDR(addr) (((unsigned long long)addr & 0xffffffffff) + 0xFE) >> 8
-#define MCIF_ADDR_HIGH(addr) (unsigned long long)addr >> 40
+#define MCIF_ADDR(addr) ((uint32_t)((((unsigned long long)(addr) & 0xffffffffffULL) + 0xFEULL) >> 8))
+#define MCIF_ADDR_HIGH(addr) ((uint32_t)(((unsigned long long)(addr)) >> 40))
 
 /* wbif programming guide:
  * 1. set up wbif parameter: