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

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

Merge changes Iedccae91,I19e0fc8d,I8780bfc5,I532af6ee,I002d039f into dev/msm-4.14-display

* changes:
  drm/msm/dp: handle DisplayPort ON/OFF during PM suspend/resume
  drm/msm/dp: limit the maximum lane count for multi-functional dongles
  drm/msm/dp: cancel attention work on disconnect
  drm/msm/dp: enable aux retry logic
  drm/msm/dp: check for sink count before enabling post_open callback
parents 23268651 38be1681
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *drm_aux,
	}

	ret = dp_aux_cmd_fifo_tx(aux, msg);
	if ((ret < 0) && aux->native && !atomic_read(&aux->aborted)) {
	if ((ret < 0) && !atomic_read(&aux->aborted)) {
		aux->retry_cnt++;
		if (!(aux->retry_cnt % retry_count))
			aux->catalog->update_aux_cfg(aux->catalog,
+15 −8
Original line number Diff line number Diff line
@@ -549,8 +549,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
@@ -684,6 +683,8 @@ static int dp_display_usbpd_configure_cb(struct device *dev)
			goto end;
	}

	atomic_set(&dp->aborted, 0);

	dp_display_host_init(dp);

	/* check for hpd high and framework ready */
@@ -768,6 +769,7 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)

	/* wait for idle state */
	cancel_delayed_work(&dp->connect_work);
	cancel_work(&dp->attention_work);
	flush_workqueue(dp->wq);

	dp_display_handle_disconnect(dp);
@@ -775,7 +777,6 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)
	if (!dp->debug->sim_mode)
		dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE);

	atomic_set(&dp->aborted, 0);
end:
	return rc;
}
@@ -918,6 +919,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev)

		/* wait for idle state */
		cancel_delayed_work(&dp->connect_work);
		cancel_work(&dp->attention_work);
		flush_workqueue(dp->wq);

		dp_display_handle_disconnect(dp);
@@ -933,7 +935,7 @@ static void dp_display_connect_work(struct work_struct *work)
	struct dp_display_private *dp = container_of(dw,
			struct dp_display_private, connect_work);

	if (dp->dp_display.is_connected) {
	if (dp->dp_display.is_connected && dp_display_framework_ready(dp)) {
		pr_debug("HPD already on\n");
		return;
	}
@@ -1258,6 +1260,11 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel)

	dp->aux->init(dp->aux, dp->parser->aux_cfg);

	if (dp->debug->psm_enabled) {
		dp->link->psm_config(dp->link, &dp->panel->link_info, false);
		dp->debug->psm_enabled = false;
	}

	rc = dp->ctrl->on(dp->ctrl, dp->mst.mst_active);
	if (!rc)
		dp->power_on = true;
@@ -1374,7 +1381,8 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
			dp->hdcp.ops->off(dp->hdcp.data);
	}

	if (dp->usbpd->hpd_high && dp->usbpd->alt_mode_cfg_done) {
	if (dp->usbpd->hpd_high && !dp_display_is_sink_count_zero(dp) &&
			dp->usbpd->alt_mode_cfg_done) {
		if (dp_panel->audio_supported)
			dp_panel->audio->off(dp_panel->audio);

@@ -1432,10 +1440,9 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
	 * any notification from driver. Initialize post_open callback to notify
	 * DP connection once framework restarts.
	 */
	if (dp->usbpd->hpd_high && dp->usbpd->alt_mode_cfg_done &&
			!dp->mst.mst_active) {
	if (dp->usbpd->hpd_high && !dp_display_is_sink_count_zero(dp) &&
			dp->usbpd->alt_mode_cfg_done && !dp->mst.mst_active) {
		dp_display->post_open = dp_display_post_open;
		dp->dp_display.is_connected = false;
		dp->dp_display.is_sst_connected = false;
	}

+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);