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

Commit ca651d72 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru
Browse files

drm/msm/dp: remove delayed_workqueue for DP connect_work



With the new Display framework approach, the connector status
is checked on boot-up/framework reboot and hotplug notification
is not needed. Avoid deferral of connect_work till framework
comes up and skip hotplug notification.

Change-Id: I637550e3dc3bb146ba2d6b9d4fdd70f01061b41e
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent 7851ced5
Loading
Loading
Loading
Loading
+15 −20
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ struct dp_display_private {


	struct workqueue_struct *wq;
	struct workqueue_struct *wq;
	struct delayed_work hdcp_cb_work;
	struct delayed_work hdcp_cb_work;
	struct delayed_work connect_work;
	struct work_struct connect_work;
	struct work_struct attention_work;
	struct work_struct attention_work;
	struct mutex session_lock;
	struct mutex session_lock;


@@ -532,22 +532,16 @@ static void dp_display_post_open(struct dp_display *dp_display)


	/* if cable is already connected, send notification */
	/* if cable is already connected, send notification */
	if (dp->hpd->hpd_high)
	if (dp->hpd->hpd_high)
		queue_delayed_work(dp->wq, &dp->connect_work, HZ * 10);
		queue_work(dp->wq, &dp->connect_work);
	else
	else
		dp_display->post_open = NULL;
		dp_display->post_open = NULL;
}
}


static int dp_display_send_hpd_notification(struct dp_display_private *dp)
static int dp_display_send_hpd_notification(struct dp_display_private *dp)
{
{
	u32 timeout_sec;
	int ret = 0;
	int ret = 0;
	bool hpd = dp->is_connected;
	bool hpd = dp->is_connected;


	if (dp_display_framework_ready(dp))
		timeout_sec = 5;
	else
		timeout_sec = 10;

	dp->aux->state |= DP_STATE_NOTIFICATION_SENT;
	dp->aux->state |= DP_STATE_NOTIFICATION_SENT;


	if (!dp->mst.mst_active)
	if (!dp->mst.mst_active)
@@ -562,8 +556,11 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp)
	if (!dp->mst.mst_active && (dp->power_on == hpd))
	if (!dp->mst.mst_active && (dp->power_on == hpd))
		goto skip_wait;
		goto skip_wait;


	if (!dp_display_framework_ready(dp))
		goto skip_wait;

	if (!wait_for_completion_timeout(&dp->notification_comp,
	if (!wait_for_completion_timeout(&dp->notification_comp,
						HZ * timeout_sec)) {
						HZ * 5)) {
		pr_warn("%s timeout\n", hpd ? "connect" : "disconnect");
		pr_warn("%s timeout\n", hpd ? "connect" : "disconnect");
		ret = -EINVAL;
		ret = -EINVAL;
	}
	}
@@ -780,9 +777,9 @@ static int dp_display_usbpd_configure_cb(struct device *dev)


	dp_display_host_init(dp);
	dp_display_host_init(dp);


	/* check for hpd high and framework ready */
	/* check for hpd high */
	if (dp->hpd->hpd_high && dp_display_framework_ready(dp))
	if (dp->hpd->hpd_high)
		queue_delayed_work(dp->wq, &dp->connect_work, 0);
		queue_work(dp->wq, &dp->connect_work);
end:
end:
	return rc;
	return rc;
}
}
@@ -873,7 +870,7 @@ static void dp_display_disconnect_sync(struct dp_display_private *dp)
	dp->aux->abort(dp->aux);
	dp->aux->abort(dp->aux);


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


@@ -969,8 +966,7 @@ static void dp_display_attention_work(struct work_struct *work)
			dp_display_handle_disconnect(dp);
			dp_display_handle_disconnect(dp);
		} else {
		} else {
			if (!dp->mst.mst_active)
			if (!dp->mst.mst_active)
				queue_delayed_work(dp->wq,
				queue_work(dp->wq, &dp->connect_work);
					&dp->connect_work, 0);
		}
		}


		goto mst_attention;
		goto mst_attention;
@@ -980,7 +976,7 @@ static void dp_display_attention_work(struct work_struct *work)
		dp_display_handle_disconnect(dp);
		dp_display_handle_disconnect(dp);


		dp->panel->video_test = true;
		dp->panel->video_test = true;
		queue_delayed_work(dp->wq, &dp->connect_work, 0);
		queue_work(dp->wq, &dp->connect_work);


		goto mst_attention;
		goto mst_attention;
	}
	}
@@ -1030,7 +1026,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev)
			dp->debug->mst_hpd_sim)
			dp->debug->mst_hpd_sim)
		queue_work(dp->wq, &dp->attention_work);
		queue_work(dp->wq, &dp->attention_work);
	else if (!dp->power_on)
	else if (!dp->power_on)
		queue_delayed_work(dp->wq, &dp->connect_work, 0);
		queue_work(dp->wq, &dp->connect_work);
	else
	else
		pr_debug("ignored\n");
		pr_debug("ignored\n");


@@ -1040,8 +1036,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev)
static void dp_display_connect_work(struct work_struct *work)
static void dp_display_connect_work(struct work_struct *work)
{
{
	int rc = 0;
	int rc = 0;
	struct delayed_work *dw = to_delayed_work(work);
	struct dp_display_private *dp = container_of(work,
	struct dp_display_private *dp = container_of(dw,
			struct dp_display_private, connect_work);
			struct dp_display_private, connect_work);


	if (atomic_read(&dp->aborted)) {
	if (atomic_read(&dp->aborted)) {
@@ -1901,7 +1896,7 @@ static int dp_display_create_workqueue(struct dp_display_private *dp)
	}
	}


	INIT_DELAYED_WORK(&dp->hdcp_cb_work, dp_display_hdcp_cb_work);
	INIT_DELAYED_WORK(&dp->hdcp_cb_work, dp_display_hdcp_cb_work);
	INIT_DELAYED_WORK(&dp->connect_work, dp_display_connect_work);
	INIT_WORK(&dp->connect_work, dp_display_connect_work);
	INIT_WORK(&dp->attention_work, dp_display_attention_work);
	INIT_WORK(&dp->attention_work, dp_display_attention_work);


	return 0;
	return 0;