Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>

________________________________
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> on behalf of Rex Zhu 
<rex....@amd.com>
Sent: Tuesday, March 13, 2018 1:07:29 AM
To: amd-gfx@lists.freedesktop.org
Cc: Zhu, Rex
Subject: [PATCH] drm/amdgpu: Plus NULL function pointer check

Change-Id: Ifd6553646e7468bc935504075816074373e1d58d
Signed-off-by: Rex Zhu <rex....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 56b2245..1875500 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1413,7 +1413,8 @@ static int amdgpu_device_ip_late_set_cg_state(struct 
amdgpu_device *adev)
                         continue;
                 /* skip CG for VCE/UVD, it's handled specially */
                 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD 
&&
-                   adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
+                   adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE &&
+                   adev->ip_blocks[i].version->funcs->set_clockgating_state) {
                         /* enable clockgating to save power */
                         r = 
adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
                                                                                
      AMD_CG_STATE_GATE);
--
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to