Re: [PATCH] amdgpu: get maximum and used UVD handles

2016-12-14 Thread Emil Velikov
On 12 December 2016 at 18:51,   wrote:
> From: Arindam Nath 
>
> 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 
> Reviewed-by: Christian König 
> ---
>  include/drm/amdgpu_drm.h | 9 +
>  1 file changed, 9 insertions(+)
>
Follow the documented way to update the libdrm headers [1].
You will want to tackle this [2] small task first.

If the documentation is unclear and/or can be improved feel free to
send a patch.

Thanks
Emil

[1] https://cgit.freedesktop.org/mesa/drm/tree/include/drm/README#n68
[2] https://cgit.freedesktop.org/mesa/drm/tree/include/drm/README#n97
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] amdgpu: get maximum and used UVD handles

2016-12-12 Thread arindam . nath
From: Arindam Nath 

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 
Reviewed-by: Christian König 
---
 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_HANDLES0x1C
 
 #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

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx