msm: mdss: hdmi: create separate environments for hdcp lib and hdmi
Isolate the execution environments for HDMI HDCP2.2 driver and HDCP library by creating separate threads and executing each work on dedicated kworker. Do not call each other's functions directly. Wakeup the other thread when needed and let the independent module execute their corresponding work and acknowledge by waking up other thread back. Change-Id: I67bca61b92c831451ce3482a759a214b1e5d6578 Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
This commit is contained in:
parent
14fb79b781
commit
e8591b7730
4 changed files with 1037 additions and 1013 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -633,6 +633,7 @@ again:
|
||||||
|
|
||||||
time_out_count = wait_for_completion_timeout(
|
time_out_count = wait_for_completion_timeout(
|
||||||
&ddc_ctrl->ddc_sw_done, wait_time);
|
&ddc_ctrl->ddc_sw_done, wait_time);
|
||||||
|
DEV_DBG("ddc read done at %dms\n", jiffies_to_msecs(jiffies));
|
||||||
|
|
||||||
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_INT_CTRL, BIT(1));
|
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_INT_CTRL, BIT(1));
|
||||||
if (!time_out_count) {
|
if (!time_out_count) {
|
||||||
|
@ -1089,6 +1090,8 @@ again:
|
||||||
time_out_count = wait_for_completion_timeout(
|
time_out_count = wait_for_completion_timeout(
|
||||||
&ddc_ctrl->ddc_sw_done, HZ/2);
|
&ddc_ctrl->ddc_sw_done, HZ/2);
|
||||||
|
|
||||||
|
DEV_DBG("DDC write done at %dms\n", jiffies_to_msecs(jiffies));
|
||||||
|
|
||||||
reg_val = DSS_REG_R(ddc_ctrl->io, HDMI_DDC_INT_CTRL);
|
reg_val = DSS_REG_R(ddc_ctrl->io, HDMI_DDC_INT_CTRL);
|
||||||
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_INT_CTRL, reg_val & (~BIT(2)));
|
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_INT_CTRL, reg_val & (~BIT(2)));
|
||||||
if (!time_out_count) {
|
if (!time_out_count) {
|
||||||
|
|
|
@ -14,25 +14,74 @@
|
||||||
#define __HDCP_QSEECOM_H
|
#define __HDCP_QSEECOM_H
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
enum hdcp_lib_wakeup_cmd {
|
||||||
|
HDCP_WKUP_CMD_START,
|
||||||
|
HDCP_WKUP_CMD_STOP,
|
||||||
|
HDCP_WKUP_CMD_MSG_SEND_SUCCESS,
|
||||||
|
HDCP_WKUP_CMD_MSG_SEND_FAILED,
|
||||||
|
HDCP_WKUP_CMD_MSG_RECV_SUCCESS,
|
||||||
|
HDCP_WKUP_CMD_MSG_RECV_FAILED,
|
||||||
|
HDCP_WKUP_CMD_MSG_RECV_TIMEOUT,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum hdmi_hdcp_cmd {
|
||||||
|
HDMI_HDCP_SEND_MESSAGE,
|
||||||
|
HDMI_HDCP_RECV_MESSAGE,
|
||||||
|
HDMI_HDCP_STATUS_SUCCESS,
|
||||||
|
HDMI_HDCP_STATUS_FAIL
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline char *hdmi_hdcp_cmd_to_str(uint32_t cmd)
|
||||||
|
{
|
||||||
|
switch (cmd) {
|
||||||
|
case HDMI_HDCP_SEND_MESSAGE:
|
||||||
|
return "HDMI_HDCP_SEND_MESSAGE";
|
||||||
|
case HDMI_HDCP_RECV_MESSAGE:
|
||||||
|
return "HDMI_HDCP_RECV_MESSAGE";
|
||||||
|
case HDMI_HDCP_STATUS_SUCCESS:
|
||||||
|
return "HDMI_HDCP_STATUS_SUCCESS";
|
||||||
|
case HDMI_HDCP_STATUS_FAIL:
|
||||||
|
return "HDMI_HDCP_STATUS_FAIL";
|
||||||
|
default:
|
||||||
|
return "???";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline char *hdcp_cmd_to_str(uint32_t cmd)
|
||||||
|
{
|
||||||
|
switch (cmd) {
|
||||||
|
case HDCP_WKUP_CMD_START:
|
||||||
|
return "HDCP_WKUP_CMD_START";
|
||||||
|
case HDCP_WKUP_CMD_STOP:
|
||||||
|
return "HDCP_WKUP_CMD_STOP";
|
||||||
|
case HDCP_WKUP_CMD_MSG_SEND_SUCCESS:
|
||||||
|
return "HDCP_WKUP_CMD_MSG_SEND_SUCCESS";
|
||||||
|
case HDCP_WKUP_CMD_MSG_SEND_FAILED:
|
||||||
|
return "HDCP_WKUP_CMD_MSG_SEND_FAILED";
|
||||||
|
case HDCP_WKUP_CMD_MSG_RECV_SUCCESS:
|
||||||
|
return "HDCP_WKUP_CMD_MSG_RECV_SUCCESS";
|
||||||
|
case HDCP_WKUP_CMD_MSG_RECV_FAILED:
|
||||||
|
return "HDCP_WKUP_CMD_MSG_RECV_FAILED";
|
||||||
|
case HDCP_WKUP_CMD_MSG_RECV_TIMEOUT:
|
||||||
|
return "HDCP_WKUP_CMD_MSG_RECV_TIMEOUT";
|
||||||
|
default:
|
||||||
|
return "???";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct hdcp_txmtr_ops {
|
struct hdcp_txmtr_ops {
|
||||||
int (*start)(void *phdcpcontext);
|
int (*wakeup)(void *phdcpcontext, enum hdcp_lib_wakeup_cmd cmd,
|
||||||
int (*stop)(void *phdcpcontext);
|
char *msg, uint32_t len);
|
||||||
bool (*feature_supported)(void *phdcpcontext);
|
bool (*feature_supported)(void *phdcpcontext);
|
||||||
|
|
||||||
int (*process_message)(void *phdcpcontext,
|
|
||||||
unsigned char *msg, uint32_t msg_size);
|
|
||||||
int (*hdcp_txmtr_get_state)(void *phdcpcontext,
|
int (*hdcp_txmtr_get_state)(void *phdcpcontext,
|
||||||
uint32_t *state);
|
uint32_t *state);
|
||||||
int (*hdcp_txmtr_query_stream_type)(void *phdcpcontext);
|
int (*hdcp_query_stream_type)(void *phdcpcontext);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hdcp_client_ops {
|
struct hdcp_client_ops {
|
||||||
int (*hdcp_send_message)(void *client_ctx,
|
int (*wakeup)(void *client_ctx, enum hdmi_hdcp_cmd cmd,
|
||||||
char *message, uint32_t msg_size);
|
char *msg, uint32_t msglen, uint32_t timeout);
|
||||||
int (*hdcp_recv_message)(void *client_ctx,
|
|
||||||
char *message, uint32_t msg_size,
|
|
||||||
u32 timeout);
|
|
||||||
int (*hdcp_tz_error)(void *client_ctx);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int hdcp_library_register(void **pphdcpcontext,
|
int hdcp_library_register(void **pphdcpcontext,
|
||||||
|
|
Loading…
Add table
Reference in a new issue