[Intel-gfx] [PATCH 14/19] drm: Don't update vblank timestamp when the counter didn't change

Mario Kleiner mario.kleiner.de at gmail.com
Sat Sep 13 18:25:54 CEST 2014


The current drm-next misses Ville's original Patch 14/19, the one i 
first objected, then objected to my objection. It is needed to avoid 
actual regressions. Attached a trivially rebased (v2) of Ville's patch 
to go on top of drm-next, also as tgz in case my e-mail client mangles 
the patch again, because it's one of those "email hates me" weeks.

-mario



On 08/06/2014 01:49 PM, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> If we already have a timestamp for the current vblank counter, don't
> update it with a new timestmap. Small errors can creep in between two
> timestamp queries for the same vblank count, which could be confusing to
> userspace when it queries the timestamp for the same vblank sequence
> number twice.
>
> This problem gets exposed when the vblank disable timer is not used
> (or is set to expire quickly) and thus we can get multiple vblank
> disable<->enable transition during the same frame which would all
> attempt to update the timestamp with the latest estimate.
>
> Testcase: igt/kms_flip/flip-vs-expired-vblank
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>   drivers/gpu/drm/drm_irq.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index af33df1..0523f5b 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -106,6 +106,9 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
>   	DRM_DEBUG("enabling vblank interrupts on crtc %d, missed %d\n",
>   		  crtc, diff);
>   
> +	if (diff == 0)
> +		return;
> +
>   	/* Reinitialize corresponding vblank timestamp if high-precision query
>   	 * available. Skip this step if query unsupported or failed. Will
>   	 * reinitialize delayed at next vblank interrupt in that case.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-Don-t-update-vblank-timestamp-when-the-counter-d.patch
Type: text/x-patch
Size: 1862 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20140913/154f5858/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-Don-t-update-vblank-timestamp-when-the-counter-d.patch.tar.gz
Type: application/gzip
Size: 1171 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20140913/154f5858/attachment-0001.bin>


More information about the Intel-gfx mailing list