diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 137 |
1 files changed, 87 insertions, 50 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 103635ab784c..5afaf6016b4a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -65,6 +65,8 @@ | |||
65 | #include "amdgpu_uvd.h" | 65 | #include "amdgpu_uvd.h" |
66 | #include "amdgpu_vce.h" | 66 | #include "amdgpu_vce.h" |
67 | #include "amdgpu_vcn.h" | 67 | #include "amdgpu_vcn.h" |
68 | #include "amdgpu_mn.h" | ||
69 | #include "amdgpu_dm.h" | ||
68 | 70 | ||
69 | #include "gpu_scheduler.h" | 71 | #include "gpu_scheduler.h" |
70 | #include "amdgpu_virt.h" | 72 | #include "amdgpu_virt.h" |
@@ -91,7 +93,7 @@ extern int amdgpu_dpm; | |||
91 | extern int amdgpu_fw_load_type; | 93 | extern int amdgpu_fw_load_type; |
92 | extern int amdgpu_aspm; | 94 | extern int amdgpu_aspm; |
93 | extern int amdgpu_runtime_pm; | 95 | extern int amdgpu_runtime_pm; |
94 | extern unsigned amdgpu_ip_block_mask; | 96 | extern uint amdgpu_ip_block_mask; |
95 | extern int amdgpu_bapm; | 97 | extern int amdgpu_bapm; |
96 | extern int amdgpu_deep_color; | 98 | extern int amdgpu_deep_color; |
97 | extern int amdgpu_vm_size; | 99 | extern int amdgpu_vm_size; |
@@ -100,18 +102,20 @@ extern int amdgpu_vm_fragment_size; | |||
100 | extern int amdgpu_vm_fault_stop; | 102 | extern int amdgpu_vm_fault_stop; |
101 | extern int amdgpu_vm_debug; | 103 | extern int amdgpu_vm_debug; |
102 | extern int amdgpu_vm_update_mode; | 104 | extern int amdgpu_vm_update_mode; |
105 | extern int amdgpu_dc; | ||
106 | extern int amdgpu_dc_log; | ||
103 | extern int amdgpu_sched_jobs; | 107 | extern int amdgpu_sched_jobs; |
104 | extern int amdgpu_sched_hw_submission; | 108 | extern int amdgpu_sched_hw_submission; |
105 | extern int amdgpu_no_evict; | 109 | extern int amdgpu_no_evict; |
106 | extern int amdgpu_direct_gma_size; | 110 | extern int amdgpu_direct_gma_size; |
107 | extern unsigned amdgpu_pcie_gen_cap; | 111 | extern uint amdgpu_pcie_gen_cap; |
108 | extern unsigned amdgpu_pcie_lane_cap; | 112 | extern uint amdgpu_pcie_lane_cap; |
109 | extern unsigned amdgpu_cg_mask; | 113 | extern uint amdgpu_cg_mask; |
110 | extern unsigned amdgpu_pg_mask; | 114 | extern uint amdgpu_pg_mask; |
111 | extern unsigned amdgpu_sdma_phase_quantum; | 115 | extern uint amdgpu_sdma_phase_quantum; |
112 | extern char *amdgpu_disable_cu; | 116 | extern char *amdgpu_disable_cu; |
113 | extern char *amdgpu_virtual_display; | 117 | extern char *amdgpu_virtual_display; |
114 | extern unsigned amdgpu_pp_feature_mask; | 118 | extern uint amdgpu_pp_feature_mask; |
115 | extern int amdgpu_vram_page_split; | 119 | extern int amdgpu_vram_page_split; |
116 | extern int amdgpu_ngg; | 120 | extern int amdgpu_ngg; |
117 | extern int amdgpu_prim_buf_per_se; | 121 | extern int amdgpu_prim_buf_per_se; |
@@ -120,6 +124,7 @@ extern int amdgpu_cntl_sb_buf_per_se; | |||
120 | extern int amdgpu_param_buf_per_se; | 124 | extern int amdgpu_param_buf_per_se; |
121 | extern int amdgpu_job_hang_limit; | 125 | extern int amdgpu_job_hang_limit; |
122 | extern int amdgpu_lbpw; | 126 | extern int amdgpu_lbpw; |
127 | extern int amdgpu_compute_multipipe; | ||
123 | 128 | ||
124 | #ifdef CONFIG_DRM_AMDGPU_SI | 129 | #ifdef CONFIG_DRM_AMDGPU_SI |
125 | extern int amdgpu_si_support; | 130 | extern int amdgpu_si_support; |
@@ -178,6 +183,7 @@ struct amdgpu_cs_parser; | |||
178 | struct amdgpu_job; | 183 | struct amdgpu_job; |
179 | struct amdgpu_irq_src; | 184 | struct amdgpu_irq_src; |
180 | struct amdgpu_fpriv; | 185 | struct amdgpu_fpriv; |
186 | struct amdgpu_bo_va_mapping; | ||
181 | 187 | ||
182 | enum amdgpu_cp_irq { | 188 | enum amdgpu_cp_irq { |
183 | AMDGPU_CP_IRQ_GFX_EOP = 0, | 189 | AMDGPU_CP_IRQ_GFX_EOP = 0, |
@@ -292,14 +298,25 @@ struct amdgpu_buffer_funcs { | |||
292 | 298 | ||
293 | /* provided by hw blocks that can write ptes, e.g., sdma */ | 299 | /* provided by hw blocks that can write ptes, e.g., sdma */ |
294 | struct amdgpu_vm_pte_funcs { | 300 | struct amdgpu_vm_pte_funcs { |
301 | /* number of dw to reserve per operation */ | ||
302 | unsigned copy_pte_num_dw; | ||
303 | |||
295 | /* copy pte entries from GART */ | 304 | /* copy pte entries from GART */ |
296 | void (*copy_pte)(struct amdgpu_ib *ib, | 305 | void (*copy_pte)(struct amdgpu_ib *ib, |
297 | uint64_t pe, uint64_t src, | 306 | uint64_t pe, uint64_t src, |
298 | unsigned count); | 307 | unsigned count); |
308 | |||
299 | /* write pte one entry at a time with addr mapping */ | 309 | /* write pte one entry at a time with addr mapping */ |
300 | void (*write_pte)(struct amdgpu_ib *ib, uint64_t pe, | 310 | void (*write_pte)(struct amdgpu_ib *ib, uint64_t pe, |
301 | uint64_t value, unsigned count, | 311 | uint64_t value, unsigned count, |
302 | uint32_t incr); | 312 | uint32_t incr); |
313 | |||
314 | /* maximum nums of PTEs/PDEs in a single operation */ | ||
315 | uint32_t set_max_nums_pte_pde; | ||
316 | |||
317 | /* number of dw to reserve per operation */ | ||
318 | unsigned set_pte_pde_num_dw; | ||
319 | |||
303 | /* for linear pte/pde updates without addr mapping */ | 320 | /* for linear pte/pde updates without addr mapping */ |
304 | void (*set_pte_pde)(struct amdgpu_ib *ib, | 321 | void (*set_pte_pde)(struct amdgpu_ib *ib, |
305 | uint64_t pe, | 322 | uint64_t pe, |
@@ -332,6 +349,7 @@ struct amdgpu_gart_funcs { | |||
332 | struct amdgpu_ih_funcs { | 349 | struct amdgpu_ih_funcs { |
333 | /* ring read/write ptr handling, called from interrupt context */ | 350 | /* ring read/write ptr handling, called from interrupt context */ |
334 | u32 (*get_wptr)(struct amdgpu_device *adev); | 351 | u32 (*get_wptr)(struct amdgpu_device *adev); |
352 | bool (*prescreen_iv)(struct amdgpu_device *adev); | ||
335 | void (*decode_iv)(struct amdgpu_device *adev, | 353 | void (*decode_iv)(struct amdgpu_device *adev, |
336 | struct amdgpu_iv_entry *entry); | 354 | struct amdgpu_iv_entry *entry); |
337 | void (*set_rptr)(struct amdgpu_device *adev); | 355 | void (*set_rptr)(struct amdgpu_device *adev); |
@@ -399,6 +417,7 @@ void amdgpu_gem_prime_unpin(struct drm_gem_object *obj); | |||
399 | struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *); | 417 | struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *); |
400 | void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj); | 418 | void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj); |
401 | void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr); | 419 | void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr); |
420 | int amdgpu_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma); | ||
402 | int amdgpu_gem_debugfs_init(struct amdgpu_device *adev); | 421 | int amdgpu_gem_debugfs_init(struct amdgpu_device *adev); |
403 | 422 | ||
404 | /* sub-allocation manager, it has to be protected by another lock. | 423 | /* sub-allocation manager, it has to be protected by another lock. |
@@ -455,9 +474,10 @@ struct amdgpu_sa_bo { | |||
455 | */ | 474 | */ |
456 | void amdgpu_gem_force_release(struct amdgpu_device *adev); | 475 | void amdgpu_gem_force_release(struct amdgpu_device *adev); |
457 | int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size, | 476 | int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size, |
458 | int alignment, u32 initial_domain, | 477 | int alignment, u32 initial_domain, |
459 | u64 flags, bool kernel, | 478 | u64 flags, bool kernel, |
460 | struct drm_gem_object **obj); | 479 | struct reservation_object *resv, |
480 | struct drm_gem_object **obj); | ||
461 | 481 | ||
462 | int amdgpu_mode_dumb_create(struct drm_file *file_priv, | 482 | int amdgpu_mode_dumb_create(struct drm_file *file_priv, |
463 | struct drm_device *dev, | 483 | struct drm_device *dev, |
@@ -715,10 +735,14 @@ struct amdgpu_ctx { | |||
715 | struct amdgpu_device *adev; | 735 | struct amdgpu_device *adev; |
716 | struct amdgpu_queue_mgr queue_mgr; | 736 | struct amdgpu_queue_mgr queue_mgr; |
717 | unsigned reset_counter; | 737 | unsigned reset_counter; |
738 | uint32_t vram_lost_counter; | ||
718 | spinlock_t ring_lock; | 739 | spinlock_t ring_lock; |
719 | struct dma_fence **fences; | 740 | struct dma_fence **fences; |
720 | struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS]; | 741 | struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS]; |
721 | bool preamble_presented; | 742 | bool preamble_presented; |
743 | enum amd_sched_priority init_priority; | ||
744 | enum amd_sched_priority override_priority; | ||
745 | struct mutex lock; | ||
722 | }; | 746 | }; |
723 | 747 | ||
724 | struct amdgpu_ctx_mgr { | 748 | struct amdgpu_ctx_mgr { |
@@ -731,17 +755,22 @@ struct amdgpu_ctx_mgr { | |||
731 | struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id); | 755 | struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id); |
732 | int amdgpu_ctx_put(struct amdgpu_ctx *ctx); | 756 | int amdgpu_ctx_put(struct amdgpu_ctx *ctx); |
733 | 757 | ||
734 | uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring, | 758 | int amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring, |
735 | struct dma_fence *fence); | 759 | struct dma_fence *fence, uint64_t *seq); |
736 | struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, | 760 | struct dma_fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, |
737 | struct amdgpu_ring *ring, uint64_t seq); | 761 | struct amdgpu_ring *ring, uint64_t seq); |
762 | void amdgpu_ctx_priority_override(struct amdgpu_ctx *ctx, | ||
763 | enum amd_sched_priority priority); | ||
738 | 764 | ||
739 | int amdgpu_ctx_ioctl(struct drm_device *dev, void *data, | 765 | int amdgpu_ctx_ioctl(struct drm_device *dev, void *data, |
740 | struct drm_file *filp); | 766 | struct drm_file *filp); |
741 | 767 | ||
768 | int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id); | ||
769 | |||
742 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr); | 770 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr); |
743 | void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr); | 771 | void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr); |
744 | 772 | ||
773 | |||
745 | /* | 774 | /* |
746 | * file private structure | 775 | * file private structure |
747 | */ | 776 | */ |
@@ -753,7 +782,6 @@ struct amdgpu_fpriv { | |||
753 | struct mutex bo_list_lock; | 782 | struct mutex bo_list_lock; |
754 | struct idr bo_list_handles; | 783 | struct idr bo_list_handles; |
755 | struct amdgpu_ctx_mgr ctx_mgr; | 784 | struct amdgpu_ctx_mgr ctx_mgr; |
756 | u32 vram_lost_counter; | ||
757 | }; | 785 | }; |
758 | 786 | ||
759 | /* | 787 | /* |
@@ -854,7 +882,7 @@ struct amdgpu_mec { | |||
854 | struct amdgpu_kiq { | 882 | struct amdgpu_kiq { |
855 | u64 eop_gpu_addr; | 883 | u64 eop_gpu_addr; |
856 | struct amdgpu_bo *eop_obj; | 884 | struct amdgpu_bo *eop_obj; |
857 | struct mutex ring_mutex; | 885 | spinlock_t ring_lock; |
858 | struct amdgpu_ring ring; | 886 | struct amdgpu_ring ring; |
859 | struct amdgpu_irq_src irq; | 887 | struct amdgpu_irq_src irq; |
860 | }; | 888 | }; |
@@ -1014,11 +1042,14 @@ struct amdgpu_gfx { | |||
1014 | /* reset mask */ | 1042 | /* reset mask */ |
1015 | uint32_t grbm_soft_reset; | 1043 | uint32_t grbm_soft_reset; |
1016 | uint32_t srbm_soft_reset; | 1044 | uint32_t srbm_soft_reset; |
1017 | bool in_reset; | ||
1018 | /* s3/s4 mask */ | 1045 | /* s3/s4 mask */ |
1019 | bool in_suspend; | 1046 | bool in_suspend; |
1020 | /* NGG */ | 1047 | /* NGG */ |
1021 | struct amdgpu_ngg ngg; | 1048 | struct amdgpu_ngg ngg; |
1049 | |||
1050 | /* pipe reservation */ | ||
1051 | struct mutex pipe_reserve_mutex; | ||
1052 | DECLARE_BITMAP (pipe_reserve_bitmap, AMDGPU_MAX_COMPUTE_QUEUES); | ||
1022 | }; | 1053 | }; |
1023 | 1054 | ||
1024 | int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, | 1055 | int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, |
@@ -1056,6 +1087,7 @@ struct amdgpu_cs_parser { | |||
1056 | /* buffer objects */ | 1087 | /* buffer objects */ |
1057 | struct ww_acquire_ctx ticket; | 1088 | struct ww_acquire_ctx ticket; |
1058 | struct amdgpu_bo_list *bo_list; | 1089 | struct amdgpu_bo_list *bo_list; |
1090 | struct amdgpu_mn *mn; | ||
1059 | struct amdgpu_bo_list_entry vm_pd; | 1091 | struct amdgpu_bo_list_entry vm_pd; |
1060 | struct list_head validated; | 1092 | struct list_head validated; |
1061 | struct dma_fence *fence; | 1093 | struct dma_fence *fence; |
@@ -1096,6 +1128,7 @@ struct amdgpu_job { | |||
1096 | uint32_t gds_base, gds_size; | 1128 | uint32_t gds_base, gds_size; |
1097 | uint32_t gws_base, gws_size; | 1129 | uint32_t gws_base, gws_size; |
1098 | uint32_t oa_base, oa_size; | 1130 | uint32_t oa_base, oa_size; |
1131 | uint32_t vram_lost_counter; | ||
1099 | 1132 | ||
1100 | /* user fence handling */ | 1133 | /* user fence handling */ |
1101 | uint64_t uf_addr; | 1134 | uint64_t uf_addr; |
@@ -1121,7 +1154,7 @@ static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p, | |||
1121 | /* | 1154 | /* |
1122 | * Writeback | 1155 | * Writeback |
1123 | */ | 1156 | */ |
1124 | #define AMDGPU_MAX_WB 1024 /* Reserve at most 1024 WB slots for amdgpu-owned rings. */ | 1157 | #define AMDGPU_MAX_WB 512 /* Reserve at most 512 WB slots for amdgpu-owned rings. */ |
1125 | 1158 | ||
1126 | struct amdgpu_wb { | 1159 | struct amdgpu_wb { |
1127 | struct amdgpu_bo *wb_obj; | 1160 | struct amdgpu_bo *wb_obj; |
@@ -1183,6 +1216,9 @@ struct amdgpu_firmware { | |||
1183 | 1216 | ||
1184 | /* gpu info firmware data pointer */ | 1217 | /* gpu info firmware data pointer */ |
1185 | const struct firmware *gpu_info_fw; | 1218 | const struct firmware *gpu_info_fw; |
1219 | |||
1220 | void *fw_buf_ptr; | ||
1221 | uint64_t fw_buf_mc; | ||
1186 | }; | 1222 | }; |
1187 | 1223 | ||
1188 | /* | 1224 | /* |
@@ -1197,20 +1233,6 @@ void amdgpu_benchmark(struct amdgpu_device *adev, int test_number); | |||
1197 | void amdgpu_test_moves(struct amdgpu_device *adev); | 1233 | void amdgpu_test_moves(struct amdgpu_device *adev); |
1198 | 1234 | ||
1199 | /* | 1235 | /* |
1200 | * MMU Notifier | ||
1201 | */ | ||
1202 | #if defined(CONFIG_MMU_NOTIFIER) | ||
1203 | int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr); | ||
1204 | void amdgpu_mn_unregister(struct amdgpu_bo *bo); | ||
1205 | #else | ||
1206 | static inline int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr) | ||
1207 | { | ||
1208 | return -ENODEV; | ||
1209 | } | ||
1210 | static inline void amdgpu_mn_unregister(struct amdgpu_bo *bo) {} | ||
1211 | #endif | ||
1212 | |||
1213 | /* | ||
1214 | * Debugfs | 1236 | * Debugfs |
1215 | */ | 1237 | */ |
1216 | struct amdgpu_debugfs { | 1238 | struct amdgpu_debugfs { |
@@ -1305,6 +1327,8 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, | |||
1305 | int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, | 1327 | int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, |
1306 | struct drm_file *filp); | 1328 | struct drm_file *filp); |
1307 | int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); | 1329 | int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); |
1330 | int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data, | ||
1331 | struct drm_file *filp); | ||
1308 | int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); | 1332 | int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); |
1309 | int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, | 1333 | int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, |
1310 | struct drm_file *filp); | 1334 | struct drm_file *filp); |
@@ -1371,6 +1395,18 @@ struct amdgpu_atcs { | |||
1371 | }; | 1395 | }; |
1372 | 1396 | ||
1373 | /* | 1397 | /* |
1398 | * Firmware VRAM reservation | ||
1399 | */ | ||
1400 | struct amdgpu_fw_vram_usage { | ||
1401 | u64 start_offset; | ||
1402 | u64 size; | ||
1403 | struct amdgpu_bo *reserved_bo; | ||
1404 | void *va; | ||
1405 | }; | ||
1406 | |||
1407 | int amdgpu_fw_reserve_vram_init(struct amdgpu_device *adev); | ||
1408 | |||
1409 | /* | ||
1374 | * CGS | 1410 | * CGS |
1375 | */ | 1411 | */ |
1376 | struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev); | 1412 | struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev); |
@@ -1502,6 +1538,7 @@ struct amdgpu_device { | |||
1502 | /* display */ | 1538 | /* display */ |
1503 | bool enable_virtual_display; | 1539 | bool enable_virtual_display; |
1504 | struct amdgpu_mode_info mode_info; | 1540 | struct amdgpu_mode_info mode_info; |
1541 | /* For pre-DCE11. DCE11 and later are in "struct amdgpu_device->dm" */ | ||
1505 | struct work_struct hotplug_work; | 1542 | struct work_struct hotplug_work; |
1506 | struct amdgpu_irq_src crtc_irq; | 1543 | struct amdgpu_irq_src crtc_irq; |
1507 | struct amdgpu_irq_src pageflip_irq; | 1544 | struct amdgpu_irq_src pageflip_irq; |
@@ -1519,7 +1556,6 @@ struct amdgpu_device { | |||
1519 | 1556 | ||
1520 | /* powerplay */ | 1557 | /* powerplay */ |
1521 | struct amd_powerplay powerplay; | 1558 | struct amd_powerplay powerplay; |
1522 | bool pp_enabled; | ||
1523 | bool pp_force_state_enabled; | 1559 | bool pp_force_state_enabled; |
1524 | 1560 | ||
1525 | /* dpm */ | 1561 | /* dpm */ |
@@ -1558,6 +1594,9 @@ struct amdgpu_device { | |||
1558 | /* GDS */ | 1594 | /* GDS */ |
1559 | struct amdgpu_gds gds; | 1595 | struct amdgpu_gds gds; |
1560 | 1596 | ||
1597 | /* display related functionality */ | ||
1598 | struct amdgpu_display_manager dm; | ||
1599 | |||
1561 | struct amdgpu_ip_block ip_blocks[AMDGPU_MAX_IP_NUM]; | 1600 | struct amdgpu_ip_block ip_blocks[AMDGPU_MAX_IP_NUM]; |
1562 | int num_ip_blocks; | 1601 | int num_ip_blocks; |
1563 | struct mutex mn_lock; | 1602 | struct mutex mn_lock; |
@@ -1575,6 +1614,8 @@ struct amdgpu_device { | |||
1575 | struct delayed_work late_init_work; | 1614 | struct delayed_work late_init_work; |
1576 | 1615 | ||
1577 | struct amdgpu_virt virt; | 1616 | struct amdgpu_virt virt; |
1617 | /* firmware VRAM reservation */ | ||
1618 | struct amdgpu_fw_vram_usage fw_vram_usage; | ||
1578 | 1619 | ||
1579 | /* link all shadow bo */ | 1620 | /* link all shadow bo */ |
1580 | struct list_head shadow_list; | 1621 | struct list_head shadow_list; |
@@ -1592,6 +1633,7 @@ struct amdgpu_device { | |||
1592 | 1633 | ||
1593 | /* record last mm index being written through WREG32*/ | 1634 | /* record last mm index being written through WREG32*/ |
1594 | unsigned long last_mm_index; | 1635 | unsigned long last_mm_index; |
1636 | bool in_sriov_reset; | ||
1595 | }; | 1637 | }; |
1596 | 1638 | ||
1597 | static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev) | 1639 | static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev) |
@@ -1618,6 +1660,9 @@ void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v); | |||
1618 | u64 amdgpu_mm_rdoorbell64(struct amdgpu_device *adev, u32 index); | 1660 | u64 amdgpu_mm_rdoorbell64(struct amdgpu_device *adev, u32 index); |
1619 | void amdgpu_mm_wdoorbell64(struct amdgpu_device *adev, u32 index, u64 v); | 1661 | void amdgpu_mm_wdoorbell64(struct amdgpu_device *adev, u32 index, u64 v); |
1620 | 1662 | ||
1663 | bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); | ||
1664 | bool amdgpu_device_has_dc_support(struct amdgpu_device *adev); | ||
1665 | |||
1621 | /* | 1666 | /* |
1622 | * Registers read & write functions. | 1667 | * Registers read & write functions. |
1623 | */ | 1668 | */ |
@@ -1759,6 +1804,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
1759 | #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r)) | 1804 | #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r)) |
1760 | #define amdgpu_ring_patch_cond_exec(r,o) (r)->funcs->patch_cond_exec((r),(o)) | 1805 | #define amdgpu_ring_patch_cond_exec(r,o) (r)->funcs->patch_cond_exec((r),(o)) |
1761 | #define amdgpu_ih_get_wptr(adev) (adev)->irq.ih_funcs->get_wptr((adev)) | 1806 | #define amdgpu_ih_get_wptr(adev) (adev)->irq.ih_funcs->get_wptr((adev)) |
1807 | #define amdgpu_ih_prescreen_iv(adev) (adev)->irq.ih_funcs->prescreen_iv((adev)) | ||
1762 | #define amdgpu_ih_decode_iv(adev, iv) (adev)->irq.ih_funcs->decode_iv((adev), (iv)) | 1808 | #define amdgpu_ih_decode_iv(adev, iv) (adev)->irq.ih_funcs->decode_iv((adev), (iv)) |
1763 | #define amdgpu_ih_set_rptr(adev) (adev)->irq.ih_funcs->set_rptr((adev)) | 1809 | #define amdgpu_ih_set_rptr(adev) (adev)->irq.ih_funcs->set_rptr((adev)) |
1764 | #define amdgpu_display_vblank_get_counter(adev, crtc) (adev)->mode_info.funcs->vblank_get_counter((adev), (crtc)) | 1810 | #define amdgpu_display_vblank_get_counter(adev, crtc) (adev)->mode_info.funcs->vblank_get_counter((adev), (crtc)) |
@@ -1791,18 +1837,6 @@ void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes, | |||
1791 | u64 num_vis_bytes); | 1837 | u64 num_vis_bytes); |
1792 | void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain); | 1838 | void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain); |
1793 | bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo); | 1839 | bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo); |
1794 | int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages); | ||
1795 | int amdgpu_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, | ||
1796 | uint32_t flags); | ||
1797 | bool amdgpu_ttm_tt_has_userptr(struct ttm_tt *ttm); | ||
1798 | struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm); | ||
1799 | bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start, | ||
1800 | unsigned long end); | ||
1801 | bool amdgpu_ttm_tt_userptr_invalidated(struct ttm_tt *ttm, | ||
1802 | int *last_invalidated); | ||
1803 | bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm); | ||
1804 | uint64_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, | ||
1805 | struct ttm_mem_reg *mem); | ||
1806 | void amdgpu_vram_location(struct amdgpu_device *adev, struct amdgpu_mc *mc, u64 base); | 1840 | void amdgpu_vram_location(struct amdgpu_device *adev, struct amdgpu_mc *mc, u64 base); |
1807 | void amdgpu_gart_location(struct amdgpu_device *adev, struct amdgpu_mc *mc); | 1841 | void amdgpu_gart_location(struct amdgpu_device *adev, struct amdgpu_mc *mc); |
1808 | void amdgpu_ttm_set_active_vram_size(struct amdgpu_device *adev, u64 size); | 1842 | void amdgpu_ttm_set_active_vram_size(struct amdgpu_device *adev, u64 size); |
@@ -1836,8 +1870,6 @@ static inline bool amdgpu_has_atpx(void) { return false; } | |||
1836 | extern const struct drm_ioctl_desc amdgpu_ioctls_kms[]; | 1870 | extern const struct drm_ioctl_desc amdgpu_ioctls_kms[]; |
1837 | extern const int amdgpu_max_kms_ioctl; | 1871 | extern const int amdgpu_max_kms_ioctl; |
1838 | 1872 | ||
1839 | bool amdgpu_kms_vram_lost(struct amdgpu_device *adev, | ||
1840 | struct amdgpu_fpriv *fpriv); | ||
1841 | int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags); | 1873 | int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags); |
1842 | void amdgpu_driver_unload_kms(struct drm_device *dev); | 1874 | void amdgpu_driver_unload_kms(struct drm_device *dev); |
1843 | void amdgpu_driver_lastclose_kms(struct drm_device *dev); | 1875 | void amdgpu_driver_lastclose_kms(struct drm_device *dev); |
@@ -1885,10 +1917,15 @@ static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; } | |||
1885 | static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { } | 1917 | static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { } |
1886 | #endif | 1918 | #endif |
1887 | 1919 | ||
1888 | struct amdgpu_bo_va_mapping * | 1920 | int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, |
1889 | amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, | 1921 | uint64_t addr, struct amdgpu_bo **bo, |
1890 | uint64_t addr, struct amdgpu_bo **bo); | 1922 | struct amdgpu_bo_va_mapping **mapping); |
1891 | int amdgpu_cs_sysvm_access_required(struct amdgpu_cs_parser *parser); | 1923 | |
1924 | #if defined(CONFIG_DRM_AMD_DC) | ||
1925 | int amdgpu_dm_display_resume(struct amdgpu_device *adev ); | ||
1926 | #else | ||
1927 | static inline int amdgpu_dm_display_resume(struct amdgpu_device *adev) { return 0; } | ||
1928 | #endif | ||
1892 | 1929 | ||
1893 | #include "amdgpu_object.h" | 1930 | #include "amdgpu_object.h" |
1894 | #endif | 1931 | #endif |