----------------------------------------------------------------------
Message: 1
Date: Mon, 20 Dec 2010 19:23:40 -0800
From: Keith Packard <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andy Lutomirski <[email protected]>, Jesse Barnes
<[email protected]>, Chris Wilson
<[email protected]>,
David Airlie <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On Mon, 20 Dec 2010 14:00:54 -0500, Andy Lutomirski <[email protected]>
wrote:
Enabling and disabling the vblank interrupt (on devices that
support it) is cheap. So disable it quickly after each
interrupt.
So, the concern (and reason for the original design) was that you
might
lose count of vblank interrupts as vblanks are counted differently
while
off than while on. If vblank interrupts get enabled near the interrupt
time, is it possible that you'll end up off by one somehow?
Leaving them enabled for 'a while' was supposed to reduce the
impact of
this potential error.
--
[email protected]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/
20101220/105a9fb6/attachment-0001.pgp>
------------------------------
Message: 2
Date: Mon, 20 Dec 2010 22:34:12 -0500
From: Andrew Lutomirski <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Keith Packard <[email protected]>
Cc: [email protected], [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 20, 2010 at 10:23 PM, Keith Packard <[email protected]>
wrote:
On Mon, 20 Dec 2010 14:00:54 -0500, Andy Lutomirski <[email protected]>
wrote:
Enabling and disabling the vblank interrupt (on devices that
support it) is cheap. ?So disable it quickly after each
interrupt.
So, the concern (and reason for the original design) was that you
might
lose count of vblank interrupts as vblanks are counted differently
while
off than while on. If vblank interrupts get enabled near the
interrupt
time, is it possible that you'll end up off by one somehow?
So the race is:
1. Vblank happens.
2. vblank_get runs, reads hardware counter, and enables the interrupt
(and maybe not quite in that order)
3. Interrupt fires and increments the counter. Now the counter is
one too high.
What if we read the hardware counter from the IRQ the first time that
it fires after being enabled? That way, if the hardware and software
counters match (mod 2^23 or whatever the magic number is), we don't
increment the counter.
Leaving them enabled for 'a while' was supposed to reduce the
impact of
this potential error.
Fair enough,
But five seconds is a *long* time, and anything short enough that the
interrupt actually gets turned off in normal use risks the same race.
--Andy
------------------------------
Message: 3
Date: Mon, 20 Dec 2010 19:47:11 -0800
From: Keith Packard <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andrew Lutomirski <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<[email protected]> wrote:
But five seconds is a *long* time, and anything short enough that the
interrupt actually gets turned off in normal use risks the same race.
Right, so eliminating any race seems like the basic requirement. Can
that be done?
--
[email protected]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/
20101220/5ca3b674/attachment-0001.pgp>
------------------------------
Message: 4
Date: Mon, 20 Dec 2010 22:55:46 -0500
From: Andrew Lutomirski <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Keith Packard <[email protected]>
Cc: [email protected], [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 20, 2010 at 10:47 PM, Keith Packard <[email protected]>
wrote:
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<[email protected]> wrote:
But five seconds is a *long* time, and anything short enough that
the
interrupt actually gets turned off in normal use risks the same
race.
Right, so eliminating any race seems like the basic requirement. Can
that be done?
I'll give it a shot.
Do you know if there's an existing tool to call drm_wait_vblank from
userspace for testing? I know approximately nothing about libdrm or
any userspace graphics stuff whatsoever.
--Andy
--
[email protected]
------------------------------
Message: 5
Date: Mon, 20 Dec 2010 20:03:53 -0800
From: Jesse Barnes <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andrew Lutomirski <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <20101220200353.12479...@jbarnes-desktop>
Content-Type: text/plain; charset=US-ASCII
On Mon, 20 Dec 2010 22:55:46 -0500
Andrew Lutomirski <[email protected]> wrote:
On Mon, Dec 20, 2010 at 10:47 PM, Keith Packard
<[email protected]> wrote:
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<[email protected]> wrote:
But five seconds is a *long* time, and anything short enough
that the
interrupt actually gets turned off in normal use risks the same
race.
Right, so eliminating any race seems like the basic requirement. Can
that be done?
I'll give it a shot.
Do you know if there's an existing tool to call drm_wait_vblank from
userspace for testing? I know approximately nothing about libdrm or
any userspace graphics stuff whatsoever.
Yeah, libdrm has a test program called vbltest; it should do what you
need.