[Intel-gfx] [PATCH 1/8] drm/i915: Synchronize pread/pwrite with wait_rendering

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 2 15:14:12 CEST 2013


On Mon, Sep 02, 2013 at 08:32:24AM +0200, Daniel Vetter wrote:
> On Fri, Aug 30, 2013 at 08:39:46PM -0700, Ben Widawsky wrote:
> > On Sat, Aug 31, 2013 at 12:50:30AM +0100, Chris Wilson wrote:
> > > On Fri, Aug 30, 2013 at 04:43:54PM -0700, Ben Widawsky wrote:
> > > > lifted from Daniel:
> > > > pread/pwrite isn't about the object's domain at all, but purely about
> > > > synchronizing for outstanding rendering. Replacing the call to
> > > > set_to_gtt_domain with a wait_rendering would imo improve code
> > > > readability. Furthermore we could pimp pread to only block for
> > > > outstanding writes and not for reads.
> > > > 
> > > > Since you're not the first one to trip over this: Can I volunteer you
> > > > for a follow-up patch to fix this?
> > > > 
> > > > Recommended-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > > > Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> > > 
> > > This should fail i-g-t...
> > > -Chris
> > > 
> > 
> > Daniel, how have I failed your plan?
> 
> It should work ... Since the enclosing if-block checks for !cpu domain
> (for either reads or writes) that implies that going into the gtt domain
> is a noop (or better should be) wrt clflushing and we only wait for
> outstanding gpu rendering. wait_rendering is an interface that's been
> added afterwards. Unfortunately I've failed to explain this trickery in
> either a comment or the commit message. Bad me ;-)

The issue is that in the patch pwrite is not waiting for any outstanding
GPU reads.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list