Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/display: clean up hdcp workqueue handling

Use the existence of the workqueue itself to determine when to
enable HDCP features rather than sprinkling asic checks all over
the code. Also add a check for the existence of the hdcp
workqueue in the irq handling on the off chance we get and HPD
RX interrupt with the CP bit set. This avoids a crash if
the driver doesn't support HDCP for a particular asic.

Fixes: 96a3b32e67236f ("drm/amd/display: only enable HDCP for DCN+")
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206519
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+6 -4
+6 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1911 1911 mutex_lock(&aconnector->hpd_lock); 1912 1912 1913 1913 #ifdef CONFIG_DRM_AMD_DC_HDCP 1914 - if (adev->asic_type >= CHIP_RAVEN) 1914 + if (adev->dm.hdcp_workqueue) 1915 1915 hdcp_reset_display(adev->dm.hdcp_workqueue, aconnector->dc_link->link_index); 1916 1916 #endif 1917 1917 if (aconnector->fake_enable) ··· 2088 2088 } 2089 2089 } 2090 2090 #ifdef CONFIG_DRM_AMD_DC_HDCP 2091 - if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) 2092 - hdcp_handle_cpirq(adev->dm.hdcp_workqueue, aconnector->base.index); 2091 + if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) { 2092 + if (adev->dm.hdcp_workqueue) 2093 + hdcp_handle_cpirq(adev->dm.hdcp_workqueue, aconnector->base.index); 2094 + } 2093 2095 #endif 2094 2096 if ((dc_link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) || 2095 2097 (dc_link->type == dc_connection_mst_branch)) ··· 5704 5702 drm_connector_attach_vrr_capable_property( 5705 5703 &aconnector->base); 5706 5704 #ifdef CONFIG_DRM_AMD_DC_HDCP 5707 - if (adev->asic_type >= CHIP_RAVEN) 5705 + if (adev->dm.hdcp_workqueue) 5708 5706 drm_connector_attach_content_protection_property(&aconnector->base, true); 5709 5707 #endif 5710 5708 }