[Mesa-dev] [PATCH] r600g: Use new kernel interface to wait for fences

Simon Farnsworth simon.farnsworth at onelan.co.uk
Wed Feb 1 02:57:23 PST 2012


On Tuesday 31 January 2012, Michel Dänzer <michel at daenzer.net> wrote:
> On Die, 2012-01-31 at 17:02 +0000, Simon Farnsworth wrote: 
> > Instead of busywaiting for the GPU to finish a fence, use the new kernel
> > interface to wait for fence completion.
> > 
> > If the new kernel interface is unavailable, fall back to busywaiting.
> > 
> >  		if (timeout != PIPE_TIMEOUT_INFINITE &&
> >  		    os_time_get() - start_time >= timeout) {
> >  			return FALSE;
> 
> Maybe add something like
> 
> if (rscreen->fences.data[rfence->index])
> return TRUE;
> 
> before the timeout check? Otherwise there may be a false negative if the
> fence signalled just before the timeout.

I'll fix this - I think I'd prefer to use a ternary operator in the return.

> > diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> > index 143dcf9..487fc58 100644
> > --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> > +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> > @@ -892,4 +922,9 @@ void radeon_bomgr_init_functions(struct radeon_drm_winsys *ws)
> >      ws->base.buffer_from_handle = radeon_winsys_bo_from_handle;
> >      ws->base.buffer_get_handle = radeon_winsys_bo_get_handle;
> >      ws->base.buffer_get_virtual_address = radeon_winsys_bo_va;
> > +    if (ws->info.drm_major > 2 ||
> > +        (ws->info.drm_major == 2 && ws->info.drm_minor >= 15))
> > +        ws->base.buffer_wait_fence = radeon_winsys_bo_wait_fence;
> > +    else
> > +        ws->base.buffer_wait_fence = radeon_winsys_bo_wait_fence_nokernel;
> >  }
>
> We have no idea what kind of API a hypothetical major version > 2 might
> have, so I think it's better to only check for (ws->info.drm_minor >=
> 15) here.
>
I'll make that change as well and respin.
-- 
Simon Farnsworth
Software Engineer
ONELAN Limited
http://www.onelan.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120201/beb00b8a/attachment.pgp>


More information about the mesa-dev mailing list