aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-10-07 14:48:18 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-12 15:44:16 -0400
commit4a446d55843fb82fc5bc6c72d27bfc20b6c294c3 (patch)
treebab304a8a43510b92b65fd0ae4926df412cbc2c0 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentb0b00ff16f2715562b7ea0dfa3a9c5b33328c8cb (diff)
drm/amdgpu: clarify UVD/VCE special handling for CG
UVD and VCE CG are handled specially, however the previous fix for this skipped late init for those blocks rather than just CG. Just protect the CG function call. No functional change since UVD and VCE don't currently utilize a late_init function. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 928774f5a7e0..15afe22ca890 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1408,9 +1408,6 @@ static int amdgpu_late_init(struct amdgpu_device *adev)
1408 for (i = 0; i < adev->num_ip_blocks; i++) { 1408 for (i = 0; i < adev->num_ip_blocks; i++) {
1409 if (!adev->ip_block_status[i].valid) 1409 if (!adev->ip_block_status[i].valid)
1410 continue; 1410 continue;
1411 if (adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_UVD ||
1412 adev->ip_blocks[i].type == AMD_IP_BLOCK_TYPE_VCE)
1413 continue;
1414 if (adev->ip_blocks[i].funcs->late_init) { 1411 if (adev->ip_blocks[i].funcs->late_init) {
1415 r = adev->ip_blocks[i].funcs->late_init((void *)adev); 1412 r = adev->ip_blocks[i].funcs->late_init((void *)adev);
1416 if (r) { 1413 if (r) {
@@ -1419,12 +1416,17 @@ static int amdgpu_late_init(struct amdgpu_device *adev)
1419 } 1416 }
1420 adev->ip_block_status[i].late_initialized = true; 1417 adev->ip_block_status[i].late_initialized = true;
1421 } 1418 }
1422 /* enable clockgating to save power */ 1419 /* skip CG for VCE/UVD, it's handled specially */
1423 r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, 1420 if (adev->ip_blocks[i].type != AMD_IP_BLOCK_TYPE_UVD &&
1424 AMD_CG_STATE_GATE); 1421 adev->ip_blocks[i].type != AMD_IP_BLOCK_TYPE_VCE) {
1425 if (r) { 1422 /* enable clockgating to save power */
1426 DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n", adev->ip_blocks[i].funcs->name, r); 1423 r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev,
1427 return r; 1424 AMD_CG_STATE_GATE);
1425 if (r) {
1426 DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n",
1427 adev->ip_blocks[i].funcs->name, r);
1428 return r;
1429 }
1428 } 1430 }
1429 } 1431 }
1430 1432