[Intel-gfx] [PATCH] drm/i915: Emit to ringbuffer directly

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 8 13:58:57 UTC 2017


On Wed, Feb 08, 2017 at 01:36:53PM +0000, Chris Wilson wrote:
> On Wed, Feb 08, 2017 at 01:10:56PM +0000, Tvrtko Ursulin wrote:
> > @@ -2288,32 +2264,33 @@ int intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
> >  		ring->space -= remain_actual;
> >  	}
> >  
> > +	out = (u32 *)(ring->vaddr + ring->tail);
> 
> Checkpatch will complain about unaligned brackets, but I'll whine that
> this cast is unnecessary.
> 
> > -static inline void intel_ring_advance(struct intel_ring *ring)
> > +static inline void
> > +intel_ring_advance(struct drm_i915_gem_request *req, u32 *out)
> >  {
> > +	struct intel_ring *ring = req->ring;
> >  	/* Dummy function.
> >  	 *
> >  	 * This serves as a placeholder in the code so that the reader
> > @@ -519,7 +510,7 @@ static inline void intel_ring_advance(struct intel_ring *ring)
> >  	 * reserved for the command packet (i.e. the value passed to
> >  	 * intel_ring_begin()).
> >  	 */
> > -	GEM_BUG_ONLY_ON(ring->tail != ring->advance);
> > +	GEM_BUG_ON((ring->vaddr + ring->tail) != out);
> 
> This will generate a warning for an unused var if !GEM_DEBUG, just use
> 	GEM_BUG_ON(req->ring->vaddr + req->ring->tail != out);
> it'll fit, the compiler will do CSE and it's only for debug...
> 
> The transformation looked good. I'd suggest we do a trybot with
> i915.mmio_flip=0 to force the MI_DISPLAY_FLIP paths to be exercised and
> aside from gen2/3 that should be all intel_ring_begin() covered.

Oh, that forgets that atomic took over and we can't run the CS flips
anymore.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list