]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: cleanup DCE6 a bit more
authorAlexandre Demers <alexandre.f.demers@gmail.com>
Sat, 22 Mar 2025 01:46:59 +0000 (21:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 19:18:33 +0000 (15:18 -0400)
Use shifts already available in DCE6's defines, masks and shifts.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/sid.h

index cbedf91b68bf77a0811cf897033bdf1b5f31afaf..2d85ea7159de84513697c7be814d0cc63e00b2e1 100644 (file)
@@ -1998,8 +1998,8 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,
        case DRM_FORMAT_ABGR8888:
                fb_format = ((GRPH_DEPTH_32BPP << GRPH_CONTROL__GRPH_DEPTH__SHIFT) |
                             (GRPH_FORMAT_ARGB8888 << GRPH_CONTROL__GRPH_FORMAT__SHIFT));
-               fb_swap = (GRPH_RED_CROSSBAR(GRPH_RED_SEL_B) |
-                          GRPH_BLUE_CROSSBAR(GRPH_BLUE_SEL_R));
+               fb_swap = ((GRPH_RED_SEL_B << GRPH_SWAP_CNTL__GRPH_RED_CROSSBAR__SHIFT) |
+                          (GRPH_BLUE_SEL_R << GRPH_SWAP_CNTL__GRPH_BLUE_CROSSBAR__SHIFT));
 #ifdef __BIG_ENDIAN
                fb_swap |= (GRPH_ENDIAN_8IN32 << GRPH_SWAP_CNTL__GRPH_ENDIAN_SWAP__SHIFT);
 #endif
index 0ace1ede24a7575e63cbb6caeabf05feca87cd65..fc61c2ea002f98527068a99514a332f847f96fd4 100644 (file)
 #define ES_AND_GS_AUTO       3
 #define BUF_SWAP_32BIT       (2 << 16)
 
-#define GRPH_RED_CROSSBAR(x)           (((x) & 0x3) << 4)
 #define GRPH_RED_SEL_R                 0
 #define GRPH_RED_SEL_G                 1
 #define GRPH_RED_SEL_B                 2
 #define GRPH_RED_SEL_A                 3
 
-#define GRPH_GREEN_CROSSBAR(x)         (((x) & 0x3) << 6)
 #define GRPH_GREEN_SEL_G               0
 #define GRPH_GREEN_SEL_B               1
 #define GRPH_GREEN_SEL_A               2
 #define GRPH_GREEN_SEL_R               3
 
-#define GRPH_BLUE_CROSSBAR(x)          (((x) & 0x3) << 8)
 #define GRPH_BLUE_SEL_B                0
 #define GRPH_BLUE_SEL_A                1
 #define GRPH_BLUE_SEL_R                2
 #define GRPH_BLUE_SEL_G                3
 
-#define GRPH_ALPHA_CROSSBAR(x)         (((x) & 0x3) << 10)
 #define GRPH_ALPHA_SEL_A               0
 #define GRPH_ALPHA_SEL_R               1
 #define GRPH_ALPHA_SEL_G               2