summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mga/mga_dma.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-11-18 09:30:25 -0800
committerDave Airlie <airlied@redhat.com>2008-11-25 09:49:03 +1000
commit52440211dcdc52c0b757f8b34d122e11b12cdd50 (patch)
tree5ad9c526134d046043b04ee56fb34d428a03c890 /drivers/gpu/drm/mga/mga_dma.c
parent6133047aa64d2fd5b3b79dff74f696ded45615b2 (diff)
downloadop-kernel-dev-52440211dcdc52c0b757f8b34d122e11b12cdd50.zip
op-kernel-dev-52440211dcdc52c0b757f8b34d122e11b12cdd50.tar.gz
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/mga/mga_dma.c')
-rw-r--r--drivers/gpu/drm/mga/mga_dma.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c
index c1d12dbf..b49c5ff 100644
--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -396,6 +396,7 @@ int mga_freelist_put(struct drm_device * dev, struct drm_buf * buf)
int mga_driver_load(struct drm_device * dev, unsigned long flags)
{
drm_mga_private_t *dev_priv;
+ int ret;
dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER);
if (!dev_priv)
@@ -415,6 +416,13 @@ int mga_driver_load(struct drm_device * dev, unsigned long flags)
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
+ ret = drm_vblank_init(dev, 1);
+
+ if (ret) {
+ (void) mga_driver_unload(dev);
+ return ret;
+ }
+
return 0;
}
OpenPOWER on IntegriCloud