Reviewed-by: Marek Olšák <marek.ol...@amd.com> Marek
On Fri, Apr 1, 2016 at 10:29 PM, Rob Clark <robdcl...@gmail.com> wrote: > From: Rob Clark <robcl...@freedesktop.org> > > This will be needed for explicit synchronization with devices outside > the gpu, ie. EGL_ANDROID_native_fence_sync. > > Signed-off-by: Rob Clark <robcl...@freedesktop.org> > --- > src/gallium/include/pipe/p_context.h | 6 ++++++ > src/gallium/state_trackers/dri/dri2.c | 6 +++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/include/pipe/p_context.h > b/src/gallium/include/pipe/p_context.h > index 02a946b..d617ec4 100644 > --- a/src/gallium/include/pipe/p_context.h > +++ b/src/gallium/include/pipe/p_context.h > @@ -481,6 +481,12 @@ struct pipe_context { > uint64_t timeout); > > /** > + * Insert commands to have GPU wait for fence to be signaled. > + */ > + void (*fence_server_sync)(struct pipe_context *pipe, > + struct pipe_fence_handle *fence); > + > + /** > * Create a view on a texture to be used by a shader stage. > */ > struct pipe_sampler_view * (*create_sampler_view)(struct pipe_context > *ctx, > diff --git a/src/gallium/state_trackers/dri/dri2.c > b/src/gallium/state_trackers/dri/dri2.c > index b66d885..6c8bb37 100644 > --- a/src/gallium/state_trackers/dri/dri2.c > +++ b/src/gallium/state_trackers/dri/dri2.c > @@ -1413,7 +1413,11 @@ dri2_client_wait_sync(__DRIcontext *_ctx, void > *_fence, unsigned flags, > static void > dri2_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags) > { > - /* AFAIK, no driver currently supports parallel context execution. */ > + struct pipe_context *ctx = dri_context(_ctx)->st->pipe; > + struct dri2_fence *fence = (struct dri2_fence*)_fence; > + > + if (ctx->fence_server_sync) > + ctx->fence_server_sync(ctx, fence->pipe_fence); > } > > static __DRI2fenceExtension dri2FenceExtension = { > -- > 2.5.5 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev