aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-10-07 12:22:02 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-25 14:38:43 -0400
commit07fecde5d3ece770234e2b71e052079af776869a (patch)
tree03706799c4d2783b18549de4a3bd12b49581d17a /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parent597be302f1d30e908115632fd90049242c470e37 (diff)
drm/amdgpu: fill in vce clock info ioctl query (v2)
Returns the vce clock table for the user mode driver. The user mode driver can fill this data into vce clock data packet for optimal VCE DPM. v2: update to the new API Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> 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_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 1ecfe9a046ab..3570124ed186 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -524,6 +524,24 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
524 return copy_to_user(out, &dev_info, 524 return copy_to_user(out, &dev_info,
525 min((size_t)size, sizeof(dev_info))) ? -EFAULT : 0; 525 min((size_t)size, sizeof(dev_info))) ? -EFAULT : 0;
526 } 526 }
527 case AMDGPU_INFO_VCE_CLOCK_TABLE: {
528 unsigned i;
529 struct drm_amdgpu_info_vce_clock_table vce_clk_table = {};
530 struct amd_vce_state *vce_state;
531
532 for (i = 0; i < AMDGPU_VCE_CLOCK_TABLE_ENTRIES; i++) {
533 vce_state = amdgpu_dpm_get_vce_clock_state(adev, i);
534 if (vce_state) {
535 vce_clk_table.entries[i].sclk = vce_state->sclk;
536 vce_clk_table.entries[i].mclk = vce_state->mclk;
537 vce_clk_table.entries[i].eclk = vce_state->evclk;
538 vce_clk_table.num_valid_entries++;
539 }
540 }
541
542 return copy_to_user(out, &vce_clk_table,
543 min((size_t)size, sizeof(vce_clk_table))) ? -EFAULT : 0;
544 }
527 default: 545 default:
528 DRM_DEBUG_KMS("Invalid request %d\n", info->query); 546 DRM_DEBUG_KMS("Invalid request %d\n", info->query);
529 return -EINVAL; 547 return -EINVAL;