drm/amd/display: add connector type check for CRC source set
authorjsg <jsg@openbsd.org>
Sun, 19 Dec 2021 01:33:26 +0000 (01:33 +0000)
committerjsg <jsg@openbsd.org>
Sun, 19 Dec 2021 01:33:26 +0000 (01:33 +0000)
From Perry Yuan
f35f7f04aa80587bfe00c5e679df054918e79a63 in linux 5.10.y/5.10.87
2da34b7bb59e1caa9a336e0e20a76b8b6a4abea2 in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c

index e00a30e..04c20ce 100644 (file)
@@ -226,6 +226,14 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
                        ret = -EINVAL;
                        goto cleanup;
                }
+
+               if ((aconn->base.connector_type != DRM_MODE_CONNECTOR_DisplayPort) &&
+                               (aconn->base.connector_type != DRM_MODE_CONNECTOR_eDP)) {
+                       DRM_DEBUG_DRIVER("No DP connector available for CRC source\n");
+                       ret = -EINVAL;
+                       goto cleanup;
+               }
+
        }
 
        if (amdgpu_dm_crtc_configure_crc_source(crtc, crtc_state, source)) {