History

drm/amdgpu: Expose more GPU sensor queries

Add sub-queries for stable pstate shader/memory clock.

Rex Zhu committed 8 years ago

Commit 60bbade1 parent 156a81b2 files · +22 −0Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +18 −0
  2. include/uapi/drm/amdgpu_drm.h +4 −0
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+18−0
@@ -758,6 +758,24 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 757 unmodified lines
758758 return -EINVAL;
759759 }
760760 break;
761+ case AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK:
762+ /* get stable pstate sclk in Mhz */
763+ if (amdgpu_dpm_read_sensor(adev,
764+ AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK,
765+ (void *)&ui32, &ui32_size)) {
766+ return -EINVAL;
767+ }
768+ ui32 /= 100;
769+ break;
770+ case AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK:
771+ /* get stable pstate mclk in Mhz */
772+ if (amdgpu_dpm_read_sensor(adev,
773+ AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK,
774+ (void *)&ui32, &ui32_size)) {
775+ return -EINVAL;
776+ }
777+ ui32 /= 100;
778+ break;
761779 default:
762780 DRM_DEBUG_KMS("Invalid request %d\n",
763781 info->sensor_info.type);
include/uapi/drm/amdgpu_drm.h+4−0
@@ -664,6 +664,10 @@ struct drm_amdgpu_cs_chunk_data { · 663 unmodified lines
664664 #define AMDGPU_INFO_SENSOR_VDDNB 0x6
665665 /* Subquery id: Query graphics voltage */
666666 #define AMDGPU_INFO_SENSOR_VDDGFX 0x7
667+ /* Subquery id: Query GPU stable pstate shader clock */
668+ #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
669+ /* Subquery id: Query GPU stable pstate memory clock */
670+ #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
667671 /* Number of VRAM page faults on CPU access. */
668672 #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
669673 #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t