dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/drm_syncobj: Dead code removal
@ 2019-10-04 12:16 Zbigniew Kempczyński
  2019-10-04 12:20 ` Chris Wilson
  2019-10-04 12:25 ` Lionel Landwerlin
  0 siblings, 2 replies; 4+ messages in thread
From: Zbigniew Kempczyński @ 2019-10-04 12:16 UTC (permalink / raw)
  To: dri-devel; +Cc: Zbigniew Kempczyński, Jason Ekstrand

Remove dead code, likely overseened during review process.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Chunming Zhou <david1.zhou@amd.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jason Ekstrand <jason@jlekstrand.net>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 4b5c7b0ed714..21a22e39c9fa 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
 	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
 		dma_fence_put(fence);
 		list_add_tail(&wait->node, &syncobj->cb_list);
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
 	} else {
 		wait->fence = fence;
 	}
@@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
 	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
 		dma_fence_put(fence);
 		return;
-	} else if (!fence) {
-		wait->fence = dma_fence_get_stub();
 	} else {
 		wait->fence = fence;
 	}
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_syncobj: Dead code removal
  2019-10-04 12:16 [PATCH] drm/drm_syncobj: Dead code removal Zbigniew Kempczyński
@ 2019-10-04 12:20 ` Chris Wilson
  2019-10-04 12:25 ` Lionel Landwerlin
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2019-10-04 12:20 UTC (permalink / raw)
  To: dri-devel; +Cc: Zbigniew Kempczyński, Jason Ekstrand

Quoting Zbigniew Kempczyński (2019-10-04 13:16:52)
> Remove dead code, likely overseened during review process.

Hint: It's not dead.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_syncobj: Dead code removal
  2019-10-04 12:16 [PATCH] drm/drm_syncobj: Dead code removal Zbigniew Kempczyński
  2019-10-04 12:20 ` Chris Wilson
@ 2019-10-04 12:25 ` Lionel Landwerlin
  2019-10-09 16:10   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Lionel Landwerlin @ 2019-10-04 12:25 UTC (permalink / raw)
  To: Zbigniew Kempczyński, dri-devel; +Cc: Jason Ekstrand

On 04/10/2019 15:16, Zbigniew Kempczyński wrote:
> Remove dead code, likely overseened during review process.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Chunming Zhou <david1.zhou@amd.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> ---
>   drivers/gpu/drm/drm_syncobj.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index 4b5c7b0ed714..21a22e39c9fa 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
>   	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
>   		dma_fence_put(fence);
>   		list_add_tail(&wait->node, &syncobj->cb_list);
> -	} else if (!fence) {
> -		wait->fence = dma_fence_get_stub();
>   	} else {
>   		wait->fence = fence;
>   	}
> @@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
>   	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
>   		dma_fence_put(fence);
>   		return;
> -	} else if (!fence) {
> -		wait->fence = dma_fence_get_stub();
>   	} else {
>   		wait->fence = fence;
>   	}

Like Chris said, dma_fence_chain_find_seqno() will update the fence 
pointer, so a subsequent check might not be dealing with the same value.

A bit cheeky, but...


-Lionel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/drm_syncobj: Dead code removal
  2019-10-04 12:25 ` Lionel Landwerlin
@ 2019-10-09 16:10   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2019-10-09 16:10 UTC (permalink / raw)
  To: Lionel Landwerlin; +Cc: Zbigniew Kempczyński, Jason Ekstrand, dri-devel

On Fri, Oct 04, 2019 at 03:25:00PM +0300, Lionel Landwerlin wrote:
> On 04/10/2019 15:16, Zbigniew Kempczyński wrote:
> > Remove dead code, likely overseened during review process.
> > 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > Cc: Chunming Zhou <david1.zhou@amd.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > ---
> >   drivers/gpu/drm/drm_syncobj.c | 4 ----
> >   1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> > index 4b5c7b0ed714..21a22e39c9fa 100644
> > --- a/drivers/gpu/drm/drm_syncobj.c
> > +++ b/drivers/gpu/drm/drm_syncobj.c
> > @@ -192,8 +192,6 @@ static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj,
> >   	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
> >   		dma_fence_put(fence);
> >   		list_add_tail(&wait->node, &syncobj->cb_list);
> > -	} else if (!fence) {
> > -		wait->fence = dma_fence_get_stub();
> >   	} else {
> >   		wait->fence = fence;
> >   	}
> > @@ -856,8 +854,6 @@ static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
> >   	if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) {
> >   		dma_fence_put(fence);
> >   		return;
> > -	} else if (!fence) {
> > -		wait->fence = dma_fence_get_stub();
> >   	} else {
> >   		wait->fence = fence;
> >   	}
> 
> Like Chris said, dma_fence_chain_find_seqno() will update the fence pointer,
> so a subsequent check might not be dealing with the same value.
> 
> A bit cheeky, but...

Feels like warrants a comment, I missed this one too. Maybe even extract
it into one common function since it's the same code in both places?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-09 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-04 12:16 [PATCH] drm/drm_syncobj: Dead code removal Zbigniew Kempczyński
2019-10-04 12:20 ` Chris Wilson
2019-10-04 12:25 ` Lionel Landwerlin
2019-10-09 16:10   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox