]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/amdgpu: get maximum and used UVD handles (v4)
authorArindam Nath <arindam.nath@amd.com>
Mon, 12 Dec 2016 09:59:33 +0000 (15:29 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:12:38 +0000 (11:12 -0500)
commit5528a53d497e8783fc6a24aa1d579ebc7ca34b0a
tree9452b3a156aab983db2917e960debd88e288318d
parent662e53a33abd08c5c875e147973ba73b4b1fdff0
drm/amd/amdgpu: get maximum and used UVD handles (v4)

Change History
--------------

v4: Changes suggested by Emil, Christian
- return -ENODATA for asics with unlimited sessions

v3: changes suggested by Christian
- Add a check for UVD IP block using AMDGPU_HW_IP_UVD
  query type.
- Add a check for asic_type to be less than
  CHIP_POLARIS10 since starting Polaris, we support
  unlimited UVD instances.
- Add kerneldoc style comment for
  amdgpu_uvd_used_handles().

v2: as suggested by Christian
- Add a new query AMDGPU_INFO_NUM_HANDLES
- Create a helper function to return the number
  of currently used UVD handles.
- Modify the logic to count the number of used
  UVD handles since handles can be freed in
  non-linear fashion.

v1:
- 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 two variables max_handles and
  used_handles inside drm_amdgpu_info_hw_ip. So now
  an application (or libdrm) can use AMDGPU_INFO IOCTL
  with AMDGPU_INFO_HW_IP_INFO query type to get these
  values.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h
include/uapi/drm/amdgpu_drm.h