Commit e22bb562 authored by Alex Deucher's avatar Alex Deucher

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: 96a3b32e ("drm/amd/display: only enable HDCP for DCN+")
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=206519Reviewed-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c7637c95
...@@ -1984,7 +1984,7 @@ static void handle_hpd_irq(void *param) ...@@ -1984,7 +1984,7 @@ static void handle_hpd_irq(void *param)
mutex_lock(&aconnector->hpd_lock); mutex_lock(&aconnector->hpd_lock);
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
if (adev->asic_type >= CHIP_RAVEN) if (adev->dm.hdcp_workqueue)
hdcp_reset_display(adev->dm.hdcp_workqueue, aconnector->dc_link->link_index); hdcp_reset_display(adev->dm.hdcp_workqueue, aconnector->dc_link->link_index);
#endif #endif
if (aconnector->fake_enable) if (aconnector->fake_enable)
...@@ -2161,8 +2161,10 @@ static void handle_hpd_rx_irq(void *param) ...@@ -2161,8 +2161,10 @@ static void handle_hpd_rx_irq(void *param)
} }
} }
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) {
hdcp_handle_cpirq(adev->dm.hdcp_workqueue, aconnector->base.index); if (adev->dm.hdcp_workqueue)
hdcp_handle_cpirq(adev->dm.hdcp_workqueue, aconnector->base.index);
}
#endif #endif
if ((dc_link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) || if ((dc_link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) ||
(dc_link->type == dc_connection_mst_branch)) (dc_link->type == dc_connection_mst_branch))
...@@ -5833,7 +5835,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, ...@@ -5833,7 +5835,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
drm_connector_attach_vrr_capable_property( drm_connector_attach_vrr_capable_property(
&aconnector->base); &aconnector->base);
#ifdef CONFIG_DRM_AMD_DC_HDCP #ifdef CONFIG_DRM_AMD_DC_HDCP
if (adev->asic_type >= CHIP_RAVEN) if (adev->dm.hdcp_workqueue)
drm_connector_attach_content_protection_property(&aconnector->base, true); drm_connector_attach_content_protection_property(&aconnector->base, true);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment