Re: [PATCH 24/43] drm/i915/bdw: GEN-specific logical ring emit batchbuffer start

Daniel Vetter
2014-08-11T21:11:58Z

On Mon, Aug 11, 2014 at 11:09:39PM +0200, Daniel Vetter wrote:
> On Thu, Jul 24, 2014 at 05:04:32PM +0100, Thomas Daniel wrote:
> > From: Oscar Mateo <oscar.mateo@intel.com>
> >
> > Dispatch_execbuffer's evil twin.
> >
> > Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_lrc.c | 28 ++++++++++++++++++++++++++++
> > drivers/gpu/drm/i915/intel_ringbuffer.h | 2 ++
> > 2 files changed, 30 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index a6dcb3a..55ee8dd 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -384,6 +384,29 @@ static int gen8_init_render_ring(struct intel_engine_cs *ring)
> > return ret;
> > }
> >
> > +static int gen8_emit_bb_start(struct intel_ringbuffer *ringbuf,
> > + u64 offset, unsigned flags)
> > +{
> > + struct intel_engine_cs *ring = ringbuf->ring;
> > + struct drm_i915_private *dev_priv = ring->dev->dev_private;
> > + bool ppgtt = dev_priv->mm.aliasing_ppgtt != NULL &&
>
> The aliasing ppgtt check here is fairly decent bullocks, especially since
> full ppgtt is a requirement for execlists. I've ditched it since a series
> from myself will otherwise break this patch.
> -Daniel
>
> > + !(flags & I915_DISPATCH_SECURE);
> > + int ret;
> > +
> > + ret = intel_logical_ring_begin(ringbuf, 4);
> > + if (ret)
> > + return ret;
> > +
> > + /* FIXME(BDW): Address space and security selectors. */
> > + intel_logical_ring_emit(ringbuf, MI_BATCH_BUFFER_START_GEN8 | (ppgtt<<8));

Also please follow up with a patch to replace the magic 8 here with a
proper define. Usual approach is to build this up with an u32 cmd_flags or
so. Patch should obviously also rectify the legacy ring stuff.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch