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/via | |
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/via')
-rw-r--r-- | drivers/gpu/drm/via/via_irq.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/via/via_map.c | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c index 665d319b927b..c248c1d37268 100644 --- a/drivers/gpu/drm/via/via_irq.c +++ b/drivers/gpu/drm/via/via_irq.c | |||
@@ -314,7 +314,6 @@ int via_driver_irq_postinstall(struct drm_device *dev) | |||
314 | if (!dev_priv) | 314 | if (!dev_priv) |
315 | return -EINVAL; | 315 | return -EINVAL; |
316 | 316 | ||
317 | drm_vblank_init(dev, 1); | ||
318 | status = VIA_READ(VIA_REG_INTERRUPT); | 317 | status = VIA_READ(VIA_REG_INTERRUPT); |
319 | VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_GLOBAL | 318 | VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_GLOBAL |
320 | | dev_priv->irq_enable_mask); | 319 | | dev_priv->irq_enable_mask); |
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index a967556be014..2c4f0b485792 100644 --- a/drivers/gpu/drm/via/via_map.c +++ b/drivers/gpu/drm/via/via_map.c | |||
@@ -107,8 +107,17 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset) | |||
107 | ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); | 107 | ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); |
108 | if (ret) { | 108 | if (ret) { |
109 | drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); | 109 | drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); |
110 | return ret; | ||
110 | } | 111 | } |
111 | return ret; | 112 | |
113 | ret = drm_vblank_init(dev, 1); | ||
114 | if (ret) { | ||
115 | drm_sman_takedown(&dev_priv->sman); | ||
116 | drm_free(dev_priv, sizeof(drm_via_private_t), DRM_MEM_DRIVER); | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | return 0; | ||
112 | } | 121 | } |
113 | 122 | ||
114 | int via_driver_unload(struct drm_device *dev) | 123 | int via_driver_unload(struct drm_device *dev) |