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

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 4 11:34:11 UTC 2016


On Thu, Aug 04, 2016 at 02:17:22PM +0300, Joonas Lahtinen wrote:
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2465,9 +2465,8 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> >  		return false;
> >  	}
> >  
> > -	obj->tiling_mode = plane_config->tiling;
> > -	if (obj->tiling_mode == I915_TILING_X)
> > -		obj->stride = fb->pitches[0];
> > +	if (plane_config->tiling == I915_TILING_X)
> > +		obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X;
> 
> This is not equivalent code.

Setting tiling mode and not stride is illegal, as is setting stride for
I915_TILING_NONE. Initial tiling_and_stride here is 0 (from object
allocation), so the result is the same.

What did I miss?

> >  	} else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) {
> > @@ -14919,15 +14918,15 @@ static int intel_framebuffer_init(struct drm_device *dev,
> >  	if (mode_cmd->flags & DRM_MODE_FB_MODIFIERS) {
> >  		/* Enforce that fb modifier and tiling mode match, but only for
> >  		 * X-tiled. This is needed for FBC. */
> > -		if (!!(obj->tiling_mode == I915_TILING_X) !=
> > +		if (!!(i915_gem_object_get_tiling(obj) == I915_TILING_X) !=
> 
> A note, !! are redundant as == returns bool already. Could remove while
> touching.

Petition Daniel, maybe we can now have I915_TILING_Y support here as
well so the API is not intentionally left incomplete. Grr.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list