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

drm/amd/display: Fix CP_IRQ clear bit and logic

[Why]
Currently clearing the wrong bit for CP_IRQ, and logic on when to
clear needs to be fixed.

[How]
Corrected bit to clear and improved logic for decision to clear.

Signed-off-by: Harmanprit Tatla <harmanprit.tatla@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Harmanprit Tatla and committed by
Alex Deucher
5cd04c48 05e3d830

+8 -11
+1 -2
drivers/gpu/drm/amd/display/modules/hdcp/hdcp.c
··· 472 472 } 473 473 474 474 /* Clear CP_IRQ status if needed */ 475 - if (event_ctx.event == MOD_HDCP_EVENT_CPIRQ && 476 - event_ctx.unexpected_event == 0) { 475 + if (event_ctx.event == MOD_HDCP_EVENT_CPIRQ) { 477 476 status = mod_hdcp_clear_cp_irq_status(hdcp); 478 477 if (status != MOD_HDCP_STATUS_SUCCESS) 479 478 push_error_status(hdcp, status);
+7 -9
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c
··· 30 30 #define KSV_READ_SIZE 0xf /* 0x6803b - 0x6802c */ 31 31 #define HDCP_MAX_AUX_TRANSACTION_SIZE 16 32 32 33 + #define DP_CP_IRQ (1 << 2) 34 + 33 35 enum mod_hdcp_ddc_message_id { 34 36 MOD_HDCP_MESSAGE_ID_INVALID = -1, 35 37 ··· 650 648 651 649 enum mod_hdcp_status mod_hdcp_clear_cp_irq_status(struct mod_hdcp *hdcp) 652 650 { 653 - uint8_t clear_cp_irq_bit = 2; 651 + uint8_t clear_cp_irq_bit = DP_CP_IRQ; 654 652 uint32_t size = 1; 655 653 656 654 if (is_dp_hdcp(hdcp)) { 657 - if (hdcp->connection.link.dp.rev >= 0x14) 658 - return hdcp->config.ddc.funcs.write_dpcd(hdcp->config.ddc.handle, 659 - DP_DEVICE_SERVICE_IRQ_VECTOR_ESI0, &clear_cp_irq_bit, size) 660 - ? MOD_HDCP_STATUS_SUCCESS : MOD_HDCP_STATUS_DDC_FAILURE; 661 - else 662 - return hdcp->config.ddc.funcs.write_dpcd(hdcp->config.ddc.handle, 663 - DP_DEVICE_SERVICE_IRQ_VECTOR, &clear_cp_irq_bit, size) 664 - ? MOD_HDCP_STATUS_SUCCESS : MOD_HDCP_STATUS_DDC_FAILURE; 655 + uint32_t cp_irq_addrs = (hdcp->connection.link.dp.rev >= 0x14) 656 + ? DP_DEVICE_SERVICE_IRQ_VECTOR_ESI0:DP_DEVICE_SERVICE_IRQ_VECTOR; 657 + return hdcp->config.ddc.funcs.write_dpcd(hdcp->config.ddc.handle, cp_irq_addrs, 658 + &clear_cp_irq_bit, size) ? MOD_HDCP_STATUS_SUCCESS : MOD_HDCP_STATUS_DDC_FAILURE; 665 659 } 666 660 667 661 return MOD_HDCP_STATUS_INVALID_OPERATION;