diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c8b605f3dc05..a59c07590cee 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
| @@ -129,6 +129,7 @@ extern int amdgpu_lbpw; | |||
| 129 | extern int amdgpu_compute_multipipe; | 129 | extern int amdgpu_compute_multipipe; |
| 130 | extern int amdgpu_gpu_recovery; | 130 | extern int amdgpu_gpu_recovery; |
| 131 | extern int amdgpu_emu_mode; | 131 | extern int amdgpu_emu_mode; |
| 132 | extern uint amdgpu_smu_memory_pool_size; | ||
| 132 | 133 | ||
| 133 | #ifdef CONFIG_DRM_AMDGPU_SI | 134 | #ifdef CONFIG_DRM_AMDGPU_SI |
| 134 | extern int amdgpu_si_support; | 135 | extern int amdgpu_si_support; |
| @@ -137,6 +138,7 @@ extern int amdgpu_si_support; | |||
| 137 | extern int amdgpu_cik_support; | 138 | extern int amdgpu_cik_support; |
| 138 | #endif | 139 | #endif |
| 139 | 140 | ||
| 141 | #define AMDGPU_SG_THRESHOLD (256*1024*1024) | ||
| 140 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ | 142 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ |
| 141 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 | 143 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 |
| 142 | #define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */ | 144 | #define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */ |
| @@ -222,10 +224,10 @@ enum amdgpu_kiq_irq { | |||
| 222 | AMDGPU_CP_KIQ_IRQ_LAST | 224 | AMDGPU_CP_KIQ_IRQ_LAST |
| 223 | }; | 225 | }; |
| 224 | 226 | ||
| 225 | int amdgpu_device_ip_set_clockgating_state(struct amdgpu_device *adev, | 227 | int amdgpu_device_ip_set_clockgating_state(void *dev, |
| 226 | enum amd_ip_block_type block_type, | 228 | enum amd_ip_block_type block_type, |
| 227 | enum amd_clockgating_state state); | 229 | enum amd_clockgating_state state); |
| 228 | int amdgpu_device_ip_set_powergating_state(struct amdgpu_device *adev, | 230 | int amdgpu_device_ip_set_powergating_state(void *dev, |
| 229 | enum amd_ip_block_type block_type, | 231 | enum amd_ip_block_type block_type, |
| 230 | enum amd_powergating_state state); | 232 | enum amd_powergating_state state); |
| 231 | void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev, | 233 | void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev, |
| @@ -681,6 +683,8 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data, | |||
| 681 | int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id); | 683 | int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id); |
| 682 | 684 | ||
| 683 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr); | 685 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr); |
| 686 | void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr); | ||
| 687 | void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr); | ||
| 684 | void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr); | 688 | void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr); |
| 685 | 689 | ||
| 686 | 690 | ||
| @@ -771,9 +775,18 @@ struct amdgpu_rlc { | |||
| 771 | u32 starting_offsets_start; | 775 | u32 starting_offsets_start; |
| 772 | u32 reg_list_format_size_bytes; | 776 | u32 reg_list_format_size_bytes; |
| 773 | u32 reg_list_size_bytes; | 777 | u32 reg_list_size_bytes; |
| 778 | u32 reg_list_format_direct_reg_list_length; | ||
| 779 | u32 save_restore_list_cntl_size_bytes; | ||
| 780 | u32 save_restore_list_gpm_size_bytes; | ||
| 781 | u32 save_restore_list_srm_size_bytes; | ||
| 774 | 782 | ||
| 775 | u32 *register_list_format; | 783 | u32 *register_list_format; |
| 776 | u32 *register_restore; | 784 | u32 *register_restore; |
| 785 | u8 *save_restore_list_cntl; | ||
| 786 | u8 *save_restore_list_gpm; | ||
| 787 | u8 *save_restore_list_srm; | ||
| 788 | |||
| 789 | bool is_rlc_v2_1; | ||
| 777 | }; | 790 | }; |
| 778 | 791 | ||
| 779 | #define AMDGPU_MAX_COMPUTE_QUEUES KGD_MAX_QUEUES | 792 | #define AMDGPU_MAX_COMPUTE_QUEUES KGD_MAX_QUEUES |
| @@ -867,6 +880,8 @@ struct amdgpu_gfx_config { | |||
| 867 | 880 | ||
| 868 | /* gfx configure feature */ | 881 | /* gfx configure feature */ |
| 869 | uint32_t double_offchip_lds_buf; | 882 | uint32_t double_offchip_lds_buf; |
| 883 | /* cached value of DB_DEBUG2 */ | ||
| 884 | uint32_t db_debug2; | ||
| 870 | }; | 885 | }; |
| 871 | 886 | ||
| 872 | struct amdgpu_cu_info { | 887 | struct amdgpu_cu_info { |
| @@ -938,6 +953,12 @@ struct amdgpu_gfx { | |||
| 938 | uint32_t ce_feature_version; | 953 | uint32_t ce_feature_version; |
| 939 | uint32_t pfp_feature_version; | 954 | uint32_t pfp_feature_version; |
| 940 | uint32_t rlc_feature_version; | 955 | uint32_t rlc_feature_version; |
| 956 | uint32_t rlc_srlc_fw_version; | ||
| 957 | uint32_t rlc_srlc_feature_version; | ||
| 958 | uint32_t rlc_srlg_fw_version; | ||
| 959 | uint32_t rlc_srlg_feature_version; | ||
| 960 | uint32_t rlc_srls_fw_version; | ||
| 961 | uint32_t rlc_srls_feature_version; | ||
| 941 | uint32_t mec_feature_version; | 962 | uint32_t mec_feature_version; |
| 942 | uint32_t mec2_feature_version; | 963 | uint32_t mec2_feature_version; |
| 943 | struct amdgpu_ring gfx_ring[AMDGPU_MAX_GFX_RINGS]; | 964 | struct amdgpu_ring gfx_ring[AMDGPU_MAX_GFX_RINGS]; |
| @@ -1204,6 +1225,8 @@ struct amdgpu_asic_funcs { | |||
| 1204 | /* invalidate hdp read cache */ | 1225 | /* invalidate hdp read cache */ |
| 1205 | void (*invalidate_hdp)(struct amdgpu_device *adev, | 1226 | void (*invalidate_hdp)(struct amdgpu_device *adev, |
| 1206 | struct amdgpu_ring *ring); | 1227 | struct amdgpu_ring *ring); |
| 1228 | /* check if the asic needs a full reset of if soft reset will work */ | ||
| 1229 | bool (*need_full_reset)(struct amdgpu_device *adev); | ||
| 1207 | }; | 1230 | }; |
| 1208 | 1231 | ||
| 1209 | /* | 1232 | /* |
| @@ -1368,7 +1391,19 @@ struct amdgpu_nbio_funcs { | |||
| 1368 | void (*detect_hw_virt)(struct amdgpu_device *adev); | 1391 | void (*detect_hw_virt)(struct amdgpu_device *adev); |
| 1369 | }; | 1392 | }; |
| 1370 | 1393 | ||
| 1371 | 1394 | struct amdgpu_df_funcs { | |
| 1395 | void (*init)(struct amdgpu_device *adev); | ||
| 1396 | void (*enable_broadcast_mode)(struct amdgpu_device *adev, | ||
| 1397 | bool enable); | ||
| 1398 | u32 (*get_fb_channel_number)(struct amdgpu_device *adev); | ||
| 1399 | u32 (*get_hbm_channel_number)(struct amdgpu_device *adev); | ||
| 1400 | void (*update_medium_grain_clock_gating)(struct amdgpu_device *adev, | ||
| 1401 | bool enable); | ||
| 1402 | void (*get_clockgating_state)(struct amdgpu_device *adev, | ||
| 1403 | u32 *flags); | ||
| 1404 | void (*enable_ecc_force_par_wr_rmw)(struct amdgpu_device *adev, | ||
| 1405 | bool enable); | ||
| 1406 | }; | ||
| 1372 | /* Define the HW IP blocks will be used in driver , add more if necessary */ | 1407 | /* Define the HW IP blocks will be used in driver , add more if necessary */ |
| 1373 | enum amd_hw_ip_block_type { | 1408 | enum amd_hw_ip_block_type { |
| 1374 | GC_HWIP = 1, | 1409 | GC_HWIP = 1, |
| @@ -1398,6 +1433,7 @@ enum amd_hw_ip_block_type { | |||
| 1398 | struct amd_powerplay { | 1433 | struct amd_powerplay { |
| 1399 | void *pp_handle; | 1434 | void *pp_handle; |
| 1400 | const struct amd_pm_funcs *pp_funcs; | 1435 | const struct amd_pm_funcs *pp_funcs; |
| 1436 | uint32_t pp_feature; | ||
| 1401 | }; | 1437 | }; |
| 1402 | 1438 | ||
| 1403 | #define AMDGPU_RESET_MAGIC_NUM 64 | 1439 | #define AMDGPU_RESET_MAGIC_NUM 64 |
| @@ -1590,6 +1626,7 @@ struct amdgpu_device { | |||
| 1590 | uint32_t *reg_offset[MAX_HWIP][HWIP_MAX_INSTANCE]; | 1626 | uint32_t *reg_offset[MAX_HWIP][HWIP_MAX_INSTANCE]; |
| 1591 | 1627 | ||
| 1592 | const struct amdgpu_nbio_funcs *nbio_funcs; | 1628 | const struct amdgpu_nbio_funcs *nbio_funcs; |
| 1629 | const struct amdgpu_df_funcs *df_funcs; | ||
| 1593 | 1630 | ||
| 1594 | /* delayed work_func for deferring clockgating during resume */ | 1631 | /* delayed work_func for deferring clockgating during resume */ |
| 1595 | struct delayed_work late_init_work; | 1632 | struct delayed_work late_init_work; |
| @@ -1764,6 +1801,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
| 1764 | #define amdgpu_asic_get_config_memsize(adev) (adev)->asic_funcs->get_config_memsize((adev)) | 1801 | #define amdgpu_asic_get_config_memsize(adev) (adev)->asic_funcs->get_config_memsize((adev)) |
| 1765 | #define amdgpu_asic_flush_hdp(adev, r) (adev)->asic_funcs->flush_hdp((adev), (r)) | 1802 | #define amdgpu_asic_flush_hdp(adev, r) (adev)->asic_funcs->flush_hdp((adev), (r)) |
| 1766 | #define amdgpu_asic_invalidate_hdp(adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) | 1803 | #define amdgpu_asic_invalidate_hdp(adev, r) (adev)->asic_funcs->invalidate_hdp((adev), (r)) |
| 1804 | #define amdgpu_asic_need_full_reset(adev) (adev)->asic_funcs->need_full_reset((adev)) | ||
| 1767 | #define amdgpu_gmc_flush_gpu_tlb(adev, vmid) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid)) | 1805 | #define amdgpu_gmc_flush_gpu_tlb(adev, vmid) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid)) |
| 1768 | #define amdgpu_gmc_emit_flush_gpu_tlb(r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr)) | 1806 | #define amdgpu_gmc_emit_flush_gpu_tlb(r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr)) |
| 1769 | #define amdgpu_gmc_emit_pasid_mapping(r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid)) | 1807 | #define amdgpu_gmc_emit_pasid_mapping(r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid)) |
| @@ -1790,6 +1828,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
| 1790 | #define amdgpu_ring_emit_rreg(r, d) (r)->funcs->emit_rreg((r), (d)) | 1828 | #define amdgpu_ring_emit_rreg(r, d) (r)->funcs->emit_rreg((r), (d)) |
| 1791 | #define amdgpu_ring_emit_wreg(r, d, v) (r)->funcs->emit_wreg((r), (d), (v)) | 1829 | #define amdgpu_ring_emit_wreg(r, d, v) (r)->funcs->emit_wreg((r), (d), (v)) |
| 1792 | #define amdgpu_ring_emit_reg_wait(r, d, v, m) (r)->funcs->emit_reg_wait((r), (d), (v), (m)) | 1830 | #define amdgpu_ring_emit_reg_wait(r, d, v, m) (r)->funcs->emit_reg_wait((r), (d), (v), (m)) |
| 1831 | #define amdgpu_ring_emit_reg_write_reg_wait(r, d0, d1, v, m) (r)->funcs->emit_reg_write_reg_wait((r), (d0), (d1), (v), (m)) | ||
| 1793 | #define amdgpu_ring_emit_tmz(r, b) (r)->funcs->emit_tmz((r), (b)) | 1832 | #define amdgpu_ring_emit_tmz(r, b) (r)->funcs->emit_tmz((r), (b)) |
| 1794 | #define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib))) | 1833 | #define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib))) |
| 1795 | #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r)) | 1834 | #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r)) |
