dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Mikko Perttunen <mperttunen@nvidia.com>
Subject: Re: [PATCH 4/7] gpu: host1x: Drop unnecessary host1x argument
Date: Fri, 18 May 2018 16:39:11 +0300	[thread overview]
Message-ID: <435aee37-842e-8791-ee38-cad1d8a61fcb@gmail.com> (raw)
In-Reply-To: <20180517153430.9602-5-thierry.reding@gmail.com>

On 17.05.2018 18:34, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Functions taking a pointer to a host1x syncpoint as an argument don't
> need to specify a pointer to a host1x instance because it can be
> obtained from the syncpoint.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/host1x/hw/channel_hw.c |  2 +-
>  drivers/gpu/host1x/intr.c          | 14 ++++++--------
>  drivers/gpu/host1x/intr.h          |  8 +++++---
>  drivers/gpu/host1x/syncpt.c        |  2 +-
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
> index 4c9555038a95..d188f9068b91 100644
> --- a/drivers/gpu/host1x/hw/channel_hw.c
> +++ b/drivers/gpu/host1x/hw/channel_hw.c
> @@ -164,7 +164,7 @@ static int channel_submit(struct host1x_job *job)
>  	trace_host1x_channel_submitted(dev_name(ch->dev), prev_max, syncval);
>  
>  	/* schedule a submit complete interrupt */
> -	err = host1x_intr_add_action(host, job->syncpt_id, syncval,
> +	err = host1x_intr_add_action(host, sp, syncval,
>  				     HOST1X_INTR_ACTION_SUBMIT_COMPLETE, ch,
>  				     completed_waiter, NULL);
>  	completed_waiter = NULL;
> diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c
> index 6028cf7b681f..9629c009d10f 100644
> --- a/drivers/gpu/host1x/intr.c
> +++ b/drivers/gpu/host1x/intr.c
> @@ -211,11 +211,11 @@ static void syncpt_thresh_work(struct work_struct *work)
>  				host1x_syncpt_load(host->syncpt + id));
>  }
>  
> -int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
> -			   enum host1x_intr_action action, void *data,
> -			   struct host1x_waitlist *waiter, void **ref)
> +int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
> +			   u32 thresh, enum host1x_intr_action action,
> +			   void *data, struct host1x_waitlist *waiter,
> +			   void **ref)
>  {
> -	struct host1x_syncpt *syncpt;
>  	int queue_was_empty;
>  
>  	if (waiter == NULL) {
> @@ -234,19 +234,17 @@ int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
>  	waiter->data = data;
>  	waiter->count = 1;
>  
> -	syncpt = host->syncpt + id;
> -
>  	spin_lock(&syncpt->intr.lock);
>  
>  	queue_was_empty = list_empty(&syncpt->intr.wait_head);
>  
>  	if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) {
>  		/* added at head of list - new threshold value */
> -		host1x_hw_intr_set_syncpt_threshold(host, id, thresh);
> +		host1x_hw_intr_set_syncpt_threshold(host, syncpt->id, thresh);
>  
>  		/* added as first waiter - enable interrupt */
>  		if (queue_was_empty)
> -			host1x_hw_intr_enable_syncpt_intr(host, id);
> +			host1x_hw_intr_enable_syncpt_intr(host, syncpt->id);
>  	}
>  
>  	spin_unlock(&syncpt->intr.lock);
> diff --git a/drivers/gpu/host1x/intr.h b/drivers/gpu/host1x/intr.h
> index 1370c2bb75b8..6db96af484fe 100644
> --- a/drivers/gpu/host1x/intr.h
> +++ b/drivers/gpu/host1x/intr.h
> @@ -22,6 +22,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/workqueue.h>
>  
> +struct host1x_syncpt;
>  struct host1x;
>  
>  enum host1x_intr_action {
> @@ -75,9 +76,10 @@ struct host1x_waitlist {
>   *
>   * This is a non-blocking api.
>   */
> -int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
> -	enum host1x_intr_action action, void *data,
> -	struct host1x_waitlist *waiter, void **ref);
> +int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
> +			   u32 thresh, enum host1x_intr_action action,
> +			   void *data, struct host1x_waitlist *waiter,
> +			   void **ref);
>  
>  /*
>   * Unreference an action submitted to host1x_intr_add_action().
> diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
> index 088c05dd884c..a5dbf1ba4645 100644
> --- a/drivers/gpu/host1x/syncpt.c
> +++ b/drivers/gpu/host1x/syncpt.c
> @@ -255,7 +255,7 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
>  	}
>  
>  	/* schedule a wakeup when the syncpoint value is reached */
> -	err = host1x_intr_add_action(sp->host, sp->id, thresh,
> +	err = host1x_intr_add_action(sp->host, sp, thresh,
>  				     HOST1X_INTR_ACTION_WAKEUP_INTERRUPTIBLE,
>  				     &wq, waiter, &ref);
>  	if (err)
> 

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-18 17:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 15:34 [PATCH 0/7] gpu: host1x: Preparation work for destaging ABI Thierry Reding
2018-05-17 15:34 ` [PATCH 1/7] gpu: host1x: Remove wait check support Thierry Reding
2018-05-18 13:07   ` Dmitry Osipenko
2018-05-17 15:34 ` [PATCH 2/7] gpu: host1x: Store pointer to client in jobs Thierry Reding
2018-05-18 17:35   ` Dmitry Osipenko
2018-05-17 15:34 ` [PATCH 3/7] gpu: host1x: Cleanup loop variable usage Thierry Reding
2018-05-18 13:36   ` Dmitry Osipenko
2018-05-17 15:34 ` [PATCH 4/7] gpu: host1x: Drop unnecessary host1x argument Thierry Reding
2018-05-18 13:39   ` Dmitry Osipenko [this message]
2018-05-17 15:34 ` [PATCH 5/7] gpu: host1x: Rename relocarray -> relocs for consistency Thierry Reding
2018-05-18 13:40   ` Dmitry Osipenko
2018-05-17 15:34 ` [PATCH 6/7] gpu: host1x: Use not explicitly sized types Thierry Reding
2018-05-18 13:40   ` Dmitry Osipenko
2018-05-17 15:34 ` [PATCH 7/7] gpu: host1x: Track client version Thierry Reding
2018-05-18 12:21   ` Mikko Perttunen
2018-05-18 12:39     ` Thierry Reding
2018-05-18 12:51       ` Mikko Perttunen
2018-05-18 15:59       ` Dmitry Osipenko

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=435aee37-842e-8791-ee38-cad1d8a61fcb@gmail.com \
    --to=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=thierry.reding@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).