[Intel-gfx] [PATCH v2 19/29] drm/i915: Add functions to emit register offsets to the ring

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Nov 5 04:05:25 PST 2015


On Thu, Nov 05, 2015 at 12:01:51PM +0000, Chris Wilson wrote:
> On Thu, Nov 05, 2015 at 01:44:08PM +0200, Ville Syrjälä wrote:
> > On Thu, Nov 05, 2015 at 11:03:38AM +0000, Chris Wilson wrote:
> > > On Wed, Nov 04, 2015 at 11:20:07PM +0200, ville.syrjala at linux.intel.com wrote:
> > > > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > > > 
> > > > When register type safety happens, we can't just try to emit the
> > > > register itself to the ring. Instead we'll need to extract the
> > > > offset from it first. Add some convenience functions that will do
> > > > that.
> > > > 
> > > > v2: Convert MOCS setup too
> > > > 
> > > > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > > 
> > > The only insane thing about this patch is the stupid ring emission API.
> > 
> > One extra idea just popped to my mind. Should I maybe make the
> > emit_reg() take the value too and emit both the reg offset and value?
> > They always come in pairs after all.
> 
> Uncertain. I think no. You need to do LRI and SRM separately (so that we
> don't get confused between the register value to load and the memory
> address to write to). But the more important factor for me, is that I
> don't want to hide the individual calls to emit() - as they need to be
> easily reviewed and checked against the count given to ring_begin().

Indeed, that's a good reason for keeping it separate.

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list