diff options
author | Dave Airlie <airlied@linux.ie> | 2004-08-19 11:12:08 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2004-08-19 11:12:08 +0000 |
commit | 045be1e696d80afcaa1dd9559013fcdbdfb3ba06 (patch) | |
tree | 70346ac7474262dc6711659e05c888b1e8eb099f | |
parent | 0f6953b3eda107c813a742154feb266e90fd24a5 (diff) |
fix bug .. all drivers have CTX_BITMAP
-rw-r--r-- | linux-core/drmP.h | 1 | ||||
-rw-r--r-- | linux-core/drm_drv.c | 20 | ||||
-rw-r--r-- | linux/drmP.h | 1 | ||||
-rw-r--r-- | linux/drm_drv.h | 20 |
4 files changed, 16 insertions, 26 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index dc9f00b7..cc1e0f80 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -94,7 +94,6 @@ #define DRIVER_USE_AGP 0x1 #define DRIVER_REQUIRE_AGP 0x2 #define DRIVER_USE_MTRR 0x4 -#define DRIVER_CTX_BITMAP 0x8 #define DRIVER_HAVE_DMA 0x10 #define DRIVER_HAVE_IRQ 0x20 #define DRIVER_SG 0x40 diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 46bfeb23..f7a05277 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -515,8 +515,7 @@ static int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent) DRM(driver_register_fns)(dev); /* if we have CTX_BITMAP add the ioctls */ - if (dev->driver_features & DRIVER_CTX_BITMAP) - DRM(context_add_ioctls)(); + DRM(context_add_ioctls)(); if (dev->fn_tbl.preinit) if ((retcode = dev->fn_tbl.preinit(dev, ent->driver_data))) @@ -542,13 +541,12 @@ static int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } #endif #endif - if (dev->driver_features & DRIVER_CTX_BITMAP) { - retcode = DRM(ctxbitmap_init)( dev ); - if( retcode ) { - DRM_ERROR( "Cannot allocate memory for context bitmap.\n" ); - goto error_out_unreg; - } + retcode = DRM(ctxbitmap_init)( dev ); + if( retcode ) { + DRM_ERROR( "Cannot allocate memory for context bitmap.\n" ); + goto error_out_unreg; } + if ((dev->minor = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0) { retcode = -EPERM; @@ -674,8 +672,7 @@ static void __exit drm_cleanup( drm_device_t *dev ) DRM_DEBUG( "minor %d unregistered\n", dev->minor); } - if ( dev->driver_features & DRIVER_CTX_BITMAP) - DRM(ctxbitmap_cleanup)( dev ); + DRM(ctxbitmap_cleanup)( dev ); #if __OS_HAS_AGP #if __OS_HAS_MTRR @@ -909,8 +906,7 @@ int DRM(release)( struct inode *inode, struct file *filp ) if (dev->fn_tbl.context_dtor) dev->fn_tbl.context_dtor(dev, pos->handle); - if (dev->driver_features & DRIVER_CTX_BITMAP) - DRM(ctxbitmap_free)( dev, pos->handle ); + DRM(ctxbitmap_free)( dev, pos->handle ); list_del( &pos->head ); DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST ); diff --git a/linux/drmP.h b/linux/drmP.h index dc9f00b7..cc1e0f80 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -94,7 +94,6 @@ #define DRIVER_USE_AGP 0x1 #define DRIVER_REQUIRE_AGP 0x2 #define DRIVER_USE_MTRR 0x4 -#define DRIVER_CTX_BITMAP 0x8 #define DRIVER_HAVE_DMA 0x10 #define DRIVER_HAVE_IRQ 0x20 #define DRIVER_SG 0x40 diff --git a/linux/drm_drv.h b/linux/drm_drv.h index 46bfeb23..f7a05277 100644 --- a/linux/drm_drv.h +++ b/linux/drm_drv.h @@ -515,8 +515,7 @@ static int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent) DRM(driver_register_fns)(dev); /* if we have CTX_BITMAP add the ioctls */ - if (dev->driver_features & DRIVER_CTX_BITMAP) - DRM(context_add_ioctls)(); + DRM(context_add_ioctls)(); if (dev->fn_tbl.preinit) if ((retcode = dev->fn_tbl.preinit(dev, ent->driver_data))) @@ -542,13 +541,12 @@ static int drm_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } #endif #endif - if (dev->driver_features & DRIVER_CTX_BITMAP) { - retcode = DRM(ctxbitmap_init)( dev ); - if( retcode ) { - DRM_ERROR( "Cannot allocate memory for context bitmap.\n" ); - goto error_out_unreg; - } + retcode = DRM(ctxbitmap_init)( dev ); + if( retcode ) { + DRM_ERROR( "Cannot allocate memory for context bitmap.\n" ); + goto error_out_unreg; } + if ((dev->minor = DRM(stub_register)(DRIVER_NAME, &DRM(fops),dev)) < 0) { retcode = -EPERM; @@ -674,8 +672,7 @@ static void __exit drm_cleanup( drm_device_t *dev ) DRM_DEBUG( "minor %d unregistered\n", dev->minor); } - if ( dev->driver_features & DRIVER_CTX_BITMAP) - DRM(ctxbitmap_cleanup)( dev ); + DRM(ctxbitmap_cleanup)( dev ); #if __OS_HAS_AGP #if __OS_HAS_MTRR @@ -909,8 +906,7 @@ int DRM(release)( struct inode *inode, struct file *filp ) if (dev->fn_tbl.context_dtor) dev->fn_tbl.context_dtor(dev, pos->handle); - if (dev->driver_features & DRIVER_CTX_BITMAP) - DRM(ctxbitmap_free)( dev, pos->handle ); + DRM(ctxbitmap_free)( dev, pos->handle ); list_del( &pos->head ); DRM(free)( pos, sizeof(*pos), DRM_MEM_CTXLIST ); |