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

Commit 504e2895 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: report the correct checksum to Display Port sink



Add change to send the checksum of the last EDID block to the
sink during EDID link compliance tests.

Change-Id: I0fc9defd6030e25732f1409a0a077ea06eda997b
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent c21c8c44
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -506,16 +506,6 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp,
	return 0;
}

static void dp_display_handle_test_edid(struct dp_display_private *dp)
{
	if (dp->link->sink_request & DP_TEST_LINK_EDID_READ) {
		drm_dp_dpcd_write(dp->aux->drm_aux, DP_TEST_EDID_CHECKSUM,
			&dp->panel->edid_ctrl->edid->checksum, 1);
		drm_dp_dpcd_write(dp->aux->drm_aux, DP_TEST_RESPONSE,
			&dp->link->test_response, 1);
	}
}

static int dp_display_process_hpd_high(struct dp_display_private *dp)
{
	int rc = 0;
@@ -543,7 +533,7 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)

	dp->audio_supported = drm_detect_monitor_audio(edid);

	dp_display_handle_test_edid(dp);
	dp->panel->handle_sink_request(dp->panel);

	max_pclk_from_edid = dp->panel->get_max_pclk(dp->panel);

+18 −2
Original line number Diff line number Diff line
@@ -952,7 +952,6 @@ static int dp_link_process_link_training_request(struct dp_link_private *link)
static void dp_link_send_test_response(struct dp_link *dp_link)
{
	struct dp_link_private *link = NULL;
	u32 const test_response_addr = 0x260;
	u32 const response_len = 0x1;

	if (!dp_link) {
@@ -962,7 +961,7 @@ static void dp_link_send_test_response(struct dp_link *dp_link)

	link = container_of(dp_link, struct dp_link_private, dp_link);

	drm_dp_dpcd_write(link->aux->drm_aux, test_response_addr,
	drm_dp_dpcd_write(link->aux->drm_aux, DP_TEST_RESPONSE,
			&dp_link->test_response, response_len);
}

@@ -993,6 +992,22 @@ static int dp_link_psm_config(struct dp_link *dp_link,
	return ret;
}

static void dp_link_send_edid_checksum(struct dp_link *dp_link, u8 checksum)
{
	struct dp_link_private *link = NULL;
	u32 const response_len = 0x1;

	if (!dp_link) {
		pr_err("invalid input\n");
		return;
	}

	link = container_of(dp_link, struct dp_link_private, dp_link);

	drm_dp_dpcd_write(link->aux->drm_aux, DP_TEST_EDID_CHECKSUM,
			&checksum, response_len);
}

static int dp_link_parse_vx_px(struct dp_link_private *link)
{
	u8 bp;
@@ -1513,6 +1528,7 @@ struct dp_link *dp_link_get(struct device *dev, struct dp_aux *aux)
	dp_link->send_psm_request       = dp_link_send_psm_request;
	dp_link->send_test_response     = dp_link_send_test_response;
	dp_link->psm_config             = dp_link_psm_config;
	dp_link->send_edid_checksum     = dp_link_send_edid_checksum;

	return dp_link;
error:
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ struct dp_link {
	void (*send_test_response)(struct dp_link *dp_link);
	int (*psm_config)(struct dp_link *dp_link,
		struct drm_dp_link *link_info, bool enable);
	void (*send_edid_checksum)(struct dp_link *dp_link, u8 checksum);
};

static inline char *dp_link_get_phy_test_pattern(u32 phy_test_pattern_sel)
+20 −0
Original line number Diff line number Diff line
@@ -299,6 +299,25 @@ static int dp_panel_get_modes(struct dp_panel *dp_panel,
	}
}

static void dp_panel_handle_sink_request(struct dp_panel *dp_panel)
{
	struct dp_panel_private *panel;

	if (!dp_panel) {
		pr_err("invalid input\n");
		return;
	}

	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);

	if (panel->link->sink_request & DP_TEST_LINK_EDID_READ) {
		u8 checksum = sde_get_edid_checksum(dp_panel->edid_ctrl);

		panel->link->send_edid_checksum(panel->link, checksum);
		panel->link->send_test_response(panel->link);
	}
}

static int dp_panel_timing_cfg(struct dp_panel *dp_panel)
{
	int rc = 0;
@@ -491,6 +510,7 @@ struct dp_panel *dp_panel_get(struct dp_panel_in *in)
	dp_panel->get_min_req_link_rate = dp_panel_get_min_req_link_rate;
	dp_panel->get_max_pclk = dp_panel_get_max_pclk;
	dp_panel->get_modes = dp_panel_get_modes;
	dp_panel->handle_sink_request = dp_panel_handle_sink_request;

	return dp_panel;
error:
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ struct dp_panel {
	u32 (*get_max_pclk)(struct dp_panel *dp_panel);
	int (*get_modes)(struct dp_panel *dp_panel,
		struct drm_connector *connector, struct dp_display_mode *mode);
	void (*handle_sink_request)(struct dp_panel *dp_panel);
};

/**