summaryrefslogtreecommitdiff
path: root/msm/dp/dp_hdcp2p2.c
diff options
context:
space:
mode:
authorChristopher Braga <cbraga@codeaurora.org>2019-04-22 14:33:25 -0400
committerChristopher Braga <cbraga@codeaurora.org>2019-04-24 17:42:07 -0400
commit83af37f1e59df7ae6662c0622f20acb93667d065 (patch)
treeec00836bfcc3be02f243d76571912e1b21619c53 /msm/dp/dp_hdcp2p2.c
parent9b09b9af71e4860835a967b9d62253c9e5f7dac3 (diff)
downloaddisplay-drivers-83af37f1e59df7ae6662c0622f20acb93667d065.tar.gz
disp: msm: make the HDCP protocol module asynchronous
Commands to the HDCP protocol layer can fail or block if executed when the system enters suspend or shutdown. Protocol layer blockage will occur until the system returns into a power on state, potentially resulting in deadlocks for clients who synchronously wait on protocol layer completion. Asynchronously handle all requests to the protocol module to ensure that clients can make progress regardless of the state of the underlying HDCP handler. When an already queued request is received by the protocol module, that request will be rescheduled to the back of the queue. Change-Id: I658dd09a81f21037cd90bbaa5b7d73363472e0b0 Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
Diffstat (limited to 'msm/dp/dp_hdcp2p2.c')
-rw-r--r--msm/dp/dp_hdcp2p2.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/msm/dp/dp_hdcp2p2.c b/msm/dp/dp_hdcp2p2.c
index f71c25e6..61404be5 100644
--- a/msm/dp/dp_hdcp2p2.c
+++ b/msm/dp/dp_hdcp2p2.c
@@ -238,19 +238,22 @@ static void dp_hdcp2p2_reset(struct dp_hdcp2p2_ctrl *ctrl)
static int dp_hdcp2p2_register(void *input, bool mst_enabled)
{
int rc;
- enum sde_hdcp_2x_device_type device_type;
- struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
+ struct dp_hdcp2p2_ctrl *ctrl = input;
+ struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_ENABLE};
rc = dp_hdcp2p2_valid_handle(ctrl);
if (rc)
return rc;
if (mst_enabled)
- device_type = HDCP_TXMTR_DP_MST;
+ cdata.device_type = HDCP_TXMTR_DP_MST;
else
- device_type = HDCP_TXMTR_DP;
+ cdata.device_type = HDCP_TXMTR_DP;
- return sde_hdcp_2x_enable(ctrl->lib_ctx, device_type);
+ cdata.context = ctrl->lib_ctx;
+ rc = ctrl->lib->wakeup(&cdata);
+
+ return rc;
}
static int dp_hdcp2p2_on(void *input)
@@ -276,25 +279,20 @@ static void dp_hdcp2p2_off(void *input)
{
int rc;
struct dp_hdcp2p2_ctrl *ctrl = (struct dp_hdcp2p2_ctrl *)input;
- struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_INVALID};
+ struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_DISABLE};
rc = dp_hdcp2p2_valid_handle(ctrl);
if (rc)
return;
- if (atomic_read(&ctrl->auth_state) != HDCP_STATE_AUTH_FAIL) {
- cdata.cmd = HDCP_2X_CMD_STOP;
- cdata.context = ctrl->lib_ctx;
- dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
- }
-
dp_hdcp2p2_set_interrupts(ctrl, false);
dp_hdcp2p2_reset(ctrl);
kthread_park(ctrl->thread);
- sde_hdcp_2x_disable(ctrl->lib_ctx);
+ cdata.context = ctrl->lib_ctx;
+ ctrl->lib->wakeup(&cdata);
}
static int dp_hdcp2p2_authenticate(void *input)