drm/msm: clean up display thread
authorJeykumar Sankaran <jsanka@codeaurora.org>
Fri, 14 Dec 2018 23:57:54 +0000 (15:57 -0800)
committerSean Paul <seanpaul@chromium.org>
Fri, 1 Feb 2019 15:39:58 +0000 (10:39 -0500)
Since there are no clients using these threads,
cleaning it up.

changes in v2:
- switch all the dependent clients to use system wq
  before removing the disp_threads (Sean Paul)
changes in v3:
- none
changes in v4:
- none
changes in v5:
- Rebase on latest tip with [1] (Sean Paul)

[1] https://patchwork.freedesktop.org/patch/255105/

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_drv.h

index 6c311f92c11dfd0b028700d9e5d8778b2b979884..a8a0b246e3a91393f10d6183a85e0433eea21e14 100644 (file)
@@ -287,13 +287,8 @@ static int msm_drm_uninit(struct device *dev)
                kfree(vbl_ev);
        }
 
-       /* clean up display commit/event worker threads */
+       /* clean up event worker threads */
        for (i = 0; i < priv->num_crtcs; i++) {
-               if (priv->disp_thread[i].thread) {
-                       kthread_destroy_worker(&priv->disp_thread[i].worker);
-                       priv->disp_thread[i].thread = NULL;
-               }
-
                if (priv->event_thread[i].thread) {
                        kthread_destroy_worker(&priv->event_thread[i].worker);
                        priv->event_thread[i].thread = NULL;
@@ -551,27 +546,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
         */
        param.sched_priority = 16;
        for (i = 0; i < priv->num_crtcs; i++) {
-
-               /* initialize display thread */
-               priv->disp_thread[i].crtc_id = priv->crtcs[i]->base.id;
-               kthread_init_worker(&priv->disp_thread[i].worker);
-               priv->disp_thread[i].dev = ddev;
-               priv->disp_thread[i].thread =
-                       kthread_run(kthread_worker_fn,
-                               &priv->disp_thread[i].worker,
-                               "crtc_commit:%d", priv->disp_thread[i].crtc_id);
-               if (IS_ERR(priv->disp_thread[i].thread)) {
-                       DRM_DEV_ERROR(dev, "failed to create crtc_commit kthread\n");
-                       priv->disp_thread[i].thread = NULL;
-                       goto err_msm_uninit;
-               }
-
-               ret = sched_setscheduler(priv->disp_thread[i].thread,
-                                        SCHED_FIFO, &param);
-               if (ret)
-                       dev_warn(dev, "disp_thread set priority failed: %d\n",
-                                ret);
-
                /* initialize event thread */
                priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id;
                kthread_init_worker(&priv->event_thread[i].worker);
@@ -586,13 +560,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
                        goto err_msm_uninit;
                }
 
-               /**
-                * event thread should also run at same priority as disp_thread
-                * because it is handling frame_done events. A lower priority
-                * event thread and higher priority disp_thread can causes
-                * frame_pending counters beyond 2. This can lead to commit
-                * failure at crtc commit level.
-                */
                ret = sched_setscheduler(priv->event_thread[i].thread,
                                         SCHED_FIFO, &param);
                if (ret)
index e2689c2e580e9a2912d24cd53475b0f1f24bf93b..06f3aa876483b717ebdc9f37661d09f01a0b8a7b 100644 (file)
@@ -199,7 +199,6 @@ struct msm_drm_private {
        unsigned int num_crtcs;
        struct drm_crtc *crtcs[MAX_CRTCS];
 
-       struct msm_drm_thread disp_thread[MAX_CRTCS];
        struct msm_drm_thread event_thread[MAX_CRTCS];
 
        unsigned int num_encoders;