On Tuesday, September 27, 2016 11:51:20 PM PDT Chad Versace wrote: > Cacheing the signal status complicates the code for questionable > performance benefit. I added the cacheing long ago, and I now think it > was the wrong decision. > > When we later add support for fences based on sync fds (that is, a fd > backed by struct sync_file in Linux 4.8), the cacheing becomes even more > hairy. So it's best to eliminate it now. > --- > src/mesa/drivers/dri/i965/intel_syncobj.c | 27 ++------------------------- > 1 file changed, 2 insertions(+), 25 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/intel_syncobj.c > b/src/mesa/drivers/dri/i965/intel_syncobj.c > index 4276f3f..ba8d3d0 100644 > --- a/src/mesa/drivers/dri/i965/intel_syncobj.c > +++ b/src/mesa/drivers/dri/i965/intel_syncobj.c > @@ -47,9 +47,7 @@ struct brw_fence { > struct brw_context *brw; > /** The fence waits for completion of this batch. */ > drm_intel_bo *batch_bo; > - > mtx_t mutex; > - bool signalled; > }; > > struct intel_gl_sync_object { > @@ -78,7 +76,6 @@ static void > brw_fence_insert(struct brw_context *brw, struct brw_fence *fence) > { > assert(!fence->batch_bo); > - assert(!fence->signalled); > > brw_emit_mi_flush(brw); > fence->batch_bo = brw->batch.bo; > @@ -89,17 +86,7 @@ brw_fence_insert(struct brw_context *brw, struct brw_fence > *fence) > static bool > brw_fence_has_completed_locked(struct brw_fence *fence) > { > - if (fence->signalled) > - return true; > - > - if (fence->batch_bo && !drm_intel_bo_busy(fence->batch_bo)) { > - drm_intel_bo_unreference(fence->batch_bo); > - fence->batch_bo = NULL; > - fence->signalled = true; > - return true; > - } > - > - return false; > + return !drm_intel_bo_busy(fence->batch_bo); > }
Aside from making it faster to answer repeated "is it done yet?" queries (which I agree is of dubious value)...this also makes it possible to release batch_bo earlier. Now you have to keep it around until the fence object is destroyed. That seems less than ideal?
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev