Kindly Ignore this. Sent to wrong mailing list. Sent another email to correct mailing list.
Regards, Satyajit On 4/30/2019 4:15 PM, Sahu, Satyajit wrote: > [CAUTION: External Email] > > Query the max uvd handles and used uvd handles. > > Signed-off-by: Satyajit Sahu <[email protected]> > --- > amdgpu/amdgpu.h | 14 ++++++++++++++ > amdgpu/amdgpu_gpu_info.c | 15 +++++++++++++++ > 2 files changed, 29 insertions(+) > > diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h > index c44a495a..407b5fae 100644 > --- a/amdgpu/amdgpu.h > +++ b/amdgpu/amdgpu.h > @@ -1174,6 +1174,20 @@ int amdgpu_query_gpu_info(amdgpu_device_handle dev, > int amdgpu_query_info(amdgpu_device_handle dev, unsigned info_id, > unsigned size, void *value); > > +/** > + * Query uvd handles info. > + * > + * > + * \param dev - \c [in] Device handle. See #amdgpu_device_initialize() > + * \param size - \c [in] Size of the returned value. > + * \param value - \c [out] Pointer to the return value. > + * > + * \return 0 on success\n > + * <0 - Negative POSIX error code > + * > +*/ > +int amdgpu_query_uvd_handles(amdgpu_device_handle dev, > + unsigned size, void *value); > /** > * Query hardware or driver information. > * > diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c > index 777087f2..253c4da7 100644 > --- a/amdgpu/amdgpu_gpu_info.c > +++ b/amdgpu/amdgpu_gpu_info.c > @@ -44,6 +44,21 @@ drm_public int amdgpu_query_info(amdgpu_device_handle dev, > unsigned info_id, > sizeof(struct drm_amdgpu_info)); > } > > +drm_public int amdgpu_query_uvd_handles(amdgpu_device_handle dev, > + unsigned size, void *value) > +{ > + struct drm_amdgpu_info request; > + > + memset(&request, 0, sizeof(request)); > + request.return_pointer = (uintptr_t)value; > + request.return_size = size; > + request.query = AMDGPU_INFO_NUM_HANDLES; > + request.query_hw_ip.type = AMDGPU_HW_IP_UVD; > + > + return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request, > + sizeof(struct drm_amdgpu_info)); > +} > + > drm_public int amdgpu_query_crtc_from_id(amdgpu_device_handle dev, unsigned > id, > int32_t *result) > { > -- > 2.19.1 > > _______________________________________________ > mesa-dev mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
