[Intel-gfx] [PATCH 15/16] drm/i915: Repack fence tiling mode and stride into a single integer

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Thu Aug 4 12:02:17 UTC 2016


On to, 2016-08-04 at 12:41 +0100, Chris Wilson wrote:
> On Thu, Aug 04, 2016 at 02:17:22PM +0300, Joonas Lahtinen wrote:
> > 
> > On ma, 2016-08-01 at 19:22 +0100, Chris Wilson wrote:
> > > 
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -2215,13 +2215,10 @@ struct drm_i915_gem_object {
> > >  
> > >  	atomic_t frontbuffer_bits;
> > >  
> > > -	/**
> > > -	 * Current tiling mode for the object.
> > > -	 */
> > > -	unsigned int tiling_mode;
> > > -
> > >  	/** Current tiling stride for the object, if it's tiled. */
> > > -	uint32_t stride;
> > > +	unsigned int tiling_and_stride;
> > > +#define TILING_MASK 0x3
> > No magics and add appropriate BUILD_BUG_ON too when stuffing bits
> > inside same variable.
> > 
> > #define TILING_MASK (BIT(31 - __builtin_clz(I915_TILING_LAST)) -1)
> #define FENCE_MINIMUM_STRIDE 128
> #define TILING_MASK (FENCE_MINIMUM_STRIDE-1)
> #define STRIDE_MASK ~TILING_MASK
> 
> Presumably you can't complain about the hw being full of magic numbers?

I can live with that, just stuff the BUILD_BUG_ON in there too and
it's;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

> -Chris
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list