dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v4 4/5] drm/msm: clean up display thread
Date: Fri, 14 Dec 2018 09:44:55 -0500	[thread overview]
Message-ID: <20181214144455.GO154160@art_vandelay> (raw)
In-Reply-To: <1544150504-19630-4-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

On Thu, Dec 06, 2018 at 06:41:43PM -0800, Jeykumar Sankaran wrote:
> 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
> 
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/msm_drv.c | 35 +----------------------------------
>  drivers/gpu/drm/msm/msm_drv.h |  1 -
>  2 files changed, 1 insertion(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 37740b8..1e9fec1 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -286,13 +286,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;
> @@ -545,27 +540,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);
> -

I'm getting the following compilation errors with this patch applied to dpu-staging/for-next:

../drivers/gpu/drm/msm/msm_drv.c: In function ‘msm_drm_init’:
../drivers/gpu/drm/msm/msm_drv.c:569:15: error: ‘struct msm_drm_private’ has no member named ‘disp_thread’; did you mean ‘event_thread’?
   if ((!priv->disp_thread[i].thread) ||
               ^~~~~~~~~~~
               event_thread
../drivers/gpu/drm/msm/msm_drv.c:573:15: error: ‘struct msm_drm_private’ has no member named ‘disp_thread’; did you mean ‘event_thread’?
     if (priv->disp_thread[i].thread) {
               ^~~~~~~~~~~
               event_thread
../drivers/gpu/drm/msm/msm_drv.c:575:13: error: ‘struct msm_drm_private’ has no member named ‘disp_thread’; did you mean ‘event_thread’?
       priv->disp_thread[i].thread);
             ^~~~~~~~~~~
             event_thread
../drivers/gpu/drm/msm/msm_drv.c:576:12: error: ‘struct msm_drm_private’ has no member named ‘disp_thread’; did you mean ‘event_thread’?
      priv->disp_thread[i].thread = NULL;
            ^~~~~~~~~~~
            event_thread


I think you also need:

@@ -598,16 +566,9 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
                        priv->event_thread[i].thread = NULL;
                }
 
-               if ((!priv->disp_thread[i].thread) ||
-                               !priv->event_thread[i].thread) {
+               if (!priv->event_thread[i].thread) {
                        /* clean up previously created threads if any */
                        for ( ; i >= 0; i--) {
-                               if (priv->disp_thread[i].thread) {
-                                       kthread_stop(
-                                               priv->disp_thread[i].thread);
-                                       priv->disp_thread[i].thread = NULL;
-                               }
-
                                if (priv->event_thread[i].thread) {
                                        kthread_stop(
                                                priv->event_thread[i].thread);



>  		/* initialize event thread */
>  		priv->event_thread[i].crtc_id = priv->crtcs[i]->base.id;
>  		kthread_init_worker(&priv->event_thread[i].worker);
> @@ -580,13 +554,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)
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index 0298fa7..0307543 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -197,7 +197,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;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-12-14 14:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07  2:41 [PATCH v4 1/5] drm/msm/dpu: use kthread_destroy_worker to release msm workers Jeykumar Sankaran
2018-12-07  2:41 ` [PATCH v4 2/5] drm/msm/dpu: use msm wq for vblank events Jeykumar Sankaran
     [not found] ` <1544150504-19630-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-07  2:41   ` [PATCH v4 3/5] drm/msm/dpu: use msm wq for idle power collapse Jeykumar Sankaran
2018-12-07  2:41   ` [PATCH v4 4/5] drm/msm: clean up display thread Jeykumar Sankaran
     [not found]     ` <1544150504-19630-4-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-12-14 14:44       ` Sean Paul [this message]
2018-12-07  2:41   ` [PATCH v4 5/5] drm/msm: subclass work object for vblank events Jeykumar Sankaran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181214144455.GO154160@art_vandelay \
    --to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox