Re: [PATCH 2/2] drm/i915/fbdev: Setup for using FBC tracking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 24, 2016 at 01:05:18PM +0200, Daniel Vetter wrote:
> On Wed, Aug 24, 2016 at 08:39:52AM +0100, Chris Wilson wrote:
> > When FBC is enabled, access through the fbdev is tracked using
> > ORIGIN_GTT, i.e. native hw tracking by FBC. This requires the
> > framebuffer to be fenced, which requires us to allocate the object
> > as X-tiled.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_fbdev.c | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > index 8d6bfa565b50..ad3995f87485 100644
> > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > @@ -138,14 +138,17 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
> >  
> >  	mode_cmd.pitches[0] = ALIGN(mode_cmd.width *
> >  				    DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
> > +	if (i915.enable_fbc)
> > +		mode_cmd.pitches[0] = ALIGN(mode_cmd.pitches[0], 512);
> > +
> >  	mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
> >  							  sizes->surface_depth);
> >  
> > -	mutex_lock(&dev->struct_mutex);
> > -
> >  	size = mode_cmd.pitches[0] * mode_cmd.height;
> >  	size = PAGE_ALIGN(size);
> >  
> > +	mutex_lock(&dev->struct_mutex);
> > +
> >  	/* If the FB is too big, just don't use it since fbdev is not very
> >  	 * important and we should probably use that space with FBC or other
> >  	 * features. */
> > @@ -159,6 +162,12 @@ static int intelfb_alloc(struct drm_fb_helper *helper,
> >  		goto out;
> >  	}
> >  
> > +	if (i915.enable_fbc) {
> > +		obj->tiling_and_stride = mode_cmd.pitches[0] | I915_TILING_X;
> > +		mode_cmd.modifier[0] = I915_FORMAT_MOD_X_TILED;
> > +		mode_cmd.flags |= DRM_MODE_FB_MODIFIERS;
> > +	}
> 
> Even more magic set-tiling calls, now also depending upon module options.
> This sounds like a rather bad idea to me.

FB_MODIFIERS are pretty magic, I know!

This was more of if you want to use fbdev + fbc, this is what we should
do. Note that this is not so much a module option, but fbc state. At
this point in fbdev's lifecycle, we should be able to use HAS_FBC()
which is equivalent to i915.enable_fbc once we've sanitized the options.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux