Skip to content

Commit 2a0f927

Browse files
Bhawanpreet Lakhaalexdeucher
authored andcommitted
drm/amd/display: handle DP cpirq
[Why] This is needed for DP as DP can send us info using irq. [How] Check if irq bit is set on short pulse and call the function that handles cpirq in amdgpu_dm_hdcp Signed-off-by: Bhawanpreet Lakha <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0c8620d commit 2a0f927

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,12 @@ static void handle_hpd_rx_irq(void *param)
16261626
struct dc_link *dc_link = aconnector->dc_link;
16271627
bool is_mst_root_connector = aconnector->mst_mgr.mst_state;
16281628
enum dc_connection_type new_connection_type = dc_connection_none;
1629+
#ifdef CONFIG_DRM_AMD_DC_HDCP
1630+
union hpd_irq_data hpd_irq_data;
1631+
struct amdgpu_device *adev = dev->dev_private;
1632+
1633+
memset(&hpd_irq_data, 0, sizeof(hpd_irq_data));
1634+
#endif
16291635

16301636
/*
16311637
* TODO:Temporary add mutex to protect hpd interrupt not have a gpio
@@ -1635,7 +1641,12 @@ static void handle_hpd_rx_irq(void *param)
16351641
if (dc_link->type != dc_connection_mst_branch)
16361642
mutex_lock(&aconnector->hpd_lock);
16371643

1644+
1645+
#ifdef CONFIG_DRM_AMD_DC_HDCP
1646+
if (dc_link_handle_hpd_rx_irq(dc_link, &hpd_irq_data, NULL) &&
1647+
#else
16381648
if (dc_link_handle_hpd_rx_irq(dc_link, NULL, NULL) &&
1649+
#endif
16391650
!is_mst_root_connector) {
16401651
/* Downstream Port status changed. */
16411652
if (!dc_link_detect_sink(dc_link, &new_connection_type))
@@ -1670,6 +1681,10 @@ static void handle_hpd_rx_irq(void *param)
16701681
drm_kms_helper_hotplug_event(dev);
16711682
}
16721683
}
1684+
#ifdef CONFIG_DRM_AMD_DC_HDCP
1685+
if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ)
1686+
hdcp_handle_cpirq(adev->dm.hdcp_workqueue, aconnector->base.index);
1687+
#endif
16731688
if ((dc_link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) ||
16741689
(dc_link->type == dc_connection_mst_branch))
16751690
dm_handle_hpd_rx_irq(aconnector);

0 commit comments

Comments
 (0)