[PATCH] amdgpu: get maximum and used UVD handles

arindam.nath at amd.com arindam.nath at amd.com
Mon Dec 12 18:51:30 UTC 2016


From: Arindam Nath <arindam.nath at amd.com>

User might want to query the maximum number of UVD
instances supported by firmware. In addition to that,
if there are multiple applications using UVD handles
at the same time, he might also want to query the
currently used number of handles.

For this we add a new query AMDGPU_INFO_NUM_HANDLES
and a new struct drm_amdgpu_info_num_handles to
get these values.

Signed-off-by: Arindam Nath <arindam.nath at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
---
 include/drm/amdgpu_drm.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index d8f2497..89fda6b 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -483,6 +483,8 @@ struct drm_amdgpu_cs_chunk_data {
 #define AMDGPU_INFO_DEV_INFO			0x16
 /* visible vram usage */
 #define AMDGPU_INFO_VIS_VRAM_USAGE		0x17
+/* Query UVD handles */
+#define AMDGPU_INFO_NUM_HANDLES			0x1C
 
 #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT	0
 #define AMDGPU_INFO_MMR_SE_INDEX_MASK	0xff
@@ -641,6 +643,13 @@ struct drm_amdgpu_info_hw_ip {
 	uint32_t  _pad;
 };
 
+struct drm_amdgpu_info_num_handles {
+	/** Max handles as supported by firmware for UVD */
+	uint32_t  uvd_max_handles;
+	/** Handles currently in use for UVD */
+	uint32_t  uvd_used_handles;
+};
+
 /*
  * Supported GPU families
  */
-- 
1.9.1



More information about the amd-gfx mailing list