Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d78fbd19 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: dp: Add event logs for HDCP sessions"

parents 2dfa258d 5385b6a3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -415,6 +415,7 @@ static void dp_display_hdcp_process_delayed_off(struct dp_display_private *dp)
static int dp_display_hdcp_process_sink_sync(struct dp_display_private *dp)
{
	u8 sink_status = 0;
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);

	if (dp->debug->hdcp_wait_sink_sync) {
		drm_dp_dpcd_readb(dp->aux->drm_aux, DP_SINK_STATUS,
@@ -426,7 +427,14 @@ static int dp_display_hdcp_process_sink_sync(struct dp_display_private *dp)
			queue_delayed_work(dp->wq, &dp->hdcp_cb_work, HZ);
			return -EAGAIN;
		}
		/*
		 * Some sinks need more time to stabilize after synchronization
		 * and before it can handle an HDCP authentication request.
		 * Adding the delay for better interoperability.
		 */
		msleep(6000);
	}
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);

	return 0;
}
@@ -573,6 +581,8 @@ static void dp_display_notify_hdcp_status_cb(void *ptr,
		enum sde_hdcp_state state)
{
	struct dp_display_private *dp = ptr;
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY,
					dp->link->hdcp_status.hdcp_state);

	if (!dp) {
		DP_ERR("invalid input\n");
@@ -582,6 +592,8 @@ static void dp_display_notify_hdcp_status_cb(void *ptr,
	dp->link->hdcp_status.hdcp_state = state;

	queue_delayed_work(dp->wq, &dp->hdcp_cb_work, HZ/4);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT,
					dp->link->hdcp_status.hdcp_state);
}

static void dp_display_deinitialize_hdcp(struct dp_display_private *dp)
+14 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ static int dp_hdcp2p2_wakeup(struct hdcp_transport_wakeup_data *data)
{
	struct dp_hdcp2p2_ctrl *ctrl;

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);
	if (!data) {
		DP_ERR("invalid input\n");
		return -EINVAL;
@@ -211,6 +212,7 @@ static int dp_hdcp2p2_wakeup(struct hdcp_transport_wakeup_data *data)
	}

exit:
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, data->cmd);
	return 0;
}

@@ -387,6 +389,10 @@ static int dp_hdcp2p2_aux_read_message(struct dp_hdcp2p2_ctrl *ctrl)
		if (bytes_read != read_size) {
			DP_ERR("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
					offset, read_size, bytes_read);
			SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY,
							offset,
							read_size,
							bytes_read);
			rc = -EINVAL;
			break;
		}
@@ -423,6 +429,10 @@ static int dp_hdcp2p2_aux_write_message(struct dp_hdcp2p2_ctrl *ctrl,
		if (bytes_written != write_size) {
			DP_ERR("fail: offset(0x%x), size(0x%x), rc(0x%x)\n",
					offset, write_size, bytes_written);
			SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY,
							offset,
							write_size,
							bytes_written);
			rc = -EINVAL;
			break;
		}
@@ -474,6 +484,7 @@ static void dp_hdcp2p2_send_msg(struct dp_hdcp2p2_ctrl *ctrl)
	int rc = 0;
	struct sde_hdcp_2x_wakeup_data cdata = {HDCP_2X_CMD_INVALID};

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);
	if (!ctrl) {
		DP_ERR("invalid input\n");
		rc = -EINVAL;
@@ -509,6 +520,7 @@ static void dp_hdcp2p2_send_msg(struct dp_hdcp2p2_ctrl *ctrl)
		cdata.cmd = HDCP_2X_CMD_MSG_SEND_FAILED;

	dp_hdcp2p2_wakeup_lib(ctrl, &cdata);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, cdata.cmd);
}

static int dp_hdcp2p2_get_msg_from_sink(struct dp_hdcp2p2_ctrl *ctrl)
@@ -663,6 +675,7 @@ static int dp_hdcp2p2_cp_irq(void *input)
{
	int rc;
	struct dp_hdcp2p2_ctrl *ctrl = input;
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY);

	rc = dp_hdcp2p2_valid_handle(ctrl);
	if (rc)
@@ -691,6 +704,7 @@ static int dp_hdcp2p2_cp_irq(void *input)

	kfifo_put(&ctrl->cmd_q, HDCP_TRANSPORT_CMD_LINK_CHECK);
	wake_up(&ctrl->wait_q);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);

	return 0;
}
+11 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ static const struct sde_hdcp_2x_msg_data
static int sde_hdcp_2x_get_next_message(struct sde_hdcp_2x_ctrl *hdcp,
				     struct hdcp_transport_wakeup_data *data)
{
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->last_msg);
	switch (hdcp->last_msg) {
	case INVALID_MESSAGE:
		return AKE_INIT;
@@ -202,6 +203,7 @@ static int sde_hdcp_2x_get_next_message(struct sde_hdcp_2x_ctrl *hdcp,
		pr_err("Unknown message ID (%d)\n", hdcp->last_msg);
		return -EINVAL;
	}
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT);
}

static void sde_hdcp_2x_wait_for_response(struct sde_hdcp_2x_ctrl *hdcp)
@@ -351,6 +353,7 @@ static void sde_hdcp_2x_clean(struct sde_hdcp_2x_ctrl *hdcp)
	struct sde_hdcp_stream *stream_entry;
	struct hdcp_transport_wakeup_data cdata = {HDCP_TRANSPORT_CMD_INVALID};

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->authenticated);
	hdcp->authenticated = false;

	cdata.context = hdcp->client_data;
@@ -372,6 +375,7 @@ static void sde_hdcp_2x_clean(struct sde_hdcp_2x_ctrl *hdcp)
		sde_hdcp_2x_wakeup_client(hdcp, &cdata);

	hdcp2_app_comm(hdcp->hdcp2_ctx, HDCP2_CMD_STOP, &hdcp->app_data);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, hdcp->authenticated);
}

static u8 sde_hdcp_2x_stream_type(u8 min_enc_level)
@@ -474,6 +478,8 @@ static void sde_hdcp_2x_msg_sent(struct sde_hdcp_2x_ctrl *hdcp)
		HDCP_TRANSPORT_CMD_INVALID,
		hdcp->client_data};

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->authenticated,
					hdcp->app_data.response.data[0]);
	switch (hdcp->app_data.response.data[0]) {
	case SKE_SEND_TYPE_ID:
		if (!hdcp2_app_comm(hdcp->hdcp2_ctx,
@@ -525,6 +531,7 @@ static void sde_hdcp_2x_msg_sent(struct sde_hdcp_2x_ctrl *hdcp)
	}

	sde_hdcp_2x_wakeup_client(hdcp, &cdata);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, hdcp->authenticated);
}

static void sde_hdcp_2x_init(struct sde_hdcp_2x_ctrl *hdcp)
@@ -539,6 +546,7 @@ static void sde_hdcp_2x_start_auth(struct sde_hdcp_2x_ctrl *hdcp)
{
	int rc;

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->authenticated);
	rc = hdcp2_app_comm(hdcp->hdcp2_ctx, HDCP2_CMD_START_AUTH,
		&hdcp->app_data);
	if (rc) {
@@ -550,6 +558,7 @@ static void sde_hdcp_2x_start_auth(struct sde_hdcp_2x_ctrl *hdcp)
		 sde_hdcp_2x_message_name(hdcp->app_data.response.data[0]));

	sde_hdcp_2x_send_message(hdcp);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, hdcp->authenticated);
}

static void sde_hdcp_2x_timeout(struct sde_hdcp_2x_ctrl *hdcp)
@@ -584,6 +593,7 @@ static void sde_hdcp_2x_msg_recvd(struct sde_hdcp_2x_ctrl *hdcp)
	u32 request_length, out_msg;
	struct hdcp_transport_wakeup_data cdata = {HDCP_TRANSPORT_CMD_INVALID};

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->authenticated);
	if (atomic_read(&hdcp->hdcp_off)) {
		pr_debug("invalid state, hdcp off\n");
		return;
@@ -688,6 +698,7 @@ static void sde_hdcp_2x_msg_recvd(struct sde_hdcp_2x_ctrl *hdcp)

	if (rc && !atomic_read(&hdcp->hdcp_off))
		sde_hdcp_2x_clean(hdcp);
	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, hdcp->authenticated);
}

static struct list_head *sde_hdcp_2x_stream_present(