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

Commit 5921f209 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: dp: read the DPCD if the AUX setting have changed



Trigger the reading of DPCD if there was a change in the AUX
configuration caused by a failure while reading the EDID.
This is required to ensure the integrity and validity
of the sink capabilities read that will subsequently be used
to establish the mainlink.

CRs-Fixed: 2006096
Change-Id: If3a51b5efd9124fd20dc9860e5f2cdb4e466a2c6
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 853e762b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2185,6 +2185,12 @@ read_edid:
	hdmi_edid_set_max_pclk_rate(dp->panel_data.panel_info.edid_data,
		min(dp->max_pclk_khz, max_pclk_khz));

	if (dp->dpcd_read_required) {
		pr_debug("reading DPCD with updated AUX config\n");
		mdss_dp_dpcd_cap_read(dp);
		dp->dpcd_read_required = false;
	}

	ret = hdmi_edid_parser(dp->panel_data.panel_info.edid_data);
	if (ret) {
		pr_err("edid parse failed, setting default resolution\n");
+1 −0
Original line number Diff line number Diff line
@@ -554,6 +554,7 @@ struct mdss_dp_drv_pdata {
	bool hpd;
	bool psm_enabled;
	bool audio_test_req;
	bool dpcd_read_required;

	/* dp specific */
	unsigned char *base;
+20 −1
Original line number Diff line number Diff line
@@ -956,6 +956,8 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
	const u8 cea_tag = 0x02;
	u32 const segment_addr = 0x30;
	u32 checksum = 0;
	bool phy_aux_update_requested = false;
	bool ext_block_parsing_done = false;

	ret = dp_aux_chan_ready(dp);
	if (ret) {
@@ -991,6 +993,7 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
			pr_err("Read failed. rlen=%s\n",
				mdss_dp_get_aux_error(rlen));
			mdss_dp_phy_aux_update_config(dp, PHY_AUX_CFG1);
			phy_aux_update_requested = true;
			retries--;
			continue;
		}
@@ -1002,6 +1005,7 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
			if (ret) {
				pr_err("corrupt edid block detected\n");
				mdss_dp_phy_aux_update_config(dp, PHY_AUX_CFG1);
				phy_aux_update_requested = true;
				retries--;
				continue;
			}
@@ -1027,6 +1031,7 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
			pr_debug("Invalid edid block 0 header\n");
			/* Retry block 0 with adjusted phy aux settings */
			mdss_dp_phy_aux_update_config(dp, PHY_AUX_CFG1);
			phy_aux_update_requested = true;
			retries--;
			continue;
		} else {
@@ -1049,9 +1054,11 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
		checksum = edid_buf[rlen - 1];

		/* break if no more extension blocks present */
		if (edid_blk >= dp->edid.ext_block_cnt)
		if (edid_blk >= dp->edid.ext_block_cnt) {
			ext_block_parsing_done = true;
			break;
		}
	}

	if (dp->test_data.test_requested == TEST_EDID_READ) {
		pr_debug("sending checksum %d\n", checksum);
@@ -1059,6 +1066,18 @@ int mdss_dp_edid_read(struct mdss_dp_drv_pdata *dp)
		dp->test_data = (const struct dpcd_test_request){ 0 };
	}

	/*
	 * Trigger the reading of DPCD if there was a change in the AUX
	 * configuration caused by a failure while reading the EDID.
	 * This is required to ensure the integrity and validity
	 * of the sink capabilities read that will subsequently be used
	 * to establish the mainlink.
	 */
	if (edid_parsing_done && ext_block_parsing_done
			&& phy_aux_update_requested) {
		dp->dpcd_read_required = true;
	}

	return ret;
}