diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2023-06-29 16:14:32 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-07-07 20:51:47 +0300 |
commit | bc8ba5f2da3e7bd63bc1750f6c7e480c406de8b0 (patch) | |
tree | 135f90b1bba42fd6e25233c5584e3e70962ff574 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |
parent | 95de7f26b5c0bd907834b1027a2dca8ac6758bbc (diff) | |
download | linux-bc8ba5f2da3e7bd63bc1750f6c7e480c406de8b0.tar.xz |
drm/amdgpu: return an error if query_video_caps is not set
Should only be an issue for bring up when the function
pointer is not set, but check it anyway to be safe.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index cca5a495611f..85a0d5f419c8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -1102,6 +1102,9 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) struct drm_amdgpu_info_video_caps *caps; int r; + if (!adev->asic_funcs->query_video_codecs) + return -EINVAL; + switch (info->video_cap.type) { case AMDGPU_INFO_VIDEO_CAPS_DECODE: r = amdgpu_asic_query_video_codecs(adev, false, &codecs); |