aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorXiangliang Yu <Xiangliang.Yu@amd.com>2017-03-06 02:27:51 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:53:31 -0400
commit49abb980c5fafc75f10c2beb13c63a8b0f8bc44a (patch)
tree2e228dd47b633010ab91724f2308b7f12fc39052 /drivers/gpu/drm/amd/amdgpu
parent7dae618174692f9da17a47fe82133a4b0ab9debf (diff)
drm/amdgpu/gfx8: move CE&DE meta data structure to vi_structs.h
Because different HWs have different definition for CE & DE meta data, follow mqd design to move the structures to vi_structs.h. And change the prefix from amdgpu to vi as the structures is only for VI family. Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c16
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.h112
2 files changed, 8 insertions, 120 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 248010b66fc0..5dcf8dbdd5b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -7284,15 +7284,15 @@ static void gfx_v8_0_ring_emit_ce_meta_init(struct amdgpu_ring *ring, uint64_t c
7284 uint64_t ce_payload_addr; 7284 uint64_t ce_payload_addr;
7285 int cnt_ce; 7285 int cnt_ce;
7286 static union { 7286 static union {
7287 struct amdgpu_ce_ib_state regular; 7287 struct vi_ce_ib_state regular;
7288 struct amdgpu_ce_ib_state_chained_ib chained; 7288 struct vi_ce_ib_state_chained_ib chained;
7289 } ce_payload = {}; 7289 } ce_payload = {};
7290 7290
7291 if (ring->adev->virt.chained_ib_support) { 7291 if (ring->adev->virt.chained_ib_support) {
7292 ce_payload_addr = csa_addr + offsetof(struct amdgpu_gfx_meta_data_chained_ib, ce_payload); 7292 ce_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data_chained_ib, ce_payload);
7293 cnt_ce = (sizeof(ce_payload.chained) >> 2) + 4 - 2; 7293 cnt_ce = (sizeof(ce_payload.chained) >> 2) + 4 - 2;
7294 } else { 7294 } else {
7295 ce_payload_addr = csa_addr + offsetof(struct amdgpu_gfx_meta_data, ce_payload); 7295 ce_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data, ce_payload);
7296 cnt_ce = (sizeof(ce_payload.regular) >> 2) + 4 - 2; 7296 cnt_ce = (sizeof(ce_payload.regular) >> 2) + 4 - 2;
7297 } 7297 }
7298 7298
@@ -7311,20 +7311,20 @@ static void gfx_v8_0_ring_emit_de_meta_init(struct amdgpu_ring *ring, uint64_t c
7311 uint64_t de_payload_addr, gds_addr; 7311 uint64_t de_payload_addr, gds_addr;
7312 int cnt_de; 7312 int cnt_de;
7313 static union { 7313 static union {
7314 struct amdgpu_de_ib_state regular; 7314 struct vi_de_ib_state regular;
7315 struct amdgpu_de_ib_state_chained_ib chained; 7315 struct vi_de_ib_state_chained_ib chained;
7316 } de_payload = {}; 7316 } de_payload = {};
7317 7317
7318 gds_addr = csa_addr + 4096; 7318 gds_addr = csa_addr + 4096;
7319 if (ring->adev->virt.chained_ib_support) { 7319 if (ring->adev->virt.chained_ib_support) {
7320 de_payload.chained.gds_backup_addrlo = lower_32_bits(gds_addr); 7320 de_payload.chained.gds_backup_addrlo = lower_32_bits(gds_addr);
7321 de_payload.chained.gds_backup_addrhi = upper_32_bits(gds_addr); 7321 de_payload.chained.gds_backup_addrhi = upper_32_bits(gds_addr);
7322 de_payload_addr = csa_addr + offsetof(struct amdgpu_gfx_meta_data_chained_ib, de_payload); 7322 de_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data_chained_ib, de_payload);
7323 cnt_de = (sizeof(de_payload.chained) >> 2) + 4 - 2; 7323 cnt_de = (sizeof(de_payload.chained) >> 2) + 4 - 2;
7324 } else { 7324 } else {
7325 de_payload.regular.gds_backup_addrlo = lower_32_bits(gds_addr); 7325 de_payload.regular.gds_backup_addrlo = lower_32_bits(gds_addr);
7326 de_payload.regular.gds_backup_addrhi = upper_32_bits(gds_addr); 7326 de_payload.regular.gds_backup_addrhi = upper_32_bits(gds_addr);
7327 de_payload_addr = csa_addr + offsetof(struct amdgpu_gfx_meta_data, de_payload); 7327 de_payload_addr = csa_addr + offsetof(struct vi_gfx_meta_data, de_payload);
7328 cnt_de = (sizeof(de_payload.regular) >> 2) + 4 - 2; 7328 cnt_de = (sizeof(de_payload.regular) >> 2) + 4 - 2;
7329 } 7329 }
7330 7330
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.h b/drivers/gpu/drm/amd/amdgpu/vi.h
index 719587b8b0cb..575d7aed5d32 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.h
+++ b/drivers/gpu/drm/amd/amdgpu/vi.h
@@ -28,116 +28,4 @@ void vi_srbm_select(struct amdgpu_device *adev,
28 u32 me, u32 pipe, u32 queue, u32 vmid); 28 u32 me, u32 pipe, u32 queue, u32 vmid);
29int vi_set_ip_blocks(struct amdgpu_device *adev); 29int vi_set_ip_blocks(struct amdgpu_device *adev);
30 30
31struct amdgpu_ce_ib_state
32{
33 uint32_t ce_ib_completion_status;
34 uint32_t ce_constegnine_count;
35 uint32_t ce_ibOffset_ib1;
36 uint32_t ce_ibOffset_ib2;
37}; /* Total of 4 DWORD */
38
39struct amdgpu_de_ib_state
40{
41 uint32_t ib_completion_status;
42 uint32_t de_constEngine_count;
43 uint32_t ib_offset_ib1;
44 uint32_t ib_offset_ib2;
45 uint32_t preamble_begin_ib1;
46 uint32_t preamble_begin_ib2;
47 uint32_t preamble_end_ib1;
48 uint32_t preamble_end_ib2;
49 uint32_t draw_indirect_baseLo;
50 uint32_t draw_indirect_baseHi;
51 uint32_t disp_indirect_baseLo;
52 uint32_t disp_indirect_baseHi;
53 uint32_t gds_backup_addrlo;
54 uint32_t gds_backup_addrhi;
55 uint32_t index_base_addrlo;
56 uint32_t index_base_addrhi;
57 uint32_t sample_cntl;
58}; /* Total of 17 DWORD */
59
60struct amdgpu_ce_ib_state_chained_ib
61{
62 /* section of non chained ib part */
63 uint32_t ce_ib_completion_status;
64 uint32_t ce_constegnine_count;
65 uint32_t ce_ibOffset_ib1;
66 uint32_t ce_ibOffset_ib2;
67
68 /* section of chained ib */
69 uint32_t ce_chainib_addrlo_ib1;
70 uint32_t ce_chainib_addrlo_ib2;
71 uint32_t ce_chainib_addrhi_ib1;
72 uint32_t ce_chainib_addrhi_ib2;
73 uint32_t ce_chainib_size_ib1;
74 uint32_t ce_chainib_size_ib2;
75}; /* total 10 DWORD */
76
77struct amdgpu_de_ib_state_chained_ib
78{
79 /* section of non chained ib part */
80 uint32_t ib_completion_status;
81 uint32_t de_constEngine_count;
82 uint32_t ib_offset_ib1;
83 uint32_t ib_offset_ib2;
84
85 /* section of chained ib */
86 uint32_t chain_ib_addrlo_ib1;
87 uint32_t chain_ib_addrlo_ib2;
88 uint32_t chain_ib_addrhi_ib1;
89 uint32_t chain_ib_addrhi_ib2;
90 uint32_t chain_ib_size_ib1;
91 uint32_t chain_ib_size_ib2;
92
93 /* section of non chained ib part */
94 uint32_t preamble_begin_ib1;
95 uint32_t preamble_begin_ib2;
96 uint32_t preamble_end_ib1;
97 uint32_t preamble_end_ib2;
98
99 /* section of chained ib */
100 uint32_t chain_ib_pream_addrlo_ib1;
101 uint32_t chain_ib_pream_addrlo_ib2;
102 uint32_t chain_ib_pream_addrhi_ib1;
103 uint32_t chain_ib_pream_addrhi_ib2;
104
105 /* section of non chained ib part */
106 uint32_t draw_indirect_baseLo;
107 uint32_t draw_indirect_baseHi;
108 uint32_t disp_indirect_baseLo;
109 uint32_t disp_indirect_baseHi;
110 uint32_t gds_backup_addrlo;
111 uint32_t gds_backup_addrhi;
112 uint32_t index_base_addrlo;
113 uint32_t index_base_addrhi;
114 uint32_t sample_cntl;
115}; /* Total of 27 DWORD */
116
117struct amdgpu_gfx_meta_data
118{
119 /* 4 DWORD, address must be 4KB aligned */
120 struct amdgpu_ce_ib_state ce_payload;
121 uint32_t reserved1[60];
122 /* 17 DWORD, address must be 64B aligned */
123 struct amdgpu_de_ib_state de_payload;
124 /* PFP IB base address which get pre-empted */
125 uint32_t DeIbBaseAddrLo;
126 uint32_t DeIbBaseAddrHi;
127 uint32_t reserved2[941];
128}; /* Total of 4K Bytes */
129
130struct amdgpu_gfx_meta_data_chained_ib
131{
132 /* 10 DWORD, address must be 4KB aligned */
133 struct amdgpu_ce_ib_state_chained_ib ce_payload;
134 uint32_t reserved1[54];
135 /* 27 DWORD, address must be 64B aligned */
136 struct amdgpu_de_ib_state_chained_ib de_payload;
137 /* PFP IB base address which get pre-empted */
138 uint32_t DeIbBaseAddrLo;
139 uint32_t DeIbBaseAddrHi;
140 uint32_t reserved2[931];
141}; /* Total of 4K Bytes */
142
143#endif 31#endif