dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kevin1.Wang-5C7GfCeVMHo@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/4] drm/ttm: cleanup ttm_buffer_object_transfer
Date: Fri, 15 Nov 2019 17:27:34 -0500	[thread overview]
Message-ID: <6cc373fe-150d-02e3-cbea-21d5e4564c71@amd.com> (raw)
In-Reply-To: <20191111145832.37320-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>

The subject doesn't match the change. This changes ttm_bo_cleanup_refs, 
not ttm_buffer_object_transfer.

On 2019-11-11 9:58 a.m., Christian König wrote:
> The function is always called with deleted BOs.
>
> While at it cleanup the indentation as well.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 7e7925fecd9e..1178980f4147 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -527,14 +527,9 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
>   			       bool interruptible, bool no_wait_gpu,
>   			       bool unlock_resv)
>   {
> -	struct dma_resv *resv;
> +	struct dma_resv *resv = &bo->base._resv;
>   	int ret;
>   
> -	if (unlikely(list_empty(&bo->ddestroy)))

Would it make sense to add a BUG_ON or WARN_ON here to check the 
assumption made by this code?

Regards,
   Felix

> -		resv = bo->base.resv;
> -	else
> -		resv = &bo->base._resv;
> -
>   	if (dma_resv_test_signaled_rcu(resv, true))
>   		ret = 0;
>   	else
> @@ -547,9 +542,8 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
>   			dma_resv_unlock(bo->base.resv);
>   		spin_unlock(&ttm_bo_glob.lru_lock);
>   
> -		lret = dma_resv_wait_timeout_rcu(resv, true,
> -							   interruptible,
> -							   30 * HZ);
> +		lret = dma_resv_wait_timeout_rcu(resv, true, interruptible,
> +						 30 * HZ);
>   
>   		if (lret < 0)
>   			return lret;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Felix Kuehling <felix.kuehling@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	Kevin1.Wang@amd.com, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/ttm: cleanup ttm_buffer_object_transfer
Date: Fri, 15 Nov 2019 17:27:34 -0500	[thread overview]
Message-ID: <6cc373fe-150d-02e3-cbea-21d5e4564c71@amd.com> (raw)
Message-ID: <20191115222734.blV2IuFfKRYjOW85QGrMb-r-1oueWEmJwIAix22Av3s@z> (raw)
In-Reply-To: <20191111145832.37320-2-christian.koenig@amd.com>

The subject doesn't match the change. This changes ttm_bo_cleanup_refs, 
not ttm_buffer_object_transfer.

On 2019-11-11 9:58 a.m., Christian König wrote:
> The function is always called with deleted BOs.
>
> While at it cleanup the indentation as well.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 7e7925fecd9e..1178980f4147 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -527,14 +527,9 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
>   			       bool interruptible, bool no_wait_gpu,
>   			       bool unlock_resv)
>   {
> -	struct dma_resv *resv;
> +	struct dma_resv *resv = &bo->base._resv;
>   	int ret;
>   
> -	if (unlikely(list_empty(&bo->ddestroy)))

Would it make sense to add a BUG_ON or WARN_ON here to check the 
assumption made by this code?

Regards,
   Felix

> -		resv = bo->base.resv;
> -	else
> -		resv = &bo->base._resv;
> -
>   	if (dma_resv_test_signaled_rcu(resv, true))
>   		ret = 0;
>   	else
> @@ -547,9 +542,8 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo,
>   			dma_resv_unlock(bo->base.resv);
>   		spin_unlock(&ttm_bo_glob.lru_lock);
>   
> -		lret = dma_resv_wait_timeout_rcu(resv, true,
> -							   interruptible,
> -							   30 * HZ);
> +		lret = dma_resv_wait_timeout_rcu(resv, true, interruptible,
> +						 30 * HZ);
>   
>   		if (lret < 0)
>   			return lret;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-11-15 22:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 14:58 [PATCH 1/4] drm/ttm: refine ghost BO resv criteria Christian König
2019-11-11 14:58 ` Christian König
     [not found] ` <20191111145832.37320-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-11-11 14:58   ` [PATCH 2/4] drm/ttm: cleanup ttm_buffer_object_transfer Christian König
2019-11-11 14:58     ` Christian König
     [not found]     ` <20191111145832.37320-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-11-15 22:27       ` Felix Kuehling [this message]
2019-11-15 22:27         ` Felix Kuehling
2019-11-11 14:58   ` [PATCH 3/4] drm/ttm: rework BO delayed delete Christian König
2019-11-11 14:58     ` Christian König
     [not found]     ` <20191111145832.37320-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-11-15 22:47       ` Felix Kuehling
2019-11-15 22:47         ` Felix Kuehling
2019-11-12 10:25   ` [PATCH 1/4] drm/ttm: refine ghost BO resv criteria Daniel Vetter
2019-11-12 10:25     ` Daniel Vetter
2019-11-11 14:58 ` [PATCH 4/4] drm/ttm: replace dma_resv object on deleted BOs Christian König

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=6cc373fe-150d-02e3-cbea-21d5e4564c71@amd.com \
    --to=felix.kuehling-5c7gfcevmho@public.gmane.org \
    --cc=Kevin1.Wang-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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;
as well as URLs for NNTP newsgroup(s).