[Intel-gfx] [PATCH 6/7] drm/i915: fbdev_set_par reliably invalidating frontbuffer

Daniel Vetter daniel at ffwll.ch
Wed Jul 8 02:44:29 PDT 2015


On Tue, Jul 07, 2015 at 04:28:56PM -0700, Rodrigo Vivi wrote:
> fbdev_set_par is called when fbcon is taking over control, but
> frontbuffer was being invalidated only on the first time when
> moving obj to GTT domain.
> However on the following calls write domain was already GTT
> so invalidate was never called again.
> 
> The issue was mainly on boot with plymouth doing a splash screen
> when returning to the console frontbuffer wans't being invalidated
> causing missed screen updates with PSR enabled.
> 
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index 2a1724e..a76cebc 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -50,6 +50,7 @@ static int intel_fbdev_set_par(struct fb_info *info)
>  	struct drm_fb_helper *fb_helper = info->par;
>  	struct intel_fbdev *ifbdev =
>  		container_of(fb_helper, struct intel_fbdev, helper);
> +	struct drm_i915_gem_object *obj = ifbdev->fb->obj;
>  	int ret;
>  
>  	ret = drm_fb_helper_set_par(info);
> @@ -63,8 +64,13 @@ static int intel_fbdev_set_par(struct fb_info *info)
>  		 * now until we solve this for real.
>  		 */
>  		mutex_lock(&fb_helper->dev->struct_mutex);
> -		ret = i915_gem_object_set_to_gtt_domain(ifbdev->fb->obj,
> -							true);
> +		if (obj) {
> +			if (obj->base.write_domain != I915_GEM_DOMAIN_GTT)
> +				ret = i915_gem_object_set_to_gtt_domain(obj,
> +									true);
> +			else
> +				intel_fb_obj_invalidate(obj, ORIGIN_GTT);

Unconditional intel_fb_obj_invalidate is what we need here really. And for
reference maybe mention the commit that fixed this for the set_domain
ioctl:

commit 031b698a77a70a6c394568034437b5486a44e868
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Fri Jun 26 19:35:16 2015 +0200

    drm/i915: Unconditionally do fb tracking invalidate in set_domain

> +		}
>  		mutex_unlock(&fb_helper->dev->struct_mutex);
>  	}
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list