All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Cc: patches@linaro.org, daniel.vetter@ffwll.ch,
	dri-devel@lists.freedesktop.org, Rob Clark <rob.clark@linaro.org>,
	bskeggs@redhat.com, gregkh@linuxfoundation.org,
	Rob Clark <rob@ti.com>
Subject: Re: [PATCH 01/11] drm: add drm_send_vblank_event() helper
Date: Tue, 16 Oct 2012 14:53:01 +0200	[thread overview]
Message-ID: <1779281.5yh4JDbOvO@avalon> (raw)
In-Reply-To: <5078B593.4000506@tuebingen.mpg.de>

Hi Mario,

On Saturday 13 October 2012 02:28:03 Mario Kleiner wrote:
> On 11.10.12 16:19, Laurent Pinchart wrote:
> > On Monday 08 October 2012 14:50:39 Rob Clark wrote:
> >> From: Rob Clark <rob@ti.com>
> 
> ...
> 
> > Do you know why some drivers don't call drm_vblank_count_and_time() ? For
> > instance nouveau sets the sequence to 0 and uses do_gettimeofday(), but it
> > looks like it could just call drm_vblank_count_and_time().
> 
> At least nouveau could use it. Lucas Stach and me wrote patches for
> nouveau-kms, and they went through many iterations and missed many
> kernel merge windows due to slow review until i think both of us got
> tired of resubmitting with tiny changes.

I totally understand the feeling, but please don't give up. You can CC me on 
the next iteration, I'll make sure to review the patches (even though I have 
no experience with the nouveau driver).

> The latest iteration is posted by Lucas on nouveau-devel from 26. April
> 2012. Not sure if they'd still apply after the nouveau-kms rewrite. I'll
> probably give them another try once that has landed when i have some spare
> time.
> 
> In principle it's very simple to use drm_vblank_count_and_time(). A
> driver needs to
> 
> 1. Call drm_handle_vblank() from its vblank irq handler.
> 
> 2. Make sure that in the vblank of pageflip completion
> drm_handle_vblank() is called before drm_vblank_count_and_time(), so the
> latter picks up updated counts and timestamps.
> 
> 3. Big bonus for high precision and robustness: Implement the
> driver->get_vblank_timestamp() hook to provide a precise vblank
> timestamp. One simple way to do that is like radeon-kms or intel-kms do
> it: Call back into drm_calc_vbltimestamp_from_scanoutpos() and provide
> the driver->get_scanout_position() function - a function that returns
> the current hardware scanline counter. This is precise down to ~ 10
> microseconds (at least confirmed by measurements on
> intel,radeon,nouveau) and robust against delayed vblank irq handling.
> 
> -mario
-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2012-10-16 12:52 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 19:50 [PATCH 00/11] page-flip cleanups and fixes Rob Clark
2012-10-08 19:50 ` [PATCH 01/11] drm: add drm_send_vblank_event() helper Rob Clark
2012-10-08 21:26   ` Marcin Slusarz
2012-10-11 14:19   ` Laurent Pinchart
2012-10-11 14:43     ` Rob Clark
2012-10-13  0:28     ` Mario Kleiner
2012-10-16 12:53       ` Laurent Pinchart [this message]
2012-10-08 19:50 ` [PATCH 02/11] drm/i915: use " Rob Clark
2012-10-09  8:02   ` Daniel Vetter
2012-11-21 16:48   ` Daniel Vetter
2012-10-08 19:50 ` [PATCH 03/11] drm/nouveau: " Rob Clark
2012-10-08 19:50 ` [PATCH 04/11] drm/radeon: " Rob Clark
2012-10-08 19:50 ` [PATCH 05/11] drm/exynos: " Rob Clark
2013-05-21 23:19   ` Dave Airlie
2013-05-22  2:28     ` Inki Dae
2013-05-22  4:04   ` [PATCH] " Inki Dae
2013-05-22  4:51     ` Joonyoung Shim
2013-05-22  6:56       ` Inki Dae
2013-05-22  6:59     ` [PATCH RESEND] " Inki Dae
2012-10-08 19:50 ` [PATCH 06/11] drm/exynos: page flip fixes Rob Clark
2013-05-21 23:17   ` Dave Airlie
2013-05-22  2:36     ` Inki Dae
2012-10-08 19:50 ` [PATCH 07/11] drm/shmob: use drm_send_vblank_event() helper Rob Clark
2012-10-08 19:50 ` [PATCH 08/11] drm/imx: " Rob Clark
2012-10-08 19:50 ` [PATCH 09/11] drm/imx: page flip fixes Rob Clark
2013-05-21 23:18   ` Dave Airlie
2012-10-08 19:50 ` [PATCH 10/11] drm/omap: use drm_send_vblank_event() helper Rob Clark
2012-10-10  3:33   ` Mario Kleiner
2012-10-10 11:03     ` Rob Clark
2012-10-12 23:38       ` Mario Kleiner
2012-10-08 19:50 ` [PATCH 11/11] drm/omap: page-flip fixes Rob Clark
2012-10-09  9:35   ` Imre Deak
2012-10-09  9:38     ` Imre Deak
2012-10-08 20:51 ` [PATCH 00/11] page-flip cleanups and fixes Alex Deucher
2012-10-08 22:10 ` Marcin Slusarz
2012-10-09  5:17 ` Inki Dae
2012-10-22 22:39 ` Greg KH
2012-10-22 22:51   ` Rob Clark

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=1779281.5yh4JDbOvO@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=mario.kleiner@tuebingen.mpg.de \
    --cc=patches@linaro.org \
    --cc=rob.clark@linaro.org \
    --cc=rob@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.