diff options
author | Keith Packard <keithp@keithp.com> | 2008-11-18 12:30:25 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-11-24 18:49:03 -0500 |
commit | 52440211dcdc52c0b757f8b34d122e11b12cdd50 (patch) | |
tree | 5ad9c526134d046043b04ee56fb34d428a03c890 /drivers/gpu/drm/r128 | |
parent | 6133047aa64d2fd5b3b79dff74f696ded45615b2 (diff) |
drm: move drm vblank initialization/cleanup to driver load/unload
drm vblank initialization keeps track of the changes in driver-supplied
frame counts across vt switch and mode setting, but only if you let it by
not tearing down the drm vblank structure.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/r128')
-rw-r--r-- | drivers/gpu/drm/r128/r128_drv.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/r128/r128_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/r128/r128_irq.c | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c index 3265d53ba91f..601f4c0e5da5 100644 --- a/drivers/gpu/drm/r128/r128_drv.c +++ b/drivers/gpu/drm/r128/r128_drv.c | |||
@@ -45,6 +45,7 @@ static struct drm_driver driver = { | |||
45 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | | 45 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | |
46 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, | 46 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, |
47 | .dev_priv_size = sizeof(drm_r128_buf_priv_t), | 47 | .dev_priv_size = sizeof(drm_r128_buf_priv_t), |
48 | .load = r128_driver_load, | ||
48 | .preclose = r128_driver_preclose, | 49 | .preclose = r128_driver_preclose, |
49 | .lastclose = r128_driver_lastclose, | 50 | .lastclose = r128_driver_lastclose, |
50 | .get_vblank_counter = r128_get_vblank_counter, | 51 | .get_vblank_counter = r128_get_vblank_counter, |
@@ -84,6 +85,11 @@ static struct drm_driver driver = { | |||
84 | .patchlevel = DRIVER_PATCHLEVEL, | 85 | .patchlevel = DRIVER_PATCHLEVEL, |
85 | }; | 86 | }; |
86 | 87 | ||
88 | int r128_driver_load(struct drm_device * dev, unsigned long flags) | ||
89 | { | ||
90 | return drm_vblank_init(dev, 1); | ||
91 | } | ||
92 | |||
87 | static int __init r128_init(void) | 93 | static int __init r128_init(void) |
88 | { | 94 | { |
89 | driver.num_ioctls = r128_max_ioctl; | 95 | driver.num_ioctls = r128_max_ioctl; |
diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h index 5898b274279d..797a26c42dab 100644 --- a/drivers/gpu/drm/r128/r128_drv.h +++ b/drivers/gpu/drm/r128/r128_drv.h | |||
@@ -159,6 +159,7 @@ extern void r128_driver_irq_preinstall(struct drm_device * dev); | |||
159 | extern int r128_driver_irq_postinstall(struct drm_device *dev); | 159 | extern int r128_driver_irq_postinstall(struct drm_device *dev); |
160 | extern void r128_driver_irq_uninstall(struct drm_device * dev); | 160 | extern void r128_driver_irq_uninstall(struct drm_device * dev); |
161 | extern void r128_driver_lastclose(struct drm_device * dev); | 161 | extern void r128_driver_lastclose(struct drm_device * dev); |
162 | extern int r128_driver_load(struct drm_device * dev, unsigned long flags); | ||
162 | extern void r128_driver_preclose(struct drm_device * dev, | 163 | extern void r128_driver_preclose(struct drm_device * dev, |
163 | struct drm_file *file_priv); | 164 | struct drm_file *file_priv); |
164 | 165 | ||
diff --git a/drivers/gpu/drm/r128/r128_irq.c b/drivers/gpu/drm/r128/r128_irq.c index d7349012a680..69810fb8ac49 100644 --- a/drivers/gpu/drm/r128/r128_irq.c +++ b/drivers/gpu/drm/r128/r128_irq.c | |||
@@ -102,7 +102,7 @@ void r128_driver_irq_preinstall(struct drm_device * dev) | |||
102 | 102 | ||
103 | int r128_driver_irq_postinstall(struct drm_device *dev) | 103 | int r128_driver_irq_postinstall(struct drm_device *dev) |
104 | { | 104 | { |
105 | return drm_vblank_init(dev, 1); | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | void r128_driver_irq_uninstall(struct drm_device * dev) | 108 | void r128_driver_irq_uninstall(struct drm_device * dev) |