[PATCH] dma-buf/fence-array: enable_signaling from wq

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 3 23:56:14 UTC 2016


On Thu, Nov 03, 2016 at 07:34:02PM -0400, Rob Clark wrote:
> On Thu, Nov 3, 2016 at 5:41 PM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > static bool dma_fence_array_enable_signaling(struct dma_fence *fence)
> > {
> >         struct dma_fence_array *array = to_dma_fence_array(fence);
> >         int num_pending = atomic_read(&array->num_pending);
> >         int i;
> >
> >         for (i = 0; i < array->num_fences; i++)
> >                 if (is_signaled(array->fences[i]) && !--num_pending) {
> >                         atomic_set(&array->num_pending, 0);
> >                         return false;
> >                 }
> >
> >         dma_fence_get(&array->base);
> >         queue_work(system_unbound_wq, &array->enable_signaling_worker);
> > }
> 
> hmm, I guess just to try to avoid the wq?

Yeah, not all fences are capable of reporting the current status, and
some others may only report signaled() after enable_signaling, but for
i915/nouveau even msm can report the current status without the extra
step. For those it seems worth skipping the wq.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list