Reviewed-by: Alex Deucher <[email protected]>

________________________________
From: amd-gfx <[email protected]> on behalf of Shaoyun Liu 
<[email protected]>
Sent: Wednesday, May 30, 2018 4:29:51 PM
To: [email protected]
Cc: Liu, Shaoyun
Subject: [PATCH] drm/amdgpu: Fix NULL pointer when load kfd driver with PP 
block is disabled

Change-Id: If34e3517b6cb6f31e898bbe7921485fbddb79fb9
Signed-off-by: Shaoyun Liu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index 887702c..bc55e9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -310,7 +310,7 @@ void get_local_mem_info(struct kgd_dev *kgd,
                         mem_info->local_mem_size_public,
                         mem_info->local_mem_size_private);

-       if (amdgpu_emu_mode == 1) {
+       if (!adev->powerplay.pp_funcs) {
                 mem_info->mem_clk_max = 100;
                 return;
         }
@@ -335,7 +335,7 @@ uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd)
         struct amdgpu_device *adev = (struct amdgpu_device *)kgd;

         /* the sclk is in quantas of 10kHz */
-       if (amdgpu_emu_mode == 1)
+       if (!adev->powerplay.pp_funcs)
                 return 100;

         if (amdgpu_sriov_vf(adev))
--
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to