[Intel-gfx] [PATCH 1/6] drm/i915: Pass around gen to tile_height to special case gen2

Chris Wilson chris at chris-wilson.co.uk
Sat Jan 21 10:30:55 UTC 2017


On Fri, Jan 20, 2017 at 02:29:38PM +0200, Joonas Lahtinen wrote:
> On to, 2017-01-19 at 19:26 +0000, Chris Wilson wrote:
> > gen2 has a different tiling pattern, and a fixed tile_height. Pass
> > along the gen so that we the computed tile_row is large enough to align
> > with gen2 fences.
> > 
> > Reported-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> 
> <SNIP>
> 
> >  static inline unsigned int
> > -i915_gem_object_get_tile_height(struct drm_i915_gem_object *obj)
> > +i915_gem_object_get_tile_height(struct drm_i915_gem_object *obj, int gen)
> >  {
> > -	return i915_gem_tile_height(i915_gem_object_get_tiling(obj));
> > +	return i915_gem_tile_height(gen, i915_gem_object_get_tiling(obj));
> >  }
> >  
> >  static inline unsigned int
> > -i915_gem_object_get_tile_row_size(struct drm_i915_gem_object *obj)
> > +i915_gem_object_get_tile_row_size(struct drm_i915_gem_object *obj, int gen)
> >  {
> >  	return (i915_gem_object_get_stride(obj) *
> > -		i915_gem_object_get_tile_height(obj));
> > +		i915_gem_object_get_tile_height(obj, gen));
> >  }
> 
> Compiler not smart enough to optimize these two if you grab it from obj
> with INTEL_GEN? Anyway;

It's the curse of the headers. :(
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list