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

Commit fcd4abb6 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

msm: mdss: hdmi: Do not treat intermediate ddc error as failure



During DDC (Display Data Channel) communication, DDC engine may
find intermediate no acknowledgment errors from slave devices
and update the status accordingly. But the transaction may be
successful eventually at the end of communication session.
Do not tread these intermediate DDC status NACK errors as failures
as long as the transaction is successful.

CRs-Fixed: 984645
Change-Id: I78e811a2f64d7f2d78e37d13f2ff4f3375c4705c
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 17d7bd58
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ static int hdcp_lib_enable_encryption(struct hdcp_lib_handle *handle)
	pr_debug("success\n");
	return 0;
error:
	if (!atomic_read(&handle->hdcp_off))
	if (handle && !atomic_read(&handle->hdcp_off))
		HDCP_LIB_EXECUTE(clean);

	return rc;
@@ -721,6 +721,11 @@ static void hdcp_lib_stream(struct hdcp_lib_handle *handle)
		return;
	}

	if (!handle->repeater_flag) {
		pr_debug("invalid state, not a repeater\n");
		return;
	}

	/* send command to TZ */
	req_buf = (struct hdcp_query_stream_type_req *)handle->
			qseecom_handle->sbuf;
+14 −3
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ enum hdmi_hdcp2p2_sink_status {
	SINK_CONNECTED
};

enum hdmi_auth_status {
	HDMI_HDCP_AUTH_STATUS_FAILURE,
	HDMI_HDCP_AUTH_STATUS_SUCCESS
};

struct hdmi_hdcp2p2_ctrl {
	atomic_t auth_state;
	bool tethered;
@@ -60,6 +65,7 @@ struct hdmi_hdcp2p2_ctrl {
	struct hdcp_txmtr_ops *lib; /* Ops for driver to call into TZ */

	enum hdmi_hdcp_wakeup_cmd wakeup_cmd;
	enum hdmi_auth_status auth_status;
	char *send_msg_buf;
	uint32_t send_msg_len;
	uint32_t timeout;
@@ -156,6 +162,11 @@ static int hdmi_hdcp2p2_wakeup(struct hdmi_hdcp_wakeup_data *data)
	if (hdmi_hdcp2p2_copy_buf(ctrl, data))
		goto exit;

	if (ctrl->wakeup_cmd == HDMI_HDCP_WKUP_CMD_STATUS_SUCCESS)
		ctrl->auth_status = HDMI_HDCP_AUTH_STATUS_SUCCESS;
	else if (ctrl->wakeup_cmd == HDMI_HDCP_WKUP_CMD_STATUS_FAILED)
		ctrl->auth_status = HDMI_HDCP_AUTH_STATUS_FAILURE;

	if (ctrl->tethered)
		goto exit;

@@ -820,9 +831,7 @@ static void hdmi_hdcp2p2_auth_status(struct hdmi_hdcp2p2_ctrl *ctrl)
		return;
	}

	if (ctrl->wakeup_cmd == HDMI_HDCP_WKUP_CMD_STATUS_FAILED) {
		hdmi_hdcp2p2_auth_failed(ctrl);
	} else if (ctrl->wakeup_cmd == HDMI_HDCP_WKUP_CMD_STATUS_SUCCESS) {
	if (ctrl->auth_status == HDMI_HDCP_AUTH_STATUS_SUCCESS) {
		ctrl->init_data.notify_status(ctrl->init_data.cb_data,
			HDCP_STATE_AUTHENTICATED);

@@ -830,6 +839,8 @@ static void hdmi_hdcp2p2_auth_status(struct hdmi_hdcp2p2_ctrl *ctrl)

		if (ctrl->tethered)
			hdmi_hdcp2p2_link_check(ctrl);
	} else {
		hdmi_hdcp2p2_auth_failed(ctrl);
	}
}

+7 −21
Original line number Diff line number Diff line
@@ -725,10 +725,9 @@ static void hdmi_ddc_trigger(struct hdmi_tx_ddc_ctrl *ddc_ctrl,
	DSS_REG_W_ND(io, HDMI_DDC_CTRL, ddc_ctrl_reg_val);
}

static int hdmi_ddc_check_status(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
static void hdmi_ddc_clear_status(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
{
	u32 reg_val;
	int rc = 0;

	/* Read DDC status */
	reg_val = DSS_REG_R(ddc_ctrl->io, HDMI_DDC_SW_STATUS);
@@ -743,18 +742,14 @@ static int hdmi_ddc_check_status(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
		reg_val = BIT(3) | BIT(1);

		DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_CTRL, reg_val);

		rc = -ECOMM;
	}

	return rc;
}

static int hdmi_ddc_read_retry(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
{
	u32 reg_val, ndx, time_out_count, wait_time;
	struct hdmi_tx_ddc_data *ddc_data;
	int status, rc;
	int status;
	int busy_wait_us;

	if (!ddc_ctrl || !ddc_ctrl->io) {
@@ -823,10 +818,7 @@ static int hdmi_ddc_read_retry(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
			status = -ETIMEDOUT;
		}

		rc = hdmi_ddc_check_status(ddc_ctrl);

		if (!status)
			status = rc;
		hdmi_ddc_clear_status(ddc_ctrl);
	} while (status && ddc_data->retry--);

	if (status)
@@ -1165,7 +1157,7 @@ int hdmi_ddc_read(struct hdmi_tx_ddc_ctrl *ddc_ctrl)

int hdmi_ddc_read_seg(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
{
	int status, rc;
	int status;
	u32 reg_val, ndx, time_out_count;
	struct hdmi_tx_ddc_data *ddc_data;

@@ -1206,10 +1198,7 @@ int hdmi_ddc_read_seg(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
			status = -ETIMEDOUT;
		}

		rc = hdmi_ddc_check_status(ddc_ctrl);

		if (!status)
			status = rc;
		hdmi_ddc_clear_status(ddc_ctrl);
	} while (status && ddc_data->retry--);

	if (status)
@@ -1235,7 +1224,7 @@ error:

int hdmi_ddc_write(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
{
	int status, rc;
	int status;
	u32 time_out_count;
	struct hdmi_tx_ddc_data *ddc_data;
	u32 wait_time;
@@ -1307,10 +1296,7 @@ int hdmi_ddc_write(struct hdmi_tx_ddc_ctrl *ddc_ctrl)
			status = -ETIMEDOUT;
		}

		rc = hdmi_ddc_check_status(ddc_ctrl);

		if (!status)
			status = rc;
		hdmi_ddc_clear_status(ddc_ctrl);
	} while (status && ddc_data->retry--);

	if (status)