[PATCH] i915: Add support for drm syncobjs
Jason Ekstrand
jason at jlekstrand.net
Thu Aug 3 18:50:25 UTC 2017
On Thu, Aug 3, 2017 at 11:15 AM, Chris Wilson <chris at chris-wilson.co.uk>
wrote:
> Quoting Jason Ekstrand (2017-08-03 19:06:02)
> > I'm not concerned about what happens to racy clients. They get what
> they get.
> > What concerns me is what happens if somehow the fence is replaced and
> deleted
> > before i915_gem_request_await_dma_fence takes it's reference. Can this
> cause
> > the kernel to segfault?
>
> Gotcha, yup nothing prevents that.
>
> fence = dma_fence_get_rcu_safe(&syncobj->fence);
> if (!fence)
> return -EINVAL;
>
> err = await_fence();
> dma_fence_put(fence);
> if (err < 0)
> return;
>
> Happy?
>
Assuming dma_fence_get_rcu_safe does what I think it does, then yes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170803/a82a35e8/attachment.html>
More information about the dri-devel
mailing list