diff options
author | Keith Packard <keithp@keithp.com> | 2008-11-18 09:30:25 -0800 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-11-25 09:49:03 +1000 |
commit | 52440211dcdc52c0b757f8b34d122e11b12cdd50 (patch) | |
tree | 5ad9c526134d046043b04ee56fb34d428a03c890 /drivers/gpu/drm/via/via_map.c | |
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/via_map.c')
-rw-r--r-- | drivers/gpu/drm/via/via_map.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index a967556be01..2c4f0b48579 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) ret = drm_sman_init(&dev_priv->sman, 2, 12, 8); if (ret) { drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); + return ret; } - return ret; + + ret = drm_vblank_init(dev, 1); + if (ret) { + drm_sman_takedown(&dev_priv->sman); + drm_free(dev_priv, sizeof(drm_via_private_t), DRM_MEM_DRIVER); + return ret; + } + + return 0; } int via_driver_unload(struct drm_device *dev) |