drm/amdkfd: Retrieve SDMA numbers from amdgpu

Instead of hard coding the number of sdma engines and the number of
sdma_xgmi engines in the device_info table, get the number of toal SDMA
instances from amdgpu. The first two engines are sdma engines and the
rest are sdma-xgmi engines unless the ASIC doesn't support XGMI.

v2: add kfd_ prefix to non static function names

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Amber Lin
2021-11-18 00:38:59 -05:00
committed by Alex Deucher
parent e39938117e
commit ee2f17f4d0
4 changed files with 37 additions and 22 deletions

View File

@@ -213,6 +213,9 @@ struct kfd_device_info {
unsigned int num_sdma_queues_per_engine;
};
unsigned int kfd_get_num_sdma_engines(struct kfd_dev *kdev);
unsigned int kfd_get_num_xgmi_sdma_engines(struct kfd_dev *kdev);
struct kfd_mem_obj {
uint32_t range_start;
uint32_t range_end;