diff options
author | rnoland <rnoland@FreeBSD.org> | 2009-06-25 16:17:07 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2009-06-25 16:17:07 +0000 |
commit | c47a69b0adb31f67aa1e738f5142fe7f51daad69 (patch) | |
tree | 3653ef767686919f314a1a035ecd4259ca209968 /sys/dev/drm | |
parent | 804f2f79eee18b6494ba08a9909d3cc4cface7cd (diff) | |
download | FreeBSD-src-c47a69b0adb31f67aa1e738f5142fe7f51daad69.zip FreeBSD-src-c47a69b0adb31f67aa1e738f5142fe7f51daad69.tar.gz |
Initialize max_vblank_count earlier.
Small cleanup of the error paths while I'm here.
MFC after: 3 days
Diffstat (limited to 'sys/dev/drm')
-rw-r--r-- | sys/dev/drm/radeon_cp.c | 18 | ||||
-rw-r--r-- | sys/dev/drm/radeon_irq.c | 2 |
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/drm/radeon_cp.c b/sys/dev/drm/radeon_cp.c index 8f723ce..3d8cf9d 100644 --- a/sys/dev/drm/radeon_cp.c +++ b/sys/dev/drm/radeon_cp.c @@ -2064,16 +2064,22 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags) drm_get_resource_len(dev, 2), _DRM_REGISTERS, _DRM_READ_ONLY | _DRM_DRIVER, &dev_priv->mmio); if (ret != 0) - return ret; + goto error; ret = drm_vblank_init(dev, 2); - if (ret) { - radeon_driver_unload(dev); - return ret; - } + if (ret != 0) + goto error; + + dev->max_vblank_count = 0x001fffff; DRM_DEBUG("%s card detected\n", - ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); + ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : + (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); + + return ret; + +error: + radeon_driver_unload(dev); return ret; } diff --git a/sys/dev/drm/radeon_irq.c b/sys/dev/drm/radeon_irq.c index ce301eb..7f60573 100644 --- a/sys/dev/drm/radeon_irq.c +++ b/sys/dev/drm/radeon_irq.c @@ -380,8 +380,6 @@ int radeon_driver_irq_postinstall(struct drm_device * dev) atomic_set(&dev_priv->swi_emitted, 0); DRM_INIT_WAITQUEUE(&dev_priv->swi_queue); - dev->max_vblank_count = 0x001fffff; - radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); return 0; |