Skip to contentSkip to conversation

Uniformize defines between DCE6, DCE8 and DCE10

PATCH Applied Alexandre Demers 2 participants 6 messages Mar 9, 2025 – Mar 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover Uniformize defines between DCE6, DCE8 and DCE10

Keep a uniform way of where and how variables are defined between DCE6, DCE8 and DCE10. It is easier to understand the code, their similarities and their modifications.

Since sid.h is being wired up in dce_v6_0.c, duplicated defines need to be cleaned up in sid.h and si_enums.h.

V4:
* Reorder patches so each one compiles properly.
* Remove drm-amdgpu-add-defines-for-pin_offsets-in-DCE8.patch since it was already approved and applied.

A bigger round of cleanup is coming to remove more of the duplicated and unused defines found in sid.h and si_enums.h and continue the uniformization.

Alexandre Demers (3):
drm/amdgpu: fix warning and errors caused by duplicated defines in
sid.h
drm/amdgpu: move and fix X_GB_ADDR_CONFIG_GOLDEN values drm/amdgpu: add or move defines for DCE6 in sid.h

 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |  73 ++---
 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c |  15 +-
 drivers/gpu/drm/amd/amdgpu/si.c       |  68 ++---
 drivers/gpu/drm/amd/amdgpu/si_enums.h |  12 -
 drivers/gpu/drm/amd/amdgpu/sid.h      | 369 ++------------------------
 5 files changed, 111 insertions(+), 426 deletions(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH v4 1/3 drm/amdgpu: prepare DCE6 uniformisation with DCE8 and DCE10

Let's begin the cleanup in sid.h to prevent warnings and errors when wiring sid.h into dce_v6_0.c.

This is a bigger cleanup.
Many defines found under sid.h have already been properly moved into the different "_d.h" and "_sh_mask.h", so they should have been already removed from sid.h and properly linked in where needed.

---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |  10 +-
 drivers/gpu/drm/amd/amdgpu/si.c       |  68 +++---
 drivers/gpu/drm/amd/amdgpu/sid.h      | 336 +-------------------------
 3 files changed, 43 insertions(+), 371 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +8 -2
index a72fd7220081..47b0e4848a56 100644
@@ -40,18 +40,24 @@
 #include "amdgpu_connectors.h"
 #include "amdgpu_display.h"
 
+#include "dce_v6_0.h"
+
 #include "bif/bif_3_0_d.h"
 #include "bif/bif_3_0_sh_mask.h"
+
 #include "oss/oss_1_0_d.h"
 #include "oss/oss_1_0_sh_mask.h"
+
 #include "gca/gfx_6_0_d.h"
 #include "gca/gfx_6_0_sh_mask.h"
+#include "gca/gfx_7_2_enum.h"
+
 #include "gmc/gmc_6_0_d.h"
 #include "gmc/gmc_6_0_sh_mask.h"
+
 #include "dce/dce_6_0_d.h"
 #include "dce/dce_6_0_sh_mask.h"
-#include "gca/gfx_7_2_enum.h"
-#include "dce_v6_0.h"
+
 #include "si_enums.h"
 
 static void dce_v6_0_set_display_funcs(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/si.c +34 -34

75 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/sid.h +1 -335

436 lines not on this page · raw message

Signature · 1 line
2.48.1
#2 lore raw

PATCH v4 2/3 drm/amdgpu: fix SI's GB_ADDR_CONFIG_GOLDEN values and wire up sid.h in GFX6

In reply to Alexandre Demers

By wiring up sid.h in GFX6, we end up with a few duplicated defines such as the golden registers. Let's clean this up.

[TAHITI,VERDE, HAINAN]_GB_ADDR_CONFIG_GOLDEN were defined both in sid.h and under si_enums.h, with different values. Keep the values used under radeon and move them under gfx_v6_0.c where they are used (as it is done under cik)

---
 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 15 +++++++++++++--
 drivers/gpu/drm/amd/amdgpu/si_enums.h |  6 ------
 drivers/gpu/drm/amd/amdgpu/sid.h      |  4 ----
 3 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +13 -2
index 41f50bf380c4..4476fb816659 100644
@@ -28,19 +28,30 @@
 #include "amdgpu_gfx.h"
 #include "amdgpu_ucode.h"
 #include "clearstate_si.h"
+#include "si.h"
+#include "sid.h"
+
 #include "bif/bif_3_0_d.h"
 #include "bif/bif_3_0_sh_mask.h"
+
 #include "oss/oss_1_0_d.h"
 #include "oss/oss_1_0_sh_mask.h"
+
 #include "gca/gfx_6_0_d.h"
 #include "gca/gfx_6_0_sh_mask.h"
+#include "gca/gfx_7_2_enum.h"
+
 #include "gmc/gmc_6_0_d.h"
 #include "gmc/gmc_6_0_sh_mask.h"
+
 #include "dce/dce_6_0_d.h"
 #include "dce/dce_6_0_sh_mask.h"
-#include "gca/gfx_7_2_enum.h"
+
 #include "si_enums.h"
-#include "si.h"
+
+#define TAHITI_GB_ADDR_CONFIG_GOLDEN        0x12011003
+#define VERDE_GB_ADDR_CONFIG_GOLDEN         0x12010002
+#define HAINAN_GB_ADDR_CONFIG_GOLDEN        0x02010001
 
 static void gfx_v6_0_set_ring_funcs(struct amdgpu_device *adev);
 static void gfx_v6_0_set_irq_funcs(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/si_enums.h +0 -6
index 4e935baa7b91..cd9b0a654991 100644
@@ -128,8 +128,6 @@
 #define SI_CRTC4_REGISTER_OFFSET                0x2c00
 #define SI_CRTC5_REGISTER_OFFSET                0x2f00
 
-#define DMA0_REGISTER_OFFSET 0x000
-#define DMA1_REGISTER_OFFSET 0x200
 #define ES_AND_GS_AUTO       3
 #define RADEON_PACKET_TYPE3  3
 #define CE_PARTITION_BASE    3
@@ -161,10 +159,6 @@
 #define RLC_SAVE_AND_RESTORE_STARTING_OFFSET 0x90
 #define RLC_CLEAR_STATE_DESCRIPTOR_OFFSET    0x3D
 
-#define TAHITI_GB_ADDR_CONFIG_GOLDEN        0x12011003
-#define VERDE_GB_ADDR_CONFIG_GOLDEN         0x02010002
-#define HAINAN_GB_ADDR_CONFIG_GOLDEN        0x02011003
-
 #define PACKET3(op, n)  ((RADEON_PACKET_TYPE3 << 30) |                  \
                          (((op) & 0xFF) << 8) |                         \
                          ((n) & 0x3FFF) << 16)
drivers/gpu/drm/amd/amdgpu/sid.h +0 -4
index 2218fd99ee83..bf228a1dedff 100644
@@ -26,10 +26,6 @@
 
 #define TAHITI_RB_BITMAP_WIDTH_PER_SH  2
 
-#define TAHITI_GB_ADDR_CONFIG_GOLDEN        0x12011003
-#define VERDE_GB_ADDR_CONFIG_GOLDEN         0x12010002
-#define HAINAN_GB_ADDR_CONFIG_GOLDEN        0x02010001
-
 #define SI_MAX_SH_GPRS		 	256
 #define SI_MAX_TEMP_GPRS         	16
 #define SI_MAX_SH_THREADS        	256
Signature · 1 line
2.48.1
#3 lore raw

PATCH v4 3/3 drm/amdgpu: finish wiring up sid.h in DCE6

In reply to Alexandre Demers

For coherence with DCE8 et DCE10, add or move some values under sid.h and remove duplicated from si_enums.h.

---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 63 ++++++++++++++-------------
 drivers/gpu/drm/amd/amdgpu/si_enums.h |  6 ---
 drivers/gpu/drm/amd/amdgpu/sid.h      | 29 +++++++++---
 3 files changed, 55 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +32 -31
index 47b0e4848a56..e1b0779e835f 100644
@@ -41,6 +41,7 @@
 #include "amdgpu_display.h"
 
 #include "dce_v6_0.h"
+#include "sid.h"
 
 #include "bif/bif_3_0_d.h"
 #include "bif/bif_3_0_sh_mask.h"
@@ -65,31 +66,31 @@ static void dce_v6_0_set_irq_funcs(struct amdgpu_device *adev);
 
 static const u32 crtc_offsets[6] =
 {
-	SI_CRTC0_REGISTER_OFFSET,
-	SI_CRTC1_REGISTER_OFFSET,
-	SI_CRTC2_REGISTER_OFFSET,
-	SI_CRTC3_REGISTER_OFFSET,
-	SI_CRTC4_REGISTER_OFFSET,
-	SI_CRTC5_REGISTER_OFFSET
+	CRTC0_REGISTER_OFFSET,
+	CRTC1_REGISTER_OFFSET,
+	CRTC2_REGISTER_OFFSET,
+	CRTC3_REGISTER_OFFSET,
+	CRTC4_REGISTER_OFFSET,
+	CRTC5_REGISTER_OFFSET
 };
 
 static const u32 hpd_offsets[] =
 {
-	mmDC_HPD1_INT_STATUS - mmDC_HPD1_INT_STATUS,
-	mmDC_HPD2_INT_STATUS - mmDC_HPD1_INT_STATUS,
-	mmDC_HPD3_INT_STATUS - mmDC_HPD1_INT_STATUS,
-	mmDC_HPD4_INT_STATUS - mmDC_HPD1_INT_STATUS,
-	mmDC_HPD5_INT_STATUS - mmDC_HPD1_INT_STATUS,
-	mmDC_HPD6_INT_STATUS - mmDC_HPD1_INT_STATUS,
+	HPD0_REGISTER_OFFSET,
+	HPD1_REGISTER_OFFSET,
+	HPD2_REGISTER_OFFSET,
+	HPD3_REGISTER_OFFSET,
+	HPD4_REGISTER_OFFSET,
+	HPD5_REGISTER_OFFSET
 };
 
 static const uint32_t dig_offsets[] = {
-	SI_CRTC0_REGISTER_OFFSET,
-	SI_CRTC1_REGISTER_OFFSET,
-	SI_CRTC2_REGISTER_OFFSET,
-	SI_CRTC3_REGISTER_OFFSET,
-	SI_CRTC4_REGISTER_OFFSET,
-	SI_CRTC5_REGISTER_OFFSET,
+	CRTC0_REGISTER_OFFSET,
+	CRTC1_REGISTER_OFFSET,
+	CRTC2_REGISTER_OFFSET,
+	CRTC3_REGISTER_OFFSET,
+	CRTC4_REGISTER_OFFSET,
+	CRTC5_REGISTER_OFFSET,
 	(0x13830 - 0x7030) >> 2,
 };
 
@@ -1365,13 +1366,13 @@ static void dce_v6_0_audio_enable(struct amdgpu_device *adev,
 
 static const u32 pin_offsets[7] =
 {
-	(0x1780 - 0x1780),
-	(0x1786 - 0x1780),
-	(0x178c - 0x1780),
-	(0x1792 - 0x1780),
-	(0x1798 - 0x1780),
-	(0x179d - 0x1780),
-	(0x17a4 - 0x1780),
+	AUD0_REGISTER_OFFSET,
+	AUD1_REGISTER_OFFSET,
+	AUD2_REGISTER_OFFSET,
+	AUD3_REGISTER_OFFSET,
+	AUD4_REGISTER_OFFSET,
+	AUD5_REGISTER_OFFSET,
+	AUD6_REGISTER_OFFSET,
 };
 
 static int dce_v6_0_audio_init(struct amdgpu_device *adev)
@@ -2882,22 +2883,22 @@ static void dce_v6_0_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
 
 	switch (crtc) {
 	case 0:
-		reg_block = SI_CRTC0_REGISTER_OFFSET;
+		reg_block = CRTC0_REGISTER_OFFSET;
 		break;
 	case 1:
-		reg_block = SI_CRTC1_REGISTER_OFFSET;
+		reg_block = CRTC1_REGISTER_OFFSET;
 		break;
 	case 2:
-		reg_block = SI_CRTC2_REGISTER_OFFSET;
+		reg_block = CRTC2_REGISTER_OFFSET;
 		break;
 	case 3:
-		reg_block = SI_CRTC3_REGISTER_OFFSET;
+		reg_block = CRTC3_REGISTER_OFFSET;
 		break;
 	case 4:
-		reg_block = SI_CRTC4_REGISTER_OFFSET;
+		reg_block = CRTC4_REGISTER_OFFSET;
 		break;
 	case 5:
-		reg_block = SI_CRTC5_REGISTER_OFFSET;
+		reg_block = CRTC5_REGISTER_OFFSET;
 		break;
 	default:
 		DRM_DEBUG("invalid crtc %d\n", crtc);
drivers/gpu/drm/amd/amdgpu/si_enums.h +0 -6
index cd9b0a654991..d656ef1fa6e1 100644
@@ -121,12 +121,6 @@
 #define CURSOR_UPDATE_LOCK             (1 << 16)
 #define CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24)
 
-#define SI_CRTC0_REGISTER_OFFSET                0
-#define SI_CRTC1_REGISTER_OFFSET                0x300
-#define SI_CRTC2_REGISTER_OFFSET                0x2600
-#define SI_CRTC3_REGISTER_OFFSET                0x2900
-#define SI_CRTC4_REGISTER_OFFSET                0x2c00
-#define SI_CRTC5_REGISTER_OFFSET                0x2f00
 
 #define ES_AND_GS_AUTO       3
 #define RADEON_PACKET_TYPE3  3
drivers/gpu/drm/amd/amdgpu/sid.h +23 -6
index bf228a1dedff..cbf232f5235b 100644
@@ -1700,12 +1700,29 @@
 
 //#dce stupp
 /* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
-#define SI_CRTC0_REGISTER_OFFSET                0 //(0x6df0 - 0x6df0)/4
-#define SI_CRTC1_REGISTER_OFFSET                0x300 //(0x79f0 - 0x6df0)/4
-#define SI_CRTC2_REGISTER_OFFSET                0x2600 //(0x105f0 - 0x6df0)/4
-#define SI_CRTC3_REGISTER_OFFSET                0x2900 //(0x111f0 - 0x6df0)/4
-#define SI_CRTC4_REGISTER_OFFSET                0x2c00 //(0x11df0 - 0x6df0)/4
-#define SI_CRTC5_REGISTER_OFFSET                0x2f00 //(0x129f0 - 0x6df0)/4
+#define CRTC0_REGISTER_OFFSET                 (0x1b7c - 0x1b7c) //(0x6df0 - 0x6df0)/4
+#define CRTC1_REGISTER_OFFSET                 (0x1e7c - 0x1b7c) //(0x79f0 - 0x6df0)/4
+#define CRTC2_REGISTER_OFFSET                 (0x417c - 0x1b7c) //(0x105f0 - 0x6df0)/4
+#define CRTC3_REGISTER_OFFSET                 (0x447c - 0x1b7c) //(0x111f0 - 0x6df0)/4
+#define CRTC4_REGISTER_OFFSET                 (0x477c - 0x1b7c) //(0x11df0 - 0x6df0)/4
+#define CRTC5_REGISTER_OFFSET                 (0x4a7c - 0x1b7c) //(0x129f0 - 0x6df0)/4
+
+/* hpd instance offsets */
+#define HPD0_REGISTER_OFFSET                 (0x1807 - 0x1807)
+#define HPD1_REGISTER_OFFSET                 (0x180a - 0x1807)
+#define HPD2_REGISTER_OFFSET                 (0x180d - 0x1807)
+#define HPD3_REGISTER_OFFSET                 (0x1810 - 0x1807)
+#define HPD4_REGISTER_OFFSET                 (0x1813 - 0x1807)
+#define HPD5_REGISTER_OFFSET                 (0x1816 - 0x1807)
+
+/* audio endpt instance offsets */
+#define AUD0_REGISTER_OFFSET                 (0x1780 - 0x1780)
+#define AUD1_REGISTER_OFFSET                 (0x1786 - 0x1780)
+#define AUD2_REGISTER_OFFSET                 (0x178c - 0x1780)
+#define AUD3_REGISTER_OFFSET                 (0x1792 - 0x1780)
+#define AUD4_REGISTER_OFFSET                 (0x1798 - 0x1780)
+#define AUD5_REGISTER_OFFSET                 (0x179d - 0x1780)
+#define AUD6_REGISTER_OFFSET                 (0x17a4 - 0x1780)
 
 #define CURSOR_WIDTH 64
 #define CURSOR_HEIGHT 64
Signature · 1 line
2.48.1
Applied
#4 lore raw

Re: [PATCH v4 3/3] drm/amdgpu: finish wiring up sid.h in DCE6

Applied the series. Thanks!

Alex

Quoted 183 lines · Alexandre Demers

For coherence with DCE8 et DCE10, add or move some values under sid.h and remove duplicated from si_enums.h.

---
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 63 ++++++++++++++-------------
 drivers/gpu/drm/amd/amdgpu/si_enums.h |  6 ---
 drivers/gpu/drm/amd/amdgpu/sid.h      | 29 +++++++++---
 3 files changed, 55 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +32 -31
index 47b0e4848a56..e1b0779e835f 100644
@@ -41,6 +41,7 @@
 #include "amdgpu_display.h"
 
 #include "dce_v6_0.h"
+#include "sid.h"
 
 #include "bif/bif_3_0_d.h"
 #include "bif/bif_3_0_sh_mask.h"
@@ -65,31 +66,31 @@ static void dce_v6_0_set_irq_funcs(struct amdgpu_device *adev);
 
 static const u32 crtc_offsets[6] =
 {
-       SI_CRTC0_REGISTER_OFFSET,
-       SI_CRTC1_REGISTER_OFFSET,
-       SI_CRTC2_REGISTER_OFFSET,
-       SI_CRTC3_REGISTER_OFFSET,
-       SI_CRTC4_REGISTER_OFFSET,
-       SI_CRTC5_REGISTER_OFFSET
+       CRTC0_REGISTER_OFFSET,
+       CRTC1_REGISTER_OFFSET,
+       CRTC2_REGISTER_OFFSET,
+       CRTC3_REGISTER_OFFSET,
+       CRTC4_REGISTER_OFFSET,
+       CRTC5_REGISTER_OFFSET
 };
 
 static const u32 hpd_offsets[] =
 {
-       mmDC_HPD1_INT_STATUS - mmDC_HPD1_INT_STATUS,
-       mmDC_HPD2_INT_STATUS - mmDC_HPD1_INT_STATUS,
-       mmDC_HPD3_INT_STATUS - mmDC_HPD1_INT_STATUS,
-       mmDC_HPD4_INT_STATUS - mmDC_HPD1_INT_STATUS,
-       mmDC_HPD5_INT_STATUS - mmDC_HPD1_INT_STATUS,
-       mmDC_HPD6_INT_STATUS - mmDC_HPD1_INT_STATUS,
+       HPD0_REGISTER_OFFSET,
+       HPD1_REGISTER_OFFSET,
+       HPD2_REGISTER_OFFSET,
+       HPD3_REGISTER_OFFSET,
+       HPD4_REGISTER_OFFSET,
+       HPD5_REGISTER_OFFSET
 };
 
 static const uint32_t dig_offsets[] = {
-       SI_CRTC0_REGISTER_OFFSET,
-       SI_CRTC1_REGISTER_OFFSET,
-       SI_CRTC2_REGISTER_OFFSET,
-       SI_CRTC3_REGISTER_OFFSET,
-       SI_CRTC4_REGISTER_OFFSET,
-       SI_CRTC5_REGISTER_OFFSET,
+       CRTC0_REGISTER_OFFSET,
+       CRTC1_REGISTER_OFFSET,
+       CRTC2_REGISTER_OFFSET,
+       CRTC3_REGISTER_OFFSET,
+       CRTC4_REGISTER_OFFSET,
+       CRTC5_REGISTER_OFFSET,
        (0x13830 - 0x7030) >> 2,
 };
 
@@ -1365,13 +1366,13 @@ static void dce_v6_0_audio_enable(struct amdgpu_device *adev,
 
 static const u32 pin_offsets[7] =
 {
-       (0x1780 - 0x1780),
-       (0x1786 - 0x1780),
-       (0x178c - 0x1780),
-       (0x1792 - 0x1780),
-       (0x1798 - 0x1780),
-       (0x179d - 0x1780),
-       (0x17a4 - 0x1780),
+       AUD0_REGISTER_OFFSET,
+       AUD1_REGISTER_OFFSET,
+       AUD2_REGISTER_OFFSET,
+       AUD3_REGISTER_OFFSET,
+       AUD4_REGISTER_OFFSET,
+       AUD5_REGISTER_OFFSET,
+       AUD6_REGISTER_OFFSET,
 };
 
 static int dce_v6_0_audio_init(struct amdgpu_device *adev)
@@ -2882,22 +2883,22 @@ static void dce_v6_0_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
 
        switch (crtc) {
        case 0:
-               reg_block = SI_CRTC0_REGISTER_OFFSET;
+               reg_block = CRTC0_REGISTER_OFFSET;
                break;
        case 1:
-               reg_block = SI_CRTC1_REGISTER_OFFSET;
+               reg_block = CRTC1_REGISTER_OFFSET;
                break;
        case 2:
-               reg_block = SI_CRTC2_REGISTER_OFFSET;
+               reg_block = CRTC2_REGISTER_OFFSET;
                break;
        case 3:
-               reg_block = SI_CRTC3_REGISTER_OFFSET;
+               reg_block = CRTC3_REGISTER_OFFSET;
                break;
        case 4:
-               reg_block = SI_CRTC4_REGISTER_OFFSET;
+               reg_block = CRTC4_REGISTER_OFFSET;
                break;
        case 5:
-               reg_block = SI_CRTC5_REGISTER_OFFSET;
+               reg_block = CRTC5_REGISTER_OFFSET;
                break;
        default:
                DRM_DEBUG("invalid crtc %d\n", crtc);
drivers/gpu/drm/amd/amdgpu/si_enums.h +0 -6
index cd9b0a654991..d656ef1fa6e1 100644
@@ -121,12 +121,6 @@
 #define CURSOR_UPDATE_LOCK             (1 << 16)
 #define CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24)
 
-#define SI_CRTC0_REGISTER_OFFSET                0
-#define SI_CRTC1_REGISTER_OFFSET                0x300
-#define SI_CRTC2_REGISTER_OFFSET                0x2600
-#define SI_CRTC3_REGISTER_OFFSET                0x2900
-#define SI_CRTC4_REGISTER_OFFSET                0x2c00
-#define SI_CRTC5_REGISTER_OFFSET                0x2f00
 
 #define ES_AND_GS_AUTO       3
 #define RADEON_PACKET_TYPE3  3
drivers/gpu/drm/amd/amdgpu/sid.h +23 -7
index bf228a1dedff..cbf232f5235b 100644
@@ -1700,12 +1700,29 @@
 
 //#dce stupp
 /* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
-#define SI_CRTC0_REGISTER_OFFSET                0 //(0x6df0 - 0x6df0)/4
-#define SI_CRTC1_REGISTER_OFFSET                0x300 //(0x79f0 - 0x6df0)/4
-#define SI_CRTC2_REGISTER_OFFSET                0x2600 //(0x105f0 - 0x6df0)/4
-#define SI_CRTC3_REGISTER_OFFSET                0x2900 //(0x111f0 - 0x6df0)/4
-#define SI_CRTC4_REGISTER_OFFSET                0x2c00 //(0x11df0 - 0x6df0)/4
-#define SI_CRTC5_REGISTER_OFFSET                0x2f00 //(0x129f0 - 0x6df0)/4
+#define CRTC0_REGISTER_OFFSET                 (0x1b7c - 0x1b7c) //(0x6df0 - 0x6df0)/4
+#define CRTC1_REGISTER_OFFSET                 (0x1e7c - 0x1b7c) //(0x79f0 - 0x6df0)/4
+#define CRTC2_REGISTER_OFFSET                 (0x417c - 0x1b7c) //(0x105f0 - 0x6df0)/4
+#define CRTC3_REGISTER_OFFSET                 (0x447c - 0x1b7c) //(0x111f0 - 0x6df0)/4
+#define CRTC4_REGISTER_OFFSET                 (0x477c - 0x1b7c) //(0x11df0 - 0x6df0)/4
+#define CRTC5_REGISTER_OFFSET                 (0x4a7c - 0x1b7c) //(0x129f0 - 0x6df0)/4
+
+/* hpd instance offsets */
+#define HPD0_REGISTER_OFFSET                 (0x1807 - 0x1807)
+#define HPD1_REGISTER_OFFSET                 (0x180a - 0x1807)
+#define HPD2_REGISTER_OFFSET                 (0x180d - 0x1807)
+#define HPD3_REGISTER_OFFSET                 (0x1810 - 0x1807)
+#define HPD4_REGISTER_OFFSET                 (0x1813 - 0x1807)
+#define HPD5_REGISTER_OFFSET                 (0x1816 - 0x1807)
+
+/* audio endpt instance offsets */
+#define AUD0_REGISTER_OFFSET                 (0x1780 - 0x1780)
+#define AUD1_REGISTER_OFFSET                 (0x1786 - 0x1780)
+#define AUD2_REGISTER_OFFSET                 (0x178c - 0x1780)
+#define AUD3_REGISTER_OFFSET                 (0x1792 - 0x1780)
+#define AUD4_REGISTER_OFFSET                 (0x1798 - 0x1780)
+#define AUD5_REGISTER_OFFSET                 (0x179d - 0x1780)
+#define AUD6_REGISTER_OFFSET                 (0x17a4 - 0x1780)
 
 #define CURSOR_WIDTH 64
 #define CURSOR_HEIGHT 64
--

2.48.1

#5 lore raw
In reply to Alexandre Demers
Quoted 13 lines · Alexandre Demers

Keep a uniform way of where and how variables are defined between DCE6, DCE8 and DCE10. It is easier to understand the code, their similarities and their modifications.

Since sid.h is being wired up in dce_v6_0.c, duplicated defines need to be cleaned up in sid.h and si_enums.h.

V4:
* Reorder patches so each one compiles properly.
* Remove drm-amdgpu-add-defines-for-pin_offsets-in-DCE8.patch since it was already approved and applied.

Quoted 9 lines

A bigger round of cleanup is coming to remove more of the duplicated and unused defines found in sid.h and si_enums.h and continue the uniformization.

Alexandre Demers (3):
drm/amdgpu: fix warning and errors caused by duplicated defines in
sid.h
drm/amdgpu: move and fix X_GB_ADDR_CONFIG_GOLDEN values drm/amdgpu: add or move defines for DCE6 in sid.h

The descriptions of the 3 patches were edited before I sent them, but I didn't think of the cover letter. They are:
drm/amdgpu: prepare DCE6 uniformisation with DCE8 and DCE10 drm/amdgpu: fix SI's GB_ADDR_CONFIG_GOLDEN values and wire up sid.h in GFX6 drm/amdgpu: finish wiring up sid.h in DCE6

Alexandre

Quoted 10 lines
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |  73 ++---
 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c |  15 +-
 drivers/gpu/drm/amd/amdgpu/si.c       |  68 ++---
 drivers/gpu/drm/amd/amdgpu/si_enums.h |  12 -
 drivers/gpu/drm/amd/amdgpu/sid.h      | 369 ++------------------------
 5 files changed, 111 insertions(+), 426 deletions(-)

--
2.48.1