Skip to content

Commit 37c890d

Browse files
Oxalinalexdeucher
authored andcommitted
drm/amdgpu: finish wiring up sid.h in DCE6
For coherence with DCE8 et DCE10, add or move some values under sid.h and remove duplicated from si_enums.h. Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 42c854b commit 37c890d

File tree

3 files changed

+55
-43
lines changed

3 files changed

+55
-43
lines changed

drivers/gpu/drm/amd/amdgpu/dce_v6_0.c

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "amdgpu_display.h"
4242

4343
#include "dce_v6_0.h"
44+
#include "sid.h"
4445

4546
#include "bif/bif_3_0_d.h"
4647
#include "bif/bif_3_0_sh_mask.h"
@@ -65,31 +66,31 @@ static void dce_v6_0_set_irq_funcs(struct amdgpu_device *adev);
6566

6667
static const u32 crtc_offsets[6] =
6768
{
68-
SI_CRTC0_REGISTER_OFFSET,
69-
SI_CRTC1_REGISTER_OFFSET,
70-
SI_CRTC2_REGISTER_OFFSET,
71-
SI_CRTC3_REGISTER_OFFSET,
72-
SI_CRTC4_REGISTER_OFFSET,
73-
SI_CRTC5_REGISTER_OFFSET
69+
CRTC0_REGISTER_OFFSET,
70+
CRTC1_REGISTER_OFFSET,
71+
CRTC2_REGISTER_OFFSET,
72+
CRTC3_REGISTER_OFFSET,
73+
CRTC4_REGISTER_OFFSET,
74+
CRTC5_REGISTER_OFFSET
7475
};
7576

7677
static const u32 hpd_offsets[] =
7778
{
78-
mmDC_HPD1_INT_STATUS - mmDC_HPD1_INT_STATUS,
79-
mmDC_HPD2_INT_STATUS - mmDC_HPD1_INT_STATUS,
80-
mmDC_HPD3_INT_STATUS - mmDC_HPD1_INT_STATUS,
81-
mmDC_HPD4_INT_STATUS - mmDC_HPD1_INT_STATUS,
82-
mmDC_HPD5_INT_STATUS - mmDC_HPD1_INT_STATUS,
83-
mmDC_HPD6_INT_STATUS - mmDC_HPD1_INT_STATUS,
79+
HPD0_REGISTER_OFFSET,
80+
HPD1_REGISTER_OFFSET,
81+
HPD2_REGISTER_OFFSET,
82+
HPD3_REGISTER_OFFSET,
83+
HPD4_REGISTER_OFFSET,
84+
HPD5_REGISTER_OFFSET
8485
};
8586

8687
static const uint32_t dig_offsets[] = {
87-
SI_CRTC0_REGISTER_OFFSET,
88-
SI_CRTC1_REGISTER_OFFSET,
89-
SI_CRTC2_REGISTER_OFFSET,
90-
SI_CRTC3_REGISTER_OFFSET,
91-
SI_CRTC4_REGISTER_OFFSET,
92-
SI_CRTC5_REGISTER_OFFSET,
88+
CRTC0_REGISTER_OFFSET,
89+
CRTC1_REGISTER_OFFSET,
90+
CRTC2_REGISTER_OFFSET,
91+
CRTC3_REGISTER_OFFSET,
92+
CRTC4_REGISTER_OFFSET,
93+
CRTC5_REGISTER_OFFSET,
9394
(0x13830 - 0x7030) >> 2,
9495
};
9596

@@ -1395,13 +1396,13 @@ static void dce_v6_0_audio_enable(struct amdgpu_device *adev,
13951396

13961397
static const u32 pin_offsets[7] =
13971398
{
1398-
(0x1780 - 0x1780),
1399-
(0x1786 - 0x1780),
1400-
(0x178c - 0x1780),
1401-
(0x1792 - 0x1780),
1402-
(0x1798 - 0x1780),
1403-
(0x179d - 0x1780),
1404-
(0x17a4 - 0x1780),
1399+
AUD0_REGISTER_OFFSET,
1400+
AUD1_REGISTER_OFFSET,
1401+
AUD2_REGISTER_OFFSET,
1402+
AUD3_REGISTER_OFFSET,
1403+
AUD4_REGISTER_OFFSET,
1404+
AUD5_REGISTER_OFFSET,
1405+
AUD6_REGISTER_OFFSET,
14051406
};
14061407

14071408
static int dce_v6_0_audio_init(struct amdgpu_device *adev)
@@ -2960,22 +2961,22 @@ static void dce_v6_0_set_crtc_vblank_interrupt_state(struct amdgpu_device *adev,
29602961

29612962
switch (crtc) {
29622963
case 0:
2963-
reg_block = SI_CRTC0_REGISTER_OFFSET;
2964+
reg_block = CRTC0_REGISTER_OFFSET;
29642965
break;
29652966
case 1:
2966-
reg_block = SI_CRTC1_REGISTER_OFFSET;
2967+
reg_block = CRTC1_REGISTER_OFFSET;
29672968
break;
29682969
case 2:
2969-
reg_block = SI_CRTC2_REGISTER_OFFSET;
2970+
reg_block = CRTC2_REGISTER_OFFSET;
29702971
break;
29712972
case 3:
2972-
reg_block = SI_CRTC3_REGISTER_OFFSET;
2973+
reg_block = CRTC3_REGISTER_OFFSET;
29732974
break;
29742975
case 4:
2975-
reg_block = SI_CRTC4_REGISTER_OFFSET;
2976+
reg_block = CRTC4_REGISTER_OFFSET;
29762977
break;
29772978
case 5:
2978-
reg_block = SI_CRTC5_REGISTER_OFFSET;
2979+
reg_block = CRTC5_REGISTER_OFFSET;
29792980
break;
29802981
default:
29812982
DRM_DEBUG("invalid crtc %d\n", crtc);

drivers/gpu/drm/amd/amdgpu/si_enums.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@
121121
#define CURSOR_UPDATE_LOCK (1 << 16)
122122
#define CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24)
123123

124-
#define SI_CRTC0_REGISTER_OFFSET 0
125-
#define SI_CRTC1_REGISTER_OFFSET 0x300
126-
#define SI_CRTC2_REGISTER_OFFSET 0x2600
127-
#define SI_CRTC3_REGISTER_OFFSET 0x2900
128-
#define SI_CRTC4_REGISTER_OFFSET 0x2c00
129-
#define SI_CRTC5_REGISTER_OFFSET 0x2f00
130124

131125
#define ES_AND_GS_AUTO 3
132126
#define RADEON_PACKET_TYPE3 3

drivers/gpu/drm/amd/amdgpu/sid.h

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,12 +1700,29 @@
17001700

17011701
//#dce stupp
17021702
/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
1703-
#define SI_CRTC0_REGISTER_OFFSET 0 //(0x6df0 - 0x6df0)/4
1704-
#define SI_CRTC1_REGISTER_OFFSET 0x300 //(0x79f0 - 0x6df0)/4
1705-
#define SI_CRTC2_REGISTER_OFFSET 0x2600 //(0x105f0 - 0x6df0)/4
1706-
#define SI_CRTC3_REGISTER_OFFSET 0x2900 //(0x111f0 - 0x6df0)/4
1707-
#define SI_CRTC4_REGISTER_OFFSET 0x2c00 //(0x11df0 - 0x6df0)/4
1708-
#define SI_CRTC5_REGISTER_OFFSET 0x2f00 //(0x129f0 - 0x6df0)/4
1703+
#define CRTC0_REGISTER_OFFSET (0x1b7c - 0x1b7c) //(0x6df0 - 0x6df0)/4
1704+
#define CRTC1_REGISTER_OFFSET (0x1e7c - 0x1b7c) //(0x79f0 - 0x6df0)/4
1705+
#define CRTC2_REGISTER_OFFSET (0x417c - 0x1b7c) //(0x105f0 - 0x6df0)/4
1706+
#define CRTC3_REGISTER_OFFSET (0x447c - 0x1b7c) //(0x111f0 - 0x6df0)/4
1707+
#define CRTC4_REGISTER_OFFSET (0x477c - 0x1b7c) //(0x11df0 - 0x6df0)/4
1708+
#define CRTC5_REGISTER_OFFSET (0x4a7c - 0x1b7c) //(0x129f0 - 0x6df0)/4
1709+
1710+
/* hpd instance offsets */
1711+
#define HPD0_REGISTER_OFFSET (0x1807 - 0x1807)
1712+
#define HPD1_REGISTER_OFFSET (0x180a - 0x1807)
1713+
#define HPD2_REGISTER_OFFSET (0x180d - 0x1807)
1714+
#define HPD3_REGISTER_OFFSET (0x1810 - 0x1807)
1715+
#define HPD4_REGISTER_OFFSET (0x1813 - 0x1807)
1716+
#define HPD5_REGISTER_OFFSET (0x1816 - 0x1807)
1717+
1718+
/* audio endpt instance offsets */
1719+
#define AUD0_REGISTER_OFFSET (0x1780 - 0x1780)
1720+
#define AUD1_REGISTER_OFFSET (0x1786 - 0x1780)
1721+
#define AUD2_REGISTER_OFFSET (0x178c - 0x1780)
1722+
#define AUD3_REGISTER_OFFSET (0x1792 - 0x1780)
1723+
#define AUD4_REGISTER_OFFSET (0x1798 - 0x1780)
1724+
#define AUD5_REGISTER_OFFSET (0x179d - 0x1780)
1725+
#define AUD6_REGISTER_OFFSET (0x17a4 - 0x1780)
17091726

17101727
#define CURSOR_WIDTH 64
17111728
#define CURSOR_HEIGHT 64

0 commit comments

Comments
 (0)