From: jsg Date: Sun, 19 Dec 2021 01:33:26 +0000 (+0000) Subject: drm/amd/display: add connector type check for CRC source set X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d615f594a4a3b9c22862c7f678168b8dbe25e048;p=openbsd drm/amd/display: add connector type check for CRC source set From Perry Yuan f35f7f04aa80587bfe00c5e679df054918e79a63 in linux 5.10.y/5.10.87 2da34b7bb59e1caa9a336e0e20a76b8b6a4abea2 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c index e00a30e7d25..04c20ce6e94 100644 --- a/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +++ b/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c @@ -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)) {