On Tuesday 31 January 2012, Michel Dänzer <mic...@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/
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev