diff mbox

[libdrm,2/4] amdgpu: add new GPU sensor related interface

Message ID 20170214000902.30234-3-samuel.pitoiset@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Samuel Pitoiset Feb. 14, 2017, 12:09 a.m. UTC
This will be used to expose the current GPU temperature, the
shader clock and eventually the memory clock (for non-APUs).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 include/drm/amdgpu_drm.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox

Patch

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index 2be8b8dc..cd9c8223 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -534,6 +534,14 @@  struct drm_amdgpu_cs_chunk_data {
 	#define AMDGPU_INFO_VBIOS_IMAGE		0x2
 /* Query UVD handles */
 #define AMDGPU_INFO_NUM_HANDLES			0x1C
+/* Query GPU sensor related information */
+#define AMDGPU_INFO_GPU_SENSOR			0x1D
+	/* Query the current shader clock */
+	#define AMDGPU_INFO_GPU_SENSOR_SCLK	0x1
+	/* Query the current memory clock */
+	#define AMDGPU_INFO_GPU_SENSOR_MCLK	0x2
+	/* Query the current temperature */
+	#define AMDGPU_INFO_GPU_SENSOR_TEMP	0x3
 
 #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT	0
 #define AMDGPU_INFO_MMR_SE_INDEX_MASK	0xff
@@ -597,6 +605,10 @@  struct drm_amdgpu_info {
 			uint32_t type;
 			uint32_t offset;
 		} vbios_info;
+
+		struct {
+			uint32_t type;
+		} gpu_sensor_info;
 	};
 };