drm/amdgpu: get_hive_id from amdgpu side (v2)
authorShaoyun Liu <Shaoyun.Liu@amd.com>
Fri, 6 Jul 2018 15:28:23 +0000 (11:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Sep 2018 03:48:42 +0000 (22:48 -0500)
Retrieve hive_id from amdgpu device

v2: compile fix

Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c

index 1a0824e6c8d050d0dd9dfccf8c4bfad91f08247f..5661c343a71dd12f8aaef694764e8bfbba25ab6c 100644 (file)
@@ -411,6 +411,13 @@ uint64_t amdgpu_amdkfd_get_vram_usage(struct kgd_dev *kgd)
        return amdgpu_vram_mgr_usage(&adev->mman.bdev.man[TTM_PL_VRAM]);
 }
 
+uint64_t amdgpu_amdkfd_get_hive_id(struct kgd_dev *kgd)
+{
+       struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
+
+       return adev->gmc.xgmi.hive_id;
+}
+
 int amdgpu_amdkfd_submit_ib(struct kgd_dev *kgd, enum kgd_engine_type engine,
                                uint32_t vmid, uint64_t gpu_addr,
                                uint32_t *ib_cmd, uint32_t ib_len)
index 2a1da3fe2b06942be68b0d2bf585b36c7f3aa59f..41e7dfc3ced328afb7a9c0a0f1da68cdf66fa0f4 100644 (file)
@@ -145,6 +145,7 @@ uint64_t get_gpu_clock_counter(struct kgd_dev *kgd);
 uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd);
 void get_cu_info(struct kgd_dev *kgd, struct kfd_cu_info *cu_info);
 uint64_t amdgpu_amdkfd_get_vram_usage(struct kgd_dev *kgd);
+uint64_t amdgpu_amdkfd_get_hive_id(struct kgd_dev *kgd);
 
 #define read_user_wptr(mmptr, wptr, dst)                               \
        ({                                                              \
index 3dc987cab0eab97396a536eb6a32f8f574855721..c9176537550bbbccbc50d81e62155097cd62dccb 100644 (file)
@@ -215,7 +215,8 @@ static const struct kfd2kgd_calls kfd2kgd = {
        .invalidate_tlbs_vmid = invalidate_tlbs_vmid,
        .submit_ib = amdgpu_amdkfd_submit_ib,
        .gpu_recover = amdgpu_amdkfd_gpu_reset,
-       .set_compute_idle = amdgpu_amdkfd_set_compute_idle
+       .set_compute_idle = amdgpu_amdkfd_set_compute_idle,
+       .get_hive_id = amdgpu_amdkfd_get_hive_id,
 };
 
 struct kfd2kgd_calls *amdgpu_amdkfd_gfx_9_0_get_functions(void)