]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
drm/i915: capture last_vblank count at IRQ uninstall time too
authorJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 6 Feb 2009 21:04:49 +0000 (13:04 -0800)
committerDave Airlie <airlied@linux.ie>
Sun, 8 Feb 2009 11:40:51 +0000 (21:40 +1000)
commit14d200c5e5bd19219d930bbb9a5a22758c8f5bec
tree4e6109bc96a222d490c005d481a67fa4b2a8a2e7
parent7d8d58b23fd01e60ed44d8d8c10b2df86e638faa
drm/i915: capture last_vblank count at IRQ uninstall time too

In dc1336ff4fe08ae7cfe8301bfd7f0b2cfd31d20a (set vblank enable flag correctly
across IRQ uninstall), we made sure drivers that uninstall their interrupt
handler set the vblank enabled flag correctly, so that when interrupts are
re-enabled, vblank interrupts & counts work as expected.  However I missed the
last_vblank field:  it needs to be updated as well, otherwise, at the next
drm_update_vblank_count we'll end up comparing a current count to a stale
one (the last one captured by the disable function), which may trigger the
wraparound handling, leading to a jumpy counter and hangs in drm_wait_vblank.

The jumpy counter can prevent the DRM_WAIT_ON from returning success if the
difference between the current count and the requested count is greater than
2^23, leading to timeouts or hangs, if the ioctl is restarted in a loop (as
is the case in libdrm < 2.4.4).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Michel Dänzer <michel@daenzer.net>
Tested-by: Timo Aaltonen <tjaalton@cc.hut.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_irq.c