Skip to contentSkip to conversation

drm/amdgpu: Plus NULL function pointer check

PATCH In review Rex Zhu 3 participants 3 messages Mar 13, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Plus NULL function pointer check

Change-Id Ifd6553646e7468bc935504075816074373e1d58d
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
index 56b2245..1875500 100644
@@ -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);
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by
#2 lore raw
In reply to a message not in the archive

Am 13.03.2018 um 06:07 schrieb Rex Zhu:

Quoted 2 lines
Change-Id Ifd6553646e7468bc935504075816074373e1d58d
Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 56b2245..1875500 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev) · line 1420

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
@@ -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);

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

Reviewed-by
#3 lore raw
In reply to a message not in the archive

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Tuesday, March 13, 2018 1:07:29 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amdgpu: Plus NULL function pointer check

Change-Id Ifd6553646e7468bc935504075816074373e1d58d
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
index 56b2245..1875500 100644
@@ -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 [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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