----------------------------------------------------------------------
Message: 1
Date: Mon, 20 Dec 2010 19:23:40 -0800
From: Keith Packard <keithp@xxxxxxxxxx>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andy Lutomirski <luto@xxxxxxx>, Jesse Barnes
<jbarnes@xxxxxxxxxxxxxxxx>, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>,
David Airlie <airlied@xxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
Message-ID: <yunfwtrrepv.fsf@xxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
On Mon, 20 Dec 2010 14:00:54 -0500, Andy Lutomirski <luto@xxxxxxx>
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.
--
keith.packard@xxxxxxxxx
-------------- 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 <luto@xxxxxxx>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Keith Packard <keithp@xxxxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
Message-ID:
<AANLkTik-1zni1DdS6i+1ARoenx6p=9jQAAiA6t5uGg_K@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 20, 2010 at 10:23 PM, Keith Packard <keithp@xxxxxxxxxx>
wrote:
On Mon, 20 Dec 2010 14:00:54 -0500, Andy Lutomirski <luto@xxxxxxx>
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 <keithp@xxxxxxxxxx>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andrew Lutomirski <luto@xxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
Message-ID: <yunbp4frdmo.fsf@xxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<luto@xxxxxxx> 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?
--
keith.packard@xxxxxxxxx
-------------- 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 <luto@xxxxxxx>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Keith Packard <keithp@xxxxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
Message-ID:
<AANLkTimk6RLkr8Lt76cR8ncLW_3kaX6Dqa+=id9_G-8C@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 20, 2010 at 10:47 PM, Keith Packard <keithp@xxxxxxxxxx>
wrote:
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<luto@xxxxxxx> 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
--
keith.packard@xxxxxxxxx
------------------------------
Message: 5
Date: Mon, 20 Dec 2010 20:03:53 -0800
From: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Subject: Re: [Intel-gfx] [PATCH] drm: Aggressively disable vblanks
To: Andrew Lutomirski <luto@xxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx
Message-ID: <20101220200353.12479178@jbarnes-desktop>
Content-Type: text/plain; charset=US-ASCII
On Mon, 20 Dec 2010 22:55:46 -0500
Andrew Lutomirski <luto@xxxxxxx> wrote:
On Mon, Dec 20, 2010 at 10:47 PM, Keith Packard
<keithp@xxxxxxxxxx> wrote:
On Mon, 20 Dec 2010 22:34:12 -0500, Andrew Lutomirski
<luto@xxxxxxx> 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.