[Mesa-dev] [PATCH] i965: Actually use the user timeout in glClientWaitSync.

Matt Turner mattst88 at gmail.com
Tue May 7 23:44:57 PDT 2013


On Tue, May 7, 2013 at 10:42 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> From: Ben Widawsky <ben at bwidawsk.net>
>
> Use the new libdrm functionality to actually do timed waits on the sync
> object.
>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/intel/intel_syncobj.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
> I've been keeping this patch around for ages, waiting for an application that
> actually benefited from the timeout working.  I still haven't found one, but
> it's probably past time to land it anyway.
>
> No piglit changes on Ivybridge.
>
> diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c
> index e965896..9657d9a 100644
> --- a/src/mesa/drivers/dri/intel/intel_syncobj.c
> +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c
> @@ -80,20 +80,12 @@ intel_fence_sync(struct gl_context *ctx, struct gl_sync_object *s,
>     intel_flush(ctx);
>  }
>
> -/* We ignore the user-supplied timeout.  This is weaselly -- we're allowed to
> - * round to an implementation-dependent accuracy, and right now our
> - * implementation "rounds" to the wait-forever value.
> - *
> - * The fix would be a new kernel function to do the GTT transition with a
> - * timeout.
> - */
>  static void intel_client_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
>                                  GLbitfield flags, GLuint64 timeout)
>  {
>     struct intel_sync_object *sync = (struct intel_sync_object *)s;
>
> -   if (sync->bo) {
> -      drm_intel_bo_wait_rendering(sync->bo);
> +   if (sync->bo && drm_intel_gem_bo_wait(sync->bo, timeout) == 0) {
>        s->StatusFlag = 1;
>        drm_intel_bo_unreference(sync->bo);
>        sync->bo = NULL;
> --
> 1.8.2.1

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list