aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2018-08-02 05:23:33 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 12:09:55 -0400
commitbb7743bc205177440ba98eca2359779ba943e03b (patch)
treea7b44c1f5a4a0971c49478479998a1c8fc545418 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parentaa47d117282cc32874e2749ce8ae94262b9edddf (diff)
drm/amdgpu: move sdma definitions into amdgpu_sdma header
Demangle amdgpu.h. Furthermore, SDMA is used for moving and clearing the data buffer, so the header also need be included in ttm. Signed-off-by: Huang Rui <ray.huang@amd.com> Acked-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/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h87
1 files changed, 1 insertions, 86 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 3517abb73e55..159854eaf553 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -70,6 +70,7 @@
70#include "amdgpu_mn.h" 70#include "amdgpu_mn.h"
71#include "amdgpu_gmc.h" 71#include "amdgpu_gmc.h"
72#include "amdgpu_gfx.h" 72#include "amdgpu_gfx.h"
73#include "amdgpu_sdma.h"
73#include "amdgpu_dm.h" 74#include "amdgpu_dm.h"
74#include "amdgpu_virt.h" 75#include "amdgpu_virt.h"
75#include "amdgpu_gart.h" 76#include "amdgpu_gart.h"
@@ -149,9 +150,6 @@ extern int amdgpu_cik_support;
149#define AMDGPUFB_CONN_LIMIT 4 150#define AMDGPUFB_CONN_LIMIT 4
150#define AMDGPU_BIOS_NUM_SCRATCH 16 151#define AMDGPU_BIOS_NUM_SCRATCH 16
151 152
152/* max number of IP instances */
153#define AMDGPU_MAX_SDMA_INSTANCES 2
154
155/* hard reset data */ 153/* hard reset data */
156#define AMDGPU_ASIC_RESET_DATA 0x39d5e86b 154#define AMDGPU_ASIC_RESET_DATA 0x39d5e86b
157 155
@@ -199,13 +197,6 @@ enum amdgpu_cp_irq {
199 AMDGPU_CP_IRQ_LAST 197 AMDGPU_CP_IRQ_LAST
200}; 198};
201 199
202enum amdgpu_sdma_irq {
203 AMDGPU_SDMA_IRQ_TRAP0 = 0,
204 AMDGPU_SDMA_IRQ_TRAP1,
205
206 AMDGPU_SDMA_IRQ_LAST
207};
208
209enum amdgpu_thermal_irq { 200enum amdgpu_thermal_irq {
210 AMDGPU_THERMAL_IRQ_LOW_TO_HIGH = 0, 201 AMDGPU_THERMAL_IRQ_LOW_TO_HIGH = 0,
211 AMDGPU_THERMAL_IRQ_HIGH_TO_LOW, 202 AMDGPU_THERMAL_IRQ_HIGH_TO_LOW,
@@ -265,39 +256,6 @@ amdgpu_device_ip_get_ip_block(struct amdgpu_device *adev,
265int amdgpu_device_ip_block_add(struct amdgpu_device *adev, 256int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
266 const struct amdgpu_ip_block_version *ip_block_version); 257 const struct amdgpu_ip_block_version *ip_block_version);
267 258
268/* provided by hw blocks that can move/clear data. e.g., gfx or sdma */
269struct amdgpu_buffer_funcs {
270 /* maximum bytes in a single operation */
271 uint32_t copy_max_bytes;
272
273 /* number of dw to reserve per operation */
274 unsigned copy_num_dw;
275
276 /* used for buffer migration */
277 void (*emit_copy_buffer)(struct amdgpu_ib *ib,
278 /* src addr in bytes */
279 uint64_t src_offset,
280 /* dst addr in bytes */
281 uint64_t dst_offset,
282 /* number of byte to transfer */
283 uint32_t byte_count);
284
285 /* maximum bytes in a single operation */
286 uint32_t fill_max_bytes;
287
288 /* number of dw to reserve per operation */
289 unsigned fill_num_dw;
290
291 /* used for buffer clearing */
292 void (*emit_fill_buffer)(struct amdgpu_ib *ib,
293 /* value to write to memory */
294 uint32_t src_data,
295 /* dst addr in bytes */
296 uint64_t dst_offset,
297 /* number of byte to fill */
298 uint32_t byte_count);
299};
300
301/* provided by hw blocks that can write ptes, e.g., sdma */ 259/* provided by hw blocks that can write ptes, e.g., sdma */
302struct amdgpu_vm_pte_funcs { 260struct amdgpu_vm_pte_funcs {
303 /* number of dw to reserve per operation */ 261 /* number of dw to reserve per operation */
@@ -757,31 +715,6 @@ int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);
757void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb); 715void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb);
758 716
759/* 717/*
760 * SDMA
761 */
762struct amdgpu_sdma_instance {
763 /* SDMA firmware */
764 const struct firmware *fw;
765 uint32_t fw_version;
766 uint32_t feature_version;
767
768 struct amdgpu_ring ring;
769 bool burst_nop;
770};
771
772struct amdgpu_sdma {
773 struct amdgpu_sdma_instance instance[AMDGPU_MAX_SDMA_INSTANCES];
774#ifdef CONFIG_DRM_AMDGPU_SI
775 //SI DMA has a difference trap irq number for the second engine
776 struct amdgpu_irq_src trap_irq_1;
777#endif
778 struct amdgpu_irq_src trap_irq;
779 struct amdgpu_irq_src illegal_inst_irq;
780 int num_instances;
781 uint32_t srbm_soft_reset;
782};
783
784/*
785 * Firmware 718 * Firmware
786 */ 719 */
787enum amdgpu_firmware_load_type { 720enum amdgpu_firmware_load_type {
@@ -1385,22 +1318,6 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
1385#define RBIOS16(i) (RBIOS8(i) | (RBIOS8((i)+1) << 8)) 1318#define RBIOS16(i) (RBIOS8(i) | (RBIOS8((i)+1) << 8))
1386#define RBIOS32(i) ((RBIOS16(i)) | (RBIOS16((i)+2) << 16)) 1319#define RBIOS32(i) ((RBIOS16(i)) | (RBIOS16((i)+2) << 16))
1387 1320
1388static inline struct amdgpu_sdma_instance *
1389amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
1390{
1391 struct amdgpu_device *adev = ring->adev;
1392 int i;
1393
1394 for (i = 0; i < adev->sdma.num_instances; i++)
1395 if (&adev->sdma.instance[i].ring == ring)
1396 break;
1397
1398 if (i < AMDGPU_MAX_SDMA_INSTANCES)
1399 return &adev->sdma.instance[i];
1400 else
1401 return NULL;
1402}
1403
1404/* 1321/*
1405 * ASICs macro. 1322 * ASICs macro.
1406 */ 1323 */
@@ -1462,8 +1379,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
1462#define amdgpu_display_page_flip_get_scanoutpos(adev, crtc, vbl, pos) (adev)->mode_info.funcs->page_flip_get_scanoutpos((adev), (crtc), (vbl), (pos)) 1379#define amdgpu_display_page_flip_get_scanoutpos(adev, crtc, vbl, pos) (adev)->mode_info.funcs->page_flip_get_scanoutpos((adev), (crtc), (vbl), (pos))
1463#define amdgpu_display_add_encoder(adev, e, s, c) (adev)->mode_info.funcs->add_encoder((adev), (e), (s), (c)) 1380#define amdgpu_display_add_encoder(adev, e, s, c) (adev)->mode_info.funcs->add_encoder((adev), (e), (s), (c))
1464#define amdgpu_display_add_connector(adev, ci, sd, ct, ib, coi, h, r) (adev)->mode_info.funcs->add_connector((adev), (ci), (sd), (ct), (ib), (coi), (h), (r)) 1381#define amdgpu_display_add_connector(adev, ci, sd, ct, ib, coi, h, r) (adev)->mode_info.funcs->add_connector((adev), (ci), (sd), (ct), (ib), (coi), (h), (r))
1465#define amdgpu_emit_copy_buffer(adev, ib, s, d, b) (adev)->mman.buffer_funcs->emit_copy_buffer((ib), (s), (d), (b))
1466#define amdgpu_emit_fill_buffer(adev, ib, s, d, b) (adev)->mman.buffer_funcs->emit_fill_buffer((ib), (s), (d), (b))
1467#define amdgpu_gds_switch(adev, r, v, d, w, a) (adev)->gds.funcs->patch_gds_switch((r), (v), (d), (w), (a)) 1382#define amdgpu_gds_switch(adev, r, v, d, w, a) (adev)->gds.funcs->patch_gds_switch((r), (v), (d), (w), (a))
1468#define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) 1383#define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i))
1469 1384