Skip to contentSkip to conversation

drm/amdgpu: return an error of query_video_caps is not set

PATCH In review Alex Deucher 2 participants 2 messages Jun 29, 2023

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: return an error of 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
index cca5a495611f3..85a0d5f419c87 100644
@@ -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);
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw

Am 29.06.23 um 15:22 schrieb Alex Deucher:

Quoted 4 lines

Should only be an issue for bring up when the function pointer is not set, but check it anyway to be safe.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
index cca5a495611f3..85a0d5f419c87 100644
@@ -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);