drm/amdgpu: add INFO ioctl support for querying video caps (v4)
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jan 2021 21:48:01 +0000 (16:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 26 Feb 2021 22:23:49 +0000 (17:23 -0500)
commitf35e9bdb06fbfa8a6fe9d25390fbee2ee5e7a329
tree5bbef73cba8d9fbe8962ff07149f45fe810ed806
parent3b246e8b6a97b7786f49433effea2aff39e58166
drm/amdgpu: add INFO ioctl support for querying video caps (v4)

We currently hardcode these in mesa, but querying them from
the kernel makes more sense since there may be board specific
limitations that the kernel driver is better suited to
determining.

Userpace patches that use this interface:
https://gitlab.freedesktop.org/leoliu/drm/-/commits/info_video_caps
https://gitlab.freedesktop.org/leoliu/mesa/-/commits/info_video_caps

v2: reorder the codecs to better align with mesa
v3: add max_pixels_per_frame to handle the portrait case, squash in
    memory leak fix
v4: drop extra break

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com> (v2)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h