diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 0b14b5373783..5e2958a79928 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -47,6 +47,8 @@ | |||
47 | #include <drm/amdgpu_drm.h> | 47 | #include <drm/amdgpu_drm.h> |
48 | 48 | ||
49 | #include <kgd_kfd_interface.h> | 49 | #include <kgd_kfd_interface.h> |
50 | #include "dm_pp_interface.h" | ||
51 | #include "kgd_pp_interface.h" | ||
50 | 52 | ||
51 | #include "amd_shared.h" | 53 | #include "amd_shared.h" |
52 | #include "amdgpu_mode.h" | 54 | #include "amdgpu_mode.h" |
@@ -59,7 +61,6 @@ | |||
59 | #include "amdgpu_sync.h" | 61 | #include "amdgpu_sync.h" |
60 | #include "amdgpu_ring.h" | 62 | #include "amdgpu_ring.h" |
61 | #include "amdgpu_vm.h" | 63 | #include "amdgpu_vm.h" |
62 | #include "amd_powerplay.h" | ||
63 | #include "amdgpu_dpm.h" | 64 | #include "amdgpu_dpm.h" |
64 | #include "amdgpu_acp.h" | 65 | #include "amdgpu_acp.h" |
65 | #include "amdgpu_uvd.h" | 66 | #include "amdgpu_uvd.h" |
@@ -67,11 +68,11 @@ | |||
67 | #include "amdgpu_vcn.h" | 68 | #include "amdgpu_vcn.h" |
68 | #include "amdgpu_mn.h" | 69 | #include "amdgpu_mn.h" |
69 | #include "amdgpu_dm.h" | 70 | #include "amdgpu_dm.h" |
70 | |||
71 | #include "gpu_scheduler.h" | 71 | #include "gpu_scheduler.h" |
72 | #include "amdgpu_virt.h" | 72 | #include "amdgpu_virt.h" |
73 | #include "amdgpu_gart.h" | 73 | #include "amdgpu_gart.h" |
74 | 74 | ||
75 | |||
75 | /* | 76 | /* |
76 | * Modules parameters. | 77 | * Modules parameters. |
77 | */ | 78 | */ |
@@ -177,6 +178,10 @@ extern int amdgpu_cik_support; | |||
177 | #define CIK_CURSOR_WIDTH 128 | 178 | #define CIK_CURSOR_WIDTH 128 |
178 | #define CIK_CURSOR_HEIGHT 128 | 179 | #define CIK_CURSOR_HEIGHT 128 |
179 | 180 | ||
181 | /* GPU RESET flags */ | ||
182 | #define AMDGPU_RESET_INFO_VRAM_LOST (1 << 0) | ||
183 | #define AMDGPU_RESET_INFO_FULLRESET (1 << 1) | ||
184 | |||
180 | struct amdgpu_device; | 185 | struct amdgpu_device; |
181 | struct amdgpu_ib; | 186 | struct amdgpu_ib; |
182 | struct amdgpu_cs_parser; | 187 | struct amdgpu_cs_parser; |
@@ -735,6 +740,7 @@ struct amdgpu_ctx { | |||
735 | struct amdgpu_device *adev; | 740 | struct amdgpu_device *adev; |
736 | struct amdgpu_queue_mgr queue_mgr; | 741 | struct amdgpu_queue_mgr queue_mgr; |
737 | unsigned reset_counter; | 742 | unsigned reset_counter; |
743 | unsigned reset_counter_query; | ||
738 | uint32_t vram_lost_counter; | 744 | uint32_t vram_lost_counter; |
739 | spinlock_t ring_lock; | 745 | spinlock_t ring_lock; |
740 | struct dma_fence **fences; | 746 | struct dma_fence **fences; |
@@ -743,6 +749,7 @@ struct amdgpu_ctx { | |||
743 | enum amd_sched_priority init_priority; | 749 | enum amd_sched_priority init_priority; |
744 | enum amd_sched_priority override_priority; | 750 | enum amd_sched_priority override_priority; |
745 | struct mutex lock; | 751 | struct mutex lock; |
752 | atomic_t guilty; | ||
746 | }; | 753 | }; |
747 | 754 | ||
748 | struct amdgpu_ctx_mgr { | 755 | struct amdgpu_ctx_mgr { |
@@ -1114,7 +1121,6 @@ struct amdgpu_job { | |||
1114 | struct amdgpu_vm *vm; | 1121 | struct amdgpu_vm *vm; |
1115 | struct amdgpu_ring *ring; | 1122 | struct amdgpu_ring *ring; |
1116 | struct amdgpu_sync sync; | 1123 | struct amdgpu_sync sync; |
1117 | struct amdgpu_sync dep_sync; | ||
1118 | struct amdgpu_sync sched_sync; | 1124 | struct amdgpu_sync sched_sync; |
1119 | struct amdgpu_ib *ibs; | 1125 | struct amdgpu_ib *ibs; |
1120 | struct dma_fence *fence; /* the hw fence */ | 1126 | struct dma_fence *fence; /* the hw fence */ |
@@ -1405,6 +1411,7 @@ struct amdgpu_fw_vram_usage { | |||
1405 | }; | 1411 | }; |
1406 | 1412 | ||
1407 | int amdgpu_fw_reserve_vram_init(struct amdgpu_device *adev); | 1413 | int amdgpu_fw_reserve_vram_init(struct amdgpu_device *adev); |
1414 | void amdgpu_fw_reserve_vram_fini(struct amdgpu_device *adev); | ||
1408 | 1415 | ||
1409 | /* | 1416 | /* |
1410 | * CGS | 1417 | * CGS |
@@ -1421,6 +1428,13 @@ typedef void (*amdgpu_wreg_t)(struct amdgpu_device*, uint32_t, uint32_t); | |||
1421 | typedef uint32_t (*amdgpu_block_rreg_t)(struct amdgpu_device*, uint32_t, uint32_t); | 1428 | typedef uint32_t (*amdgpu_block_rreg_t)(struct amdgpu_device*, uint32_t, uint32_t); |
1422 | typedef void (*amdgpu_block_wreg_t)(struct amdgpu_device*, uint32_t, uint32_t, uint32_t); | 1429 | typedef void (*amdgpu_block_wreg_t)(struct amdgpu_device*, uint32_t, uint32_t, uint32_t); |
1423 | 1430 | ||
1431 | struct amd_powerplay { | ||
1432 | struct cgs_device *cgs_device; | ||
1433 | void *pp_handle; | ||
1434 | const struct amd_ip_funcs *ip_funcs; | ||
1435 | const struct amd_pm_funcs *pp_funcs; | ||
1436 | }; | ||
1437 | |||
1424 | #define AMDGPU_RESET_MAGIC_NUM 64 | 1438 | #define AMDGPU_RESET_MAGIC_NUM 64 |
1425 | struct amdgpu_device { | 1439 | struct amdgpu_device { |
1426 | struct device *dev; | 1440 | struct device *dev; |
@@ -1616,9 +1630,6 @@ struct amdgpu_device { | |||
1616 | /* link all shadow bo */ | 1630 | /* link all shadow bo */ |
1617 | struct list_head shadow_list; | 1631 | struct list_head shadow_list; |
1618 | struct mutex shadow_list_lock; | 1632 | struct mutex shadow_list_lock; |
1619 | /* link all gtt */ | ||
1620 | spinlock_t gtt_list_lock; | ||
1621 | struct list_head gtt_list; | ||
1622 | /* keep an lru list of rings by HW IP */ | 1633 | /* keep an lru list of rings by HW IP */ |
1623 | struct list_head ring_lru_list; | 1634 | struct list_head ring_lru_list; |
1624 | spinlock_t ring_lru_list_lock; | 1635 | spinlock_t ring_lru_list_lock; |
@@ -1629,7 +1640,8 @@ struct amdgpu_device { | |||
1629 | 1640 | ||
1630 | /* record last mm index being written through WREG32*/ | 1641 | /* record last mm index being written through WREG32*/ |
1631 | unsigned long last_mm_index; | 1642 | unsigned long last_mm_index; |
1632 | bool in_sriov_reset; | 1643 | bool in_gpu_reset; |
1644 | struct mutex lock_reset; | ||
1633 | }; | 1645 | }; |
1634 | 1646 | ||
1635 | static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev) | 1647 | static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev) |
@@ -1823,7 +1835,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
1823 | #define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) | 1835 | #define amdgpu_psp_check_fw_loading_status(adev, i) (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) |
1824 | 1836 | ||
1825 | /* Common functions */ | 1837 | /* Common functions */ |
1826 | int amdgpu_gpu_reset(struct amdgpu_device *adev); | 1838 | int amdgpu_gpu_recover(struct amdgpu_device *adev, struct amdgpu_job* job); |
1827 | bool amdgpu_need_backup(struct amdgpu_device *adev); | 1839 | bool amdgpu_need_backup(struct amdgpu_device *adev); |
1828 | void amdgpu_pci_config_reset(struct amdgpu_device *adev); | 1840 | void amdgpu_pci_config_reset(struct amdgpu_device *adev); |
1829 | bool amdgpu_need_post(struct amdgpu_device *adev); | 1841 | bool amdgpu_need_post(struct amdgpu_device *adev); |
@@ -1835,6 +1847,7 @@ void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain); | |||
1835 | bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo); | 1847 | bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo); |
1836 | void amdgpu_vram_location(struct amdgpu_device *adev, struct amdgpu_mc *mc, u64 base); | 1848 | void amdgpu_vram_location(struct amdgpu_device *adev, struct amdgpu_mc *mc, u64 base); |
1837 | void amdgpu_gart_location(struct amdgpu_device *adev, struct amdgpu_mc *mc); | 1849 | void amdgpu_gart_location(struct amdgpu_device *adev, struct amdgpu_mc *mc); |
1850 | int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev); | ||
1838 | void amdgpu_ttm_set_active_vram_size(struct amdgpu_device *adev, u64 size); | 1851 | void amdgpu_ttm_set_active_vram_size(struct amdgpu_device *adev, u64 size); |
1839 | int amdgpu_ttm_init(struct amdgpu_device *adev); | 1852 | int amdgpu_ttm_init(struct amdgpu_device *adev); |
1840 | void amdgpu_ttm_fini(struct amdgpu_device *adev); | 1853 | void amdgpu_ttm_fini(struct amdgpu_device *adev); |