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

Commit 685ecbad authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mdss: hdmi: reinitialize completion before reuse"

parents 5f4052a9 35cd4c1c
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -334,7 +334,6 @@ static void hdcp2p2_sink_message_work(struct work_struct *work)
	int rc;
	int msg_size;
	u64 mult;
	u64 div;
	struct msm_hdmi_mode_timing_info *timing;

	if (!hdcp2p2_ctrl) {
@@ -344,14 +343,7 @@ static void hdcp2p2_sink_message_work(struct work_struct *work)

	timing = hdcp2p2_ctrl->init_data.timing;

	/* calculate number of lines sent in 10ms */
	mult = 10000 * ((u64)timing->pixel_freq * 1000);
	div = hdmi_tx_get_v_total(timing) * 1000000;
	if (div)
		do_div(mult, div);
	else
		mult = 0;

	mult = hdmi_tx_get_v_total(timing) / 20;
	memset(&hdcp2p2_ddc_data, 0, sizeof(hdcp2p2_ddc_data));
	hdcp2p2_ddc_data.ddc_data.what = "HDCP2RxStatus";
	hdcp2p2_ddc_data.ddc_data.data_buf = (u8 *)&msg_size;
@@ -391,6 +383,8 @@ static void hdcp2p2_sink_message_work(struct work_struct *work)
		hdcp2p2_ddc_read_message(hdcp2p2_ctrl, message->message_bytes,
				msg_size);
		message->msg_size = msg_size;
		DEV_DBG("%s: message received of size: %d\n", __func__,
								msg_size);

		INIT_LIST_HEAD(&message->entry);
		list_for_each(pos, &hdcp2p2_ctrl->hdcp_sink_messages);
@@ -521,7 +515,13 @@ static int hdcp2p2_isr(void *input)
	if (reg_val & HDCP2P2_RXSTATUS_MESSAGE_SIZE_MASK) {
		DSS_REG_W(hdcp2p2_ctrl->init_data.core_io, HDMI_DDC_INT_CTRL0,
						reg_val & ~(BIT(31)));
		complete(&hdcp2p2_ctrl->rxstatus_completion);
		if (!completion_done(&hdcp2p2_ctrl->rxstatus_completion))
			complete_all(&hdcp2p2_ctrl->rxstatus_completion);
	} else if (reg_val & BIT(8)) {
		DSS_REG_W(hdcp2p2_ctrl->init_data.core_io, HDMI_DDC_INT_CTRL0,
						reg_val & ~(BIT(9) | BIT(10)));
		if (!completion_done(&hdcp2p2_ctrl->rxstatus_completion))
			complete_all(&hdcp2p2_ctrl->rxstatus_completion);
	}

	return 0;
+3 −6
Original line number Diff line number Diff line
@@ -1536,12 +1536,9 @@ int hdmi_hdcp2p2_ddc_read_rxstatus(struct hdmi_tx_ddc_ctrl *ctrl,
		 */
		DEV_DBG("%s: HDMI_DDC_INT_CTRL0 is 0x%x, waiting for ISR\n",
			__func__, DSS_REG_R(ctrl->io, HDMI_DDC_INT_CTRL0));
		if (!wait_for_completion_timeout(rxstatus_completion,
						msecs_to_jiffies(200))) {
			DEV_ERR("%s: Timeout in waiting for interrupt\n",
					__func__);
			return -ETIMEDOUT;
		}
		reinit_completion(rxstatus_completion);
		wait_for_completion_timeout(rxstatus_completion,
						msecs_to_jiffies(200));
	}

	/* Make sure no errors occurred during DDC transaction */