All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any
@ 2017-02-17 18:35 Chris Wilson
  2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2017-02-17 18:35 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Daniel Vetter, Christian König, Sumit Semwal

Indicate that the fence array will be signaled on the first completion
(signal-on-any mode) as opposed to waiting for all to be signaled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Christian König" <christian.koenig@amd.com>
---
 drivers/dma-buf/dma-fence-array.c | 3 +++
 include/linux/dma-fence-array.h   | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c
index 67eb7c8fb88c..8c48402a2daa 100644
--- a/drivers/dma-buf/dma-fence-array.c
+++ b/drivers/dma-buf/dma-fence-array.c
@@ -137,6 +137,9 @@ struct dma_fence_array *dma_fence_array_create(int num_fences,
 	dma_fence_init(&array->base, &dma_fence_array_ops, &array->lock,
 		       context, seqno);
 
+	if (num_fences > 1 && signal_on_any)
+		__set_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags);
+
 	array->num_fences = num_fences;
 	atomic_set(&array->num_pending, signal_on_any ? 1 : num_fences);
 	array->fences = fences;
diff --git a/include/linux/dma-fence-array.h b/include/linux/dma-fence-array.h
index 5900945f962d..4270d33d05b3 100644
--- a/include/linux/dma-fence-array.h
+++ b/include/linux/dma-fence-array.h
@@ -49,6 +49,10 @@ struct dma_fence_array {
 	struct dma_fence **fences;
 };
 
+enum {
+	DMA_FENCE_ARRAY_SIGNAL_ANY = DMA_FENCE_FLAG_USER_BITS,
+};
+
 extern const struct dma_fence_ops dma_fence_array_ops;
 
 /**
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array
  2017-02-17 18:35 [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Chris Wilson
@ 2017-02-17 18:35 ` Chris Wilson
  2017-02-20 11:32   ` Joonas Lahtinen
  2017-02-17 21:22 ` ✓ Fi.CI.BAT: success for series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any Patchwork
  2017-02-18  7:41 ` [PATCH 1/2] " Christian König
  2 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2017-02-17 18:35 UTC (permalink / raw)
  To: intel-gfx, dri-devel

The code currently assumes that all fence arrays it sees are the normal
signal-on-all variety, and decomposes the array into its individual
fences so that it can extract the native i915 fences. If the fence array
is using signal-on-any, we should not decompose as we must not wait on
them all, just the first in *that* set.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_request.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 2f6cfa47dc61..2ab96c35cc5e 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -696,7 +696,8 @@ i915_gem_request_await_dma_fence(struct drm_i915_gem_request *req,
 	if (dma_fence_is_i915(fence))
 		return i915_gem_request_await_request(req, to_request(fence));
 
-	if (!dma_fence_is_array(fence)) {
+	if (!dma_fence_is_array(fence) ||
+	    test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &fence->flags)) {
 		ret = i915_sw_fence_await_dma_fence(&req->submit,
 						    fence, I915_FENCE_TIMEOUT,
 						    GFP_KERNEL);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any
  2017-02-17 18:35 [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Chris Wilson
  2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
@ 2017-02-17 21:22 ` Patchwork
  2017-02-18  7:41 ` [PATCH 1/2] " Christian König
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-02-17 21:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any
URL   : https://patchwork.freedesktop.org/series/19865/
State : success

== Summary ==

Series 19865v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/19865/revisions/1/mbox/

fi-bdw-5557u     total:252  pass:241  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:252  pass:213  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:252  pass:233  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:83   pass:70   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:252  pass:225  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:252  pass:221  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:252  pass:236  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:252  pass:202  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:252  pass:234  dwarn:0   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:252  pass:235  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:252  pass:230  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:252  pass:242  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:252  pass:224  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:252  pass:223  dwarn:0   dfail:0   fail:0   skip:29 

02022d17a5787709617b7897de3906970e2b0721 drm-tip: 2017y-02m-17d-15h-15m-45s UTC integration manifest
e97cc1a drm/i915: Avoid decomposing a signal-on-any fence-array
15dffc7 dma-fence: Flag when a fence-array is using signal-on-any

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3890/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any
  2017-02-17 18:35 [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Chris Wilson
  2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
  2017-02-17 21:22 ` ✓ Fi.CI.BAT: success for series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any Patchwork
@ 2017-02-18  7:41 ` Christian König
  2 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2017-02-18  7:41 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx, dri-devel; +Cc: Daniel Vetter

Am 17.02.2017 um 19:35 schrieb Chris Wilson:
> Indicate that the fence array will be signaled on the first completion
> (signal-on-any mode) as opposed to waiting for all to be signaled.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Gustavo Padovan <gustavo@padovan.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: "Christian König" <christian.koenig@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/dma-buf/dma-fence-array.c | 3 +++
>   include/linux/dma-fence-array.h   | 4 ++++
>   2 files changed, 7 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c
> index 67eb7c8fb88c..8c48402a2daa 100644
> --- a/drivers/dma-buf/dma-fence-array.c
> +++ b/drivers/dma-buf/dma-fence-array.c
> @@ -137,6 +137,9 @@ struct dma_fence_array *dma_fence_array_create(int num_fences,
>   	dma_fence_init(&array->base, &dma_fence_array_ops, &array->lock,
>   		       context, seqno);
>   
> +	if (num_fences > 1 && signal_on_any)
> +		__set_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags);
> +
>   	array->num_fences = num_fences;
>   	atomic_set(&array->num_pending, signal_on_any ? 1 : num_fences);
>   	array->fences = fences;
> diff --git a/include/linux/dma-fence-array.h b/include/linux/dma-fence-array.h
> index 5900945f962d..4270d33d05b3 100644
> --- a/include/linux/dma-fence-array.h
> +++ b/include/linux/dma-fence-array.h
> @@ -49,6 +49,10 @@ struct dma_fence_array {
>   	struct dma_fence **fences;
>   };
>   
> +enum {
> +	DMA_FENCE_ARRAY_SIGNAL_ANY = DMA_FENCE_FLAG_USER_BITS,
> +};
> +
>   extern const struct dma_fence_ops dma_fence_array_ops;
>   
>   /**


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

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

* Re: [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array
  2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
@ 2017-02-20 11:32   ` Joonas Lahtinen
  2017-02-20 12:03     ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Joonas Lahtinen @ 2017-02-20 11:32 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx, dri-devel

On pe, 2017-02-17 at 18:35 +0000, Chris Wilson wrote:
> The code currently assumes that all fence arrays it sees are the normal
> signal-on-all variety, and decomposes the array into its individual
> fences so that it can extract the native i915 fences. If the fence array
> is using signal-on-any, we should not decompose as we must not wait on
> them all, just the first in *that* set.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

<SNIP>

> 
> @@ -696,7 +696,8 @@ i915_gem_request_await_dma_fence(struct drm_i915_gem_request *req,
>  	if (dma_fence_is_i915(fence))
>  		return i915_gem_request_await_request(req, to_request(fence));
>  
> -	if (!dma_fence_is_array(fence)) {
> +	if (!dma_fence_is_array(fence) ||
> +	    test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &fence->flags)) {

Smells like a helper function? While that helper is finding the way
upstream;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array
  2017-02-20 11:32   ` Joonas Lahtinen
@ 2017-02-20 12:03     ` Chris Wilson
  2017-02-20 12:12       ` [Intel-gfx] " Maarten Lankhorst
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Wilson @ 2017-02-20 12:03 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: intel-gfx, dri-devel

On Mon, Feb 20, 2017 at 01:32:42PM +0200, Joonas Lahtinen wrote:
> On pe, 2017-02-17 at 18:35 +0000, Chris Wilson wrote:
> > The code currently assumes that all fence arrays it sees are the normal
> > signal-on-all variety, and decomposes the array into its individual
> > fences so that it can extract the native i915 fences. If the fence array
> > is using signal-on-any, we should not decompose as we must not wait on
> > them all, just the first in *that* set.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> <SNIP>
> 
> > 
> > @@ -696,7 +696,8 @@ i915_gem_request_await_dma_fence(struct drm_i915_gem_request *req,
> >  	if (dma_fence_is_i915(fence))
> >  		return i915_gem_request_await_request(req, to_request(fence));
> >  
> > -	if (!dma_fence_is_array(fence)) {
> > +	if (!dma_fence_is_array(fence) ||
> > +	    test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &fence->flags)) {
> 
> Smells like a helper function? While that helper is finding the way
> upstream;

Blurgh.

enum dma_fence_array_signal_mode {
        DMA_FENCE_ARRAY_SIGNAL_ON_ALL = 0,
        DMA_FENCE_ARRAY_SIGNAL_ON_ANY,
};

enum dma_fence_array_signal_mode
dma_fence_array_get_signaling_mode(struct dma_fence_array *array)
{       
        return test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags) ?
                DMA_FENCE_ARRAY_SIGNAL_ON_ANY : DMA_FENCE_ARRAY_SIGNAL_ON_ALL;
}

if (!dma_fence_is_array(fence) ||
    dma_fence_array_get_signaling_mode(to_dma_fence_array(fence)) == DMA_FENCE_ARRAY_SIGNAL_ON_ANY)

Hmm. Not happy with that yet.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array
  2017-02-20 12:03     ` Chris Wilson
@ 2017-02-20 12:12       ` Maarten Lankhorst
  2017-02-21  8:53         ` Joonas Lahtinen
  0 siblings, 1 reply; 8+ messages in thread
From: Maarten Lankhorst @ 2017-02-20 12:12 UTC (permalink / raw)
  To: Chris Wilson, Joonas Lahtinen, intel-gfx, dri-devel, Tvrtko Ursulin

Op 20-02-17 om 13:03 schreef Chris Wilson:
> On Mon, Feb 20, 2017 at 01:32:42PM +0200, Joonas Lahtinen wrote:
>> On pe, 2017-02-17 at 18:35 +0000, Chris Wilson wrote:
>>> The code currently assumes that all fence arrays it sees are the normal
>>> signal-on-all variety, and decomposes the array into its individual
>>> fences so that it can extract the native i915 fences. If the fence array
>>> is using signal-on-any, we should not decompose as we must not wait on
>>> them all, just the first in *that* set.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> <SNIP>
>>
>>> @@ -696,7 +696,8 @@ i915_gem_request_await_dma_fence(struct drm_i915_gem_request *req,
>>>  	if (dma_fence_is_i915(fence))
>>>  		return i915_gem_request_await_request(req, to_request(fence));
>>>  
>>> -	if (!dma_fence_is_array(fence)) {
>>> +	if (!dma_fence_is_array(fence) ||
>>> +	    test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &fence->flags)) {
>> Smells like a helper function? While that helper is finding the way
>> upstream;
> Blurgh.
>
> enum dma_fence_array_signal_mode {
>         DMA_FENCE_ARRAY_SIGNAL_ON_ALL = 0,
>         DMA_FENCE_ARRAY_SIGNAL_ON_ANY,
> };
>
> enum dma_fence_array_signal_mode
> dma_fence_array_get_signaling_mode(struct dma_fence_array *array)
> {       
>         return test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags) ?
>                 DMA_FENCE_ARRAY_SIGNAL_ON_ANY : DMA_FENCE_ARRAY_SIGNAL_ON_ALL;
> }
>
> if (!dma_fence_is_array(fence) ||
>     dma_fence_array_get_signaling_mode(to_dma_fence_array(fence)) == DMA_FENCE_ARRAY_SIGNAL_ON_ANY)
>
> Hmm. Not happy with that yet.
> -Chris
>
bool dma_fence_array_signal_on_any with a WARN_ON(!dma_fence_is_array(fence))?

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

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

* Re: [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array
  2017-02-20 12:12       ` [Intel-gfx] " Maarten Lankhorst
@ 2017-02-21  8:53         ` Joonas Lahtinen
  0 siblings, 0 replies; 8+ messages in thread
From: Joonas Lahtinen @ 2017-02-21  8:53 UTC (permalink / raw)
  To: Maarten Lankhorst, Chris Wilson, intel-gfx, dri-devel, Tvrtko Ursulin

On ma, 2017-02-20 at 13:12 +0100, Maarten Lankhorst wrote:
> Op 20-02-17 om 13:03 schreef Chris Wilson:
> > 
> > On Mon, Feb 20, 2017 at 01:32:42PM +0200, Joonas Lahtinen wrote:
> > > 
> > > Smells like a helper function? While that helper is finding the way
> > > upstream;
> > Blurgh.
> > 
> > enum dma_fence_array_signal_mode {
> >         DMA_FENCE_ARRAY_SIGNAL_ON_ALL = 0,
> >         DMA_FENCE_ARRAY_SIGNAL_ON_ANY,
> > };
> > 
> > enum dma_fence_array_signal_mode
> > dma_fence_array_get_signaling_mode(struct dma_fence_array *array)
> > {       
> >         return test_bit(DMA_FENCE_ARRAY_SIGNAL_ANY, &array->base.flags) ?
> >                 DMA_FENCE_ARRAY_SIGNAL_ON_ANY : DMA_FENCE_ARRAY_SIGNAL_ON_ALL;
> > }
> > 
> > if (!dma_fence_is_array(fence) ||
> >     dma_fence_array_get_signaling_mode(to_dma_fence_array(fence)) == DMA_FENCE_ARRAY_SIGNAL_ON_ANY)
> > 
> > Hmm. Not happy with that yet.
> > -Chris
> > 
> bool dma_fence_array_signal_on_any with a WARN_ON(!dma_fence_is_array(fence))?

I was also thinking along these lines.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-02-21  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 18:35 [PATCH 1/2] dma-fence: Flag when a fence-array is using signal-on-any Chris Wilson
2017-02-17 18:35 ` [PATCH 2/2] drm/i915: Avoid decomposing a signal-on-any fence-array Chris Wilson
2017-02-20 11:32   ` Joonas Lahtinen
2017-02-20 12:03     ` Chris Wilson
2017-02-20 12:12       ` [Intel-gfx] " Maarten Lankhorst
2017-02-21  8:53         ` Joonas Lahtinen
2017-02-17 21:22 ` ✓ Fi.CI.BAT: success for series starting with [1/2] dma-fence: Flag when a fence-array is using signal-on-any Patchwork
2017-02-18  7:41 ` [PATCH 1/2] " Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.