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

Commit d213c826 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Tatenda Chipeperekwa
Browse files

drm/msm/dp: limit the maximum lane count for multi-functional dongles



Some dongles which support multi-function return the lane count support
in DPCD to 4. But the link training fails for such dongles since all the
lanes do not support DisplayPort functionality. Limit the maximum lane
count for such dongles to 2.

Change-Id: I19e0fc8d914b4a1f1bedb680772b8f10a38240b1
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 84f716c9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -544,8 +544,7 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)
		return 0;

	rc = dp->panel->read_sink_caps(dp->panel,
			dp->dp_display.base_connector);

			dp->dp_display.base_connector, dp->usbpd->multi_func);
	if (rc) {
		/*
		 * ETIMEDOUT --> cable may have been removed
+7 −3
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ static void dp_panel_config_tr_unit(struct dp_panel *dp_panel)
	catalog->update_transfer_unit(catalog);
}

static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
static int dp_panel_read_dpcd(struct dp_panel *dp_panel, bool multi_func)
{
	int rlen, rc = 0;
	struct dp_panel_private *panel;
@@ -734,6 +734,10 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
	link_info->num_lanes = dp_panel->dpcd[DP_MAX_LANE_COUNT] &
				DP_MAX_LANE_COUNT_MASK;

	if (multi_func)
		link_info->num_lanes = min_t(unsigned int,
			link_info->num_lanes, 2);

	pr_debug("lane_count=%d\n", link_info->num_lanes);

	if (drm_dp_enhanced_frame_cap(dpcd))
@@ -857,7 +861,7 @@ static int dp_panel_read_edid(struct dp_panel *dp_panel,
}

static int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
	struct drm_connector *connector)
	struct drm_connector *connector, bool multi_func)
{
	int rc = 0, rlen, count, downstream_ports;
	const int count_len = 1;
@@ -871,7 +875,7 @@ static int dp_panel_read_sink_caps(struct dp_panel *dp_panel,

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

	rc = dp_panel_read_dpcd(dp_panel);
	rc = dp_panel_read_dpcd(dp_panel, multi_func);
	if (rc || !is_link_rate_valid(drm_dp_link_rate_to_bw_code(
		dp_panel->link_info.rate)) || !is_lane_count_valid(
		dp_panel->link_info.num_lanes) ||
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ struct dp_panel {
	int (*deinit)(struct dp_panel *dp_panel);
	int (*hw_cfg)(struct dp_panel *dp_panel);
	int (*read_sink_caps)(struct dp_panel *dp_panel,
		struct drm_connector *connector);
		struct drm_connector *connector, bool multi_func);
	u32 (*get_min_req_link_rate)(struct dp_panel *dp_panel);
	u32 (*get_mode_bpp)(struct dp_panel *dp_panel, u32 mode_max_bpp,
			u32 mode_pclk_khz);