aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-11-05 13:31:53 -0500
committerDave Airlie <airlied@linux.ie>2008-12-29 02:47:22 -0500
commita2c0a97b784f837300f7b0869c82ab712c600952 (patch)
treeaca1cdf3d32e1cfa7387350483f6a70c74a24ffd /drivers/gpu/drm/drm_drv.c
parenta9587470f753d670d910293ecbf1c7b66c99de50 (diff)
drm: GEM mmap support
Add core support for mapping of GEM objects. Drivers should provide a vm_operations_struct if they want to support page faulting of objects. The code for handling GEM object offsets was taken from TTM, which was written by Thomas Hellström. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 9f04ca37df6d..98a781375f60 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -209,6 +209,7 @@ int drm_lastclose(struct drm_device * dev)
209 if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) 209 if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
210 drm_dma_takedown(dev); 210 drm_dma_takedown(dev);
211 211
212 dev->dev_mapping = NULL;
212 mutex_unlock(&dev->struct_mutex); 213 mutex_unlock(&dev->struct_mutex);
213 214
214 DRM_DEBUG("lastclose completed\n"); 215 DRM_DEBUG("lastclose completed\n");
@@ -273,6 +274,8 @@ EXPORT_SYMBOL(drm_init);
273 */ 274 */
274static void drm_cleanup(struct drm_device * dev) 275static void drm_cleanup(struct drm_device * dev)
275{ 276{
277 struct drm_driver *driver = dev->driver;
278
276 DRM_DEBUG("\n"); 279 DRM_DEBUG("\n");
277 280
278 if (!dev) { 281 if (!dev) {
@@ -304,6 +307,9 @@ static void drm_cleanup(struct drm_device * dev)
304 drm_ht_remove(&dev->map_hash); 307 drm_ht_remove(&dev->map_hash);
305 drm_ctxbitmap_cleanup(dev); 308 drm_ctxbitmap_cleanup(dev);
306 309
310 if (driver->driver_features & DRIVER_GEM)
311 drm_gem_destroy(dev);
312
307 drm_put_minor(&dev->primary); 313 drm_put_minor(&dev->primary);
308 if (drm_put_dev(dev)) 314 if (drm_put_dev(dev))
309 DRM_ERROR("Cannot unload module\n"); 315 DRM_ERROR("Cannot unload module\n");