Loading drivers/gpu/drm/msm/dp/dp_display.c +14 −24 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ struct dp_display_private { struct workqueue_struct *wq; struct delayed_work hdcp_cb_work; struct delayed_work connect_work; struct work_struct connect_work; struct work_struct attention_work; struct mutex hdcp_mutex; struct mutex session_lock; Loading Loading @@ -456,7 +456,7 @@ static void dp_display_post_open(struct dp_display *dp_display) /* if cable is already connected, send notification */ if (dp->usbpd->hpd_high) queue_delayed_work(dp->wq, &dp->connect_work, HZ * 10); queue_work(dp->wq, &dp->connect_work); else dp_display->post_open = NULL; } Loading @@ -464,15 +464,12 @@ static void dp_display_post_open(struct dp_display *dp_display) static int dp_display_send_hpd_notification(struct dp_display_private *dp, bool hpd) { u32 timeout_sec; int ret = 0; dp->dp_display.is_connected = hpd; if (dp_display_framework_ready(dp)) timeout_sec = 5; else timeout_sec = 10; if (!dp_display_framework_ready(dp)) return ret; dp->aux->state |= DP_STATE_NOTIFICATION_SENT; Loading @@ -480,7 +477,7 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp, dp_display_send_hpd_event(dp); if (!wait_for_completion_timeout(&dp->notification_comp, HZ * timeout_sec)) { HZ * 5)) { pr_warn("%s timeout\n", hpd ? "connect" : "disconnect"); ret = -EINVAL; } Loading Loading @@ -614,9 +611,9 @@ static int dp_display_usbpd_configure_cb(struct device *dev) dp_display_host_init(dp); /* check for hpd high and framework ready */ if (dp->usbpd->hpd_high && dp_display_framework_ready(dp)) queue_delayed_work(dp->wq, &dp->connect_work, 0); /* check for hpd high */ if (dp->usbpd->hpd_high) queue_work(dp->wq, &dp->connect_work); end: return rc; } Loading Loading @@ -695,7 +692,7 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) dp->aux->abort(dp->aux); /* wait for idle state */ cancel_delayed_work(&dp->connect_work); cancel_work(&dp->connect_work); cancel_work(&dp->attention_work); flush_workqueue(dp->wq); Loading Loading @@ -737,7 +734,7 @@ static void dp_display_attention_work(struct work_struct *work) return; } queue_delayed_work(dp->wq, &dp->connect_work, 0); queue_work(dp->wq, &dp->connect_work); return; } Loading Loading @@ -783,18 +780,12 @@ static int dp_display_usbpd_attention_cb(struct device *dev) return -ENODEV; } /* check if framework is ready */ if (!dp_display_framework_ready(dp)) { pr_err("framework not ready\n"); return -ENODEV; } if (dp->usbpd->hpd_irq && dp->usbpd->hpd_high && dp->power_on) { dp->link->process_request(dp->link); queue_work(dp->wq, &dp->attention_work); } else if (dp->usbpd->hpd_high) { queue_delayed_work(dp->wq, &dp->connect_work, 0); queue_work(dp->wq, &dp->connect_work); } else { /* cancel any pending request */ atomic_set(&dp->aborted, 1); Loading @@ -802,7 +793,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) dp->aux->abort(dp->aux); /* wait for idle state */ cancel_delayed_work(&dp->connect_work); cancel_work(&dp->connect_work); cancel_work(&dp->attention_work); flush_workqueue(dp->wq); Loading @@ -815,8 +806,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) static void dp_display_connect_work(struct work_struct *work) { struct delayed_work *dw = to_delayed_work(work); struct dp_display_private *dp = container_of(dw, struct dp_display_private *dp = container_of(work, struct dp_display_private, connect_work); if (dp->dp_display.is_connected && dp_display_framework_ready(dp)) { Loading Loading @@ -1376,7 +1366,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->connect_work, dp_display_connect_work); INIT_WORK(&dp->connect_work, dp_display_connect_work); INIT_WORK(&dp->attention_work, dp_display_attention_work); return 0; Loading Loading
drivers/gpu/drm/msm/dp/dp_display.c +14 −24 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ struct dp_display_private { struct workqueue_struct *wq; struct delayed_work hdcp_cb_work; struct delayed_work connect_work; struct work_struct connect_work; struct work_struct attention_work; struct mutex hdcp_mutex; struct mutex session_lock; Loading Loading @@ -456,7 +456,7 @@ static void dp_display_post_open(struct dp_display *dp_display) /* if cable is already connected, send notification */ if (dp->usbpd->hpd_high) queue_delayed_work(dp->wq, &dp->connect_work, HZ * 10); queue_work(dp->wq, &dp->connect_work); else dp_display->post_open = NULL; } Loading @@ -464,15 +464,12 @@ static void dp_display_post_open(struct dp_display *dp_display) static int dp_display_send_hpd_notification(struct dp_display_private *dp, bool hpd) { u32 timeout_sec; int ret = 0; dp->dp_display.is_connected = hpd; if (dp_display_framework_ready(dp)) timeout_sec = 5; else timeout_sec = 10; if (!dp_display_framework_ready(dp)) return ret; dp->aux->state |= DP_STATE_NOTIFICATION_SENT; Loading @@ -480,7 +477,7 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp, dp_display_send_hpd_event(dp); if (!wait_for_completion_timeout(&dp->notification_comp, HZ * timeout_sec)) { HZ * 5)) { pr_warn("%s timeout\n", hpd ? "connect" : "disconnect"); ret = -EINVAL; } Loading Loading @@ -614,9 +611,9 @@ static int dp_display_usbpd_configure_cb(struct device *dev) dp_display_host_init(dp); /* check for hpd high and framework ready */ if (dp->usbpd->hpd_high && dp_display_framework_ready(dp)) queue_delayed_work(dp->wq, &dp->connect_work, 0); /* check for hpd high */ if (dp->usbpd->hpd_high) queue_work(dp->wq, &dp->connect_work); end: return rc; } Loading Loading @@ -695,7 +692,7 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev) dp->aux->abort(dp->aux); /* wait for idle state */ cancel_delayed_work(&dp->connect_work); cancel_work(&dp->connect_work); cancel_work(&dp->attention_work); flush_workqueue(dp->wq); Loading Loading @@ -737,7 +734,7 @@ static void dp_display_attention_work(struct work_struct *work) return; } queue_delayed_work(dp->wq, &dp->connect_work, 0); queue_work(dp->wq, &dp->connect_work); return; } Loading Loading @@ -783,18 +780,12 @@ static int dp_display_usbpd_attention_cb(struct device *dev) return -ENODEV; } /* check if framework is ready */ if (!dp_display_framework_ready(dp)) { pr_err("framework not ready\n"); return -ENODEV; } if (dp->usbpd->hpd_irq && dp->usbpd->hpd_high && dp->power_on) { dp->link->process_request(dp->link); queue_work(dp->wq, &dp->attention_work); } else if (dp->usbpd->hpd_high) { queue_delayed_work(dp->wq, &dp->connect_work, 0); queue_work(dp->wq, &dp->connect_work); } else { /* cancel any pending request */ atomic_set(&dp->aborted, 1); Loading @@ -802,7 +793,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) dp->aux->abort(dp->aux); /* wait for idle state */ cancel_delayed_work(&dp->connect_work); cancel_work(&dp->connect_work); cancel_work(&dp->attention_work); flush_workqueue(dp->wq); Loading @@ -815,8 +806,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) static void dp_display_connect_work(struct work_struct *work) { struct delayed_work *dw = to_delayed_work(work); struct dp_display_private *dp = container_of(dw, struct dp_display_private *dp = container_of(work, struct dp_display_private, connect_work); if (dp->dp_display.is_connected && dp_display_framework_ready(dp)) { Loading Loading @@ -1376,7 +1366,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->connect_work, dp_display_connect_work); INIT_WORK(&dp->connect_work, dp_display_connect_work); INIT_WORK(&dp->attention_work, dp_display_attention_work); return 0; Loading