dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Pitoiset <samuel.pitoiset@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH libdrm 2/4] amdgpu: add new GPU sensor related interface
Date: Tue, 14 Feb 2017 01:09:00 +0100	[thread overview]
Message-ID: <20170214000902.30234-3-samuel.pitoiset@gmail.com> (raw)
In-Reply-To: <20170214000902.30234-1-samuel.pitoiset@gmail.com>

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 --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;
 	};
 };
 
-- 
2.11.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-02-14  0:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  0:08 [PATCH libdrm 0/4] libdrm: add new GPU sensor interface for AMDGPU Samuel Pitoiset
2017-02-14  0:08 ` [PATCH libdrm 1/4] amdgpu: sync amdgpu_drm.h with the kernel Samuel Pitoiset
2017-02-14  0:09 ` Samuel Pitoiset [this message]
2017-02-14  0:09 ` [PATCH libdrm 3/4] amdgpu: allow to query GPU sensor related information Samuel Pitoiset
2017-02-14  0:09 ` [PATCH libdrm 4/4] Bump version for 2.4.76 release Samuel Pitoiset
2017-02-14  1:44 ` [PATCH libdrm 0/4] libdrm: add new GPU sensor interface for AMDGPU Emil Velikov
2017-02-14  9:43   ` Christian König
2017-02-14 10:25     ` Samuel Pitoiset

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170214000902.30234-3-samuel.pitoiset@gmail.com \
    --to=samuel.pitoiset@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox