Skip to content

Commit 1b8ed11

Browse files
Timur Kristófalexdeucher
authored andcommitted
drm/amdgpu/vce1: Clean up register definitions
The sid.h header contained some VCE1 register definitions, but they were using byte offsets (probably copied from the old radeon driver). Move all of these to the proper VCE1 headers and ensure they are in dword offsets. Also add the register definitions that we need for the firmware validation mechanism in VCE1. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Co-developed-by: Alexandre Demers <alexandre.f.demers@gmail.com> Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e583d31 commit 1b8ed11

3 files changed

Lines changed: 15 additions & 40 deletions

File tree

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

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -582,45 +582,6 @@
582582
#define DMA_PACKET_NOP 0xf
583583

584584
/* VCE */
585-
#define VCE_STATUS 0x20004
586-
#define VCE_VCPU_CNTL 0x20014
587-
#define VCE_CLK_EN (1 << 0)
588-
#define VCE_VCPU_CACHE_OFFSET0 0x20024
589-
#define VCE_VCPU_CACHE_SIZE0 0x20028
590-
#define VCE_VCPU_CACHE_OFFSET1 0x2002c
591-
#define VCE_VCPU_CACHE_SIZE1 0x20030
592-
#define VCE_VCPU_CACHE_OFFSET2 0x20034
593-
#define VCE_VCPU_CACHE_SIZE2 0x20038
594-
#define VCE_SOFT_RESET 0x20120
595-
#define VCE_ECPU_SOFT_RESET (1 << 0)
596-
#define VCE_FME_SOFT_RESET (1 << 2)
597-
#define VCE_RB_BASE_LO2 0x2016c
598-
#define VCE_RB_BASE_HI2 0x20170
599-
#define VCE_RB_SIZE2 0x20174
600-
#define VCE_RB_RPTR2 0x20178
601-
#define VCE_RB_WPTR2 0x2017c
602-
#define VCE_RB_BASE_LO 0x20180
603-
#define VCE_RB_BASE_HI 0x20184
604-
#define VCE_RB_SIZE 0x20188
605-
#define VCE_RB_RPTR 0x2018c
606-
#define VCE_RB_WPTR 0x20190
607-
#define VCE_CLOCK_GATING_A 0x202f8
608-
#define VCE_CLOCK_GATING_B 0x202fc
609-
#define VCE_UENC_CLOCK_GATING 0x205bc
610-
#define VCE_UENC_REG_CLOCK_GATING 0x205c0
611-
#define VCE_FW_REG_STATUS 0x20e10
612-
# define VCE_FW_REG_STATUS_BUSY (1 << 0)
613-
# define VCE_FW_REG_STATUS_PASS (1 << 3)
614-
# define VCE_FW_REG_STATUS_DONE (1 << 11)
615-
#define VCE_LMI_FW_START_KEYSEL 0x20e18
616-
#define VCE_LMI_FW_PERIODIC_CTRL 0x20e20
617-
#define VCE_LMI_CTRL2 0x20e74
618-
#define VCE_LMI_CTRL 0x20e98
619-
#define VCE_LMI_VM_CTRL 0x20ea0
620-
#define VCE_LMI_SWAP_CNTL 0x20eb4
621-
#define VCE_LMI_SWAP_CNTL1 0x20eb8
622-
#define VCE_LMI_CACHE_CTRL 0x20ef4
623-
624585
#define VCE_CMD_NO_OP 0x00000000
625586
#define VCE_CMD_END 0x00000001
626587
#define VCE_CMD_IB 0x00000002
@@ -629,7 +590,6 @@
629590
#define VCE_CMD_IB_AUTO 0x00000005
630591
#define VCE_CMD_SEMAPHORE 0x00000006
631592

632-
633593
//#dce stupp
634594
/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */
635595
#define CRTC0_REGISTER_OFFSET (0x1b7c - 0x1b7c) //(0x6df0 - 0x6df0)/4

drivers/gpu/drm/amd/include/asic_reg/vce/vce_1_0_d.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,10 @@
6060
#define mmVCE_VCPU_CACHE_SIZE1 0x800C
6161
#define mmVCE_VCPU_CACHE_SIZE2 0x800E
6262
#define mmVCE_VCPU_CNTL 0x8005
63+
#define mmVCE_VCPU_SCRATCH7 0x8037
64+
#define mmVCE_FW_REG_STATUS 0x8384
65+
#define mmVCE_LMI_FW_PERIODIC_CTRL 0x8388
66+
#define mmVCE_LMI_FW_START_KEYSEL 0x8386
67+
6368

6469
#endif

drivers/gpu/drm/amd/include/asic_reg/vce/vce_1_0_sh_mask.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
#define VCE_RB_WPTR__RB_WPTR__SHIFT 0x00000004
6262
#define VCE_SOFT_RESET__ECPU_SOFT_RESET_MASK 0x00000001L
6363
#define VCE_SOFT_RESET__ECPU_SOFT_RESET__SHIFT 0x00000000
64+
#define VCE_SOFT_RESET__FME_SOFT_RESET_MASK 0x00000004L
65+
#define VCE_SOFT_RESET__FME_SOFT_RESET__SHIFT 0x00000002
6466
#define VCE_STATUS__JOB_BUSY_MASK 0x00000001L
6567
#define VCE_STATUS__JOB_BUSY__SHIFT 0x00000000
6668
#define VCE_STATUS__UENC_BUSY_MASK 0x00000100L
@@ -95,5 +97,13 @@
9597
#define VCE_VCPU_CNTL__CLK_EN__SHIFT 0x00000000
9698
#define VCE_VCPU_CNTL__RBBM_SOFT_RESET_MASK 0x00040000L
9799
#define VCE_VCPU_CNTL__RBBM_SOFT_RESET__SHIFT 0x00000012
100+
#define VCE_CLOCK_GATING_A__CGC_DYN_CLOCK_MODE_MASK 0x00010000
101+
#define VCE_CLOCK_GATING_A__CGC_DYN_CLOCK_MODE_SHIFT 0x00000010
102+
#define VCE_FW_REG_STATUS__BUSY_MASK 0x0000001
103+
#define VCE_FW_REG_STATUS__BUSY__SHIFT 0x0000001
104+
#define VCE_FW_REG_STATUS__PASS_MASK 0x0000008
105+
#define VCE_FW_REG_STATUS__PASS__SHIFT 0x0000003
106+
#define VCE_FW_REG_STATUS__DONE_MASK 0x0000800
107+
#define VCE_FW_REG_STATUS__DONE__SHIFT 0x000000b
98108

99109
#endif

0 commit comments

Comments
 (0)