public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 3/7] drm/i915: PSR: dirty fb operation flushsing frontbuffer
Date: Wed, 8 Jul 2015 11:47:29 +0200	[thread overview]
Message-ID: <20150708094729.GM7568@phenom.ffwll.local> (raw)
In-Reply-To: <1436311737-18270-3-git-send-email-rodrigo.vivi@intel.com>

On Tue, Jul 07, 2015 at 04:28:53PM -0700, Rodrigo Vivi wrote:
> Let's do a frontbuffer flush on dirty fb.
> To be used for DIRTYFB drm ioctl.
> 
> This patch solves the biggest PSR known issue, that is
> missed screen updates during boot, mainly when there is a splash
> screen involved like Plymouth.
> 
> Previously PSR was being invalidated by fbdev and Plymounth
> was taking control with PSR yet invalidated and could get screen
> updates normally. However with some atomic modeset changes
> Pymouth modeset over ioctl was now causing frontbuffer flushes
> making PSR gets back to work while it cannot track the
> screen updates and exit properly.
> 
> By adding this flush on dirtyfb we properly track frontbuffer
> writes and properly exit PSR.
> 
> Actually all mmap_wc users should call this dirty callback
> in order to have a proper frontbuffer tracking.
> 
> In the future it can be extended to return 0 if the whole
> screen has being flushed or the number of rects flushed
> as Chris suggested.
> 
> v2: Remove ORIGIN_FB_DIRTY and use ORIGIN_GTT instead since dirty
>     callback is just called after few screen updates and not on
>     everyone as pointed by Daniel.
> 
> v3: Use flush instead of invalidate since flush means
>     invalidate + flush and dirty means drawn had finished and
>     it can be flushed.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3c2425f..9a60d15 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14383,9 +14383,27 @@ static int intel_user_framebuffer_create_handle(struct drm_framebuffer *fb,
>  	return drm_gem_handle_create(file, &obj->base, handle);
>  }
>  
> +static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
> +					       struct drm_file *file,
> +					       unsigned flags, unsigned color,
> +					       struct drm_clip_rect *clips,
> +					       unsigned num_clips)
> +{
> +	struct drm_device *dev = fb->dev;
> +	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
> +	struct drm_i915_gem_object *obj = intel_fb->obj;
> +
> +	mutex_lock(&dev->struct_mutex);
> +	intel_fb_obj_flush(obj, false, ORIGIN_GTT);
> +	mutex_unlock(&dev->struct_mutex);

There's some good discussion going on in some internal thread about what
to do with wc mmaps. The idea is to use the dirty ioctl to flush them, but
at least for fbc we already filter ORIGIN_GTT out, which means fbc won't
see the dirtyfb flushes for cpu wc mmaps. Should we have a ORIGIN_DIRTYFB,
which essentially just means "any kind of cpu frontbuffer rendering"?

Otoh we can make this change when Paulo implements the wc-mmap for
frontbuffers stuff.
-Daniel

> +
> +	return 0;
> +}
> +
>  static const struct drm_framebuffer_funcs intel_fb_funcs = {
>  	.destroy = intel_user_framebuffer_destroy,
>  	.create_handle = intel_user_framebuffer_create_handle,
> +	.dirty = intel_user_framebuffer_dirty,
>  };
>  
>  static
> -- 
> 2.1.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-08  9:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 23:28 [PATCH 1/7] drm/i915: Add origin to frontbuffer tracking flush Rodrigo Vivi
2015-07-07 23:28 ` [PATCH 2/7] drm/i915: PSR: Flush means invalidate + flush Rodrigo Vivi
2015-07-08 13:58   ` Paulo Zanoni
2015-07-08 23:21     ` [PATCH] " Rodrigo Vivi
2015-07-09 12:58       ` Paulo Zanoni
2015-07-07 23:28 ` [PATCH 3/7] drm/i915: PSR: dirty fb operation flushsing frontbuffer Rodrigo Vivi
2015-07-08  9:47   ` Daniel Vetter [this message]
2015-07-08 14:15     ` Paulo Zanoni
2015-07-08 23:22       ` [PATCH] drm/i915: " Rodrigo Vivi
2015-07-09 13:04         ` Paulo Zanoni
2015-07-09 15:25           ` Daniel Vetter
2015-07-07 23:28 ` [PATCH 4/7] drm/i915: PSR: Remove Low Power HW tracking mask Rodrigo Vivi
2015-07-08 14:26   ` Paulo Zanoni
2015-07-07 23:28 ` [PATCH 5/7] drm/i915: PSR: Increase idle_frames Rodrigo Vivi
2015-07-08 14:32   ` Paulo Zanoni
2015-07-07 23:28 ` [PATCH 6/7] drm/i915: fbdev_set_par reliably invalidating frontbuffer Rodrigo Vivi
2015-07-08  9:44   ` Daniel Vetter
2015-07-08 23:24     ` [PATCH] " Rodrigo Vivi
2015-07-09 13:10       ` Paulo Zanoni
2015-07-09 16:47         ` Vivi, Rodrigo
2015-07-09 16:56         ` Rodrigo Vivi
2015-07-09 18:46           ` Paulo Zanoni
2015-07-09 19:56             ` Daniel Vetter
2015-07-09 20:40               ` Vivi, Rodrigo
2015-07-07 23:28 ` [PATCH 7/7] drm/i915: fbdev restore mode needs to invalidate frontbuffer Rodrigo Vivi
2015-07-08 15:04   ` shuang.he
2015-07-08 18:05   ` Paulo Zanoni
2015-07-08 23:25     ` [PATCH] " Rodrigo Vivi
2015-07-09 13:19       ` shuang.he
2015-07-09 18:54       ` Paulo Zanoni
2015-07-09 19:00         ` Vivi, Rodrigo
2015-07-09 19:51           ` Daniel Vetter
2015-07-09 15:26     ` [PATCH 7/7] " Daniel Vetter
2015-07-09 17:08       ` [PATCH igt] tests: add kms_fbcon_fbt Paulo Zanoni
2015-07-08 13:41 ` [PATCH 1/7] drm/i915: Add origin to frontbuffer tracking flush Paulo Zanoni
2015-07-08 15:29   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150708094729.GM7568@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox