diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-09-30 15:14:26 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-10-17 17:10:11 -0400 |
commit | 0a3e67a4caac273a3bfc4ced3da364830b1ab241 (patch) | |
tree | 02a2e5e76d9dffcb556d09b0eee4d34ebe5d81cb /drivers/gpu/drm/mga/mga_drv.c | |
parent | 2df68b439fcb97a4c55f81516206ef4ee325e28d (diff) |
drm: Rework vblank-wait handling to allow interrupt reduction.
Previously, drivers supporting vblank interrupt waits would run the interrupt
all the time, or all the time that any 3d client was running, preventing the
CPU from sleeping for long when the system was otherwise idle. Now, interrupts
are disabled any time that no client is waiting on a vblank event. The new
method uses vblank counters on the chipsets when the interrupts are turned
off, rather than counting interrupts, so that we can continue to present
accurate vblank numbers.
Co-author: Michel Dänzer <michel@tungstengraphics.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mga/mga_drv.c')
-rw-r--r-- | drivers/gpu/drm/mga/mga_drv.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c index 5572939fc7d1..97ee566ef749 100644 --- a/drivers/gpu/drm/mga/mga_drv.c +++ b/drivers/gpu/drm/mga/mga_drv.c | |||
@@ -45,15 +45,16 @@ static struct pci_device_id pciidlist[] = { | |||
45 | static struct drm_driver driver = { | 45 | static struct drm_driver driver = { |
46 | .driver_features = | 46 | .driver_features = |
47 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | | 47 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | |
48 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | | 48 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, |
49 | DRIVER_IRQ_VBL, | ||
50 | .dev_priv_size = sizeof(drm_mga_buf_priv_t), | 49 | .dev_priv_size = sizeof(drm_mga_buf_priv_t), |
51 | .load = mga_driver_load, | 50 | .load = mga_driver_load, |
52 | .unload = mga_driver_unload, | 51 | .unload = mga_driver_unload, |
53 | .lastclose = mga_driver_lastclose, | 52 | .lastclose = mga_driver_lastclose, |
54 | .dma_quiescent = mga_driver_dma_quiescent, | 53 | .dma_quiescent = mga_driver_dma_quiescent, |
55 | .device_is_agp = mga_driver_device_is_agp, | 54 | .device_is_agp = mga_driver_device_is_agp, |
56 | .vblank_wait = mga_driver_vblank_wait, | 55 | .get_vblank_counter = mga_get_vblank_counter, |
56 | .enable_vblank = mga_enable_vblank, | ||
57 | .disable_vblank = mga_disable_vblank, | ||
57 | .irq_preinstall = mga_driver_irq_preinstall, | 58 | .irq_preinstall = mga_driver_irq_preinstall, |
58 | .irq_postinstall = mga_driver_irq_postinstall, | 59 | .irq_postinstall = mga_driver_irq_postinstall, |
59 | .irq_uninstall = mga_driver_irq_uninstall, | 60 | .irq_uninstall = mga_driver_irq_uninstall, |
@@ -64,20 +65,20 @@ static struct drm_driver driver = { | |||
64 | .ioctls = mga_ioctls, | 65 | .ioctls = mga_ioctls, |
65 | .dma_ioctl = mga_dma_buffers, | 66 | .dma_ioctl = mga_dma_buffers, |
66 | .fops = { | 67 | .fops = { |
67 | .owner = THIS_MODULE, | 68 | .owner = THIS_MODULE, |
68 | .open = drm_open, | 69 | .open = drm_open, |
69 | .release = drm_release, | 70 | .release = drm_release, |
70 | .ioctl = drm_ioctl, | 71 | .ioctl = drm_ioctl, |
71 | .mmap = drm_mmap, | 72 | .mmap = drm_mmap, |
72 | .poll = drm_poll, | 73 | .poll = drm_poll, |
73 | .fasync = drm_fasync, | 74 | .fasync = drm_fasync, |
74 | #ifdef CONFIG_COMPAT | 75 | #ifdef CONFIG_COMPAT |
75 | .compat_ioctl = mga_compat_ioctl, | 76 | .compat_ioctl = mga_compat_ioctl, |
76 | #endif | 77 | #endif |
77 | }, | 78 | }, |
78 | .pci_driver = { | 79 | .pci_driver = { |
79 | .name = DRIVER_NAME, | 80 | .name = DRIVER_NAME, |
80 | .id_table = pciidlist, | 81 | .id_table = pciidlist, |
81 | }, | 82 | }, |
82 | 83 | ||
83 | .name = DRIVER_NAME, | 84 | .name = DRIVER_NAME, |