aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_drv.c
diff options
context:
space:
mode:
author=?utf-8?q?Michel_D=C3=A4nzer?= <michel@tungstengraphics.com>2006-10-24 09:20:15 -0400
committerairlied <airlied@linux.ie>2006-12-06 23:53:29 -0500
commitcdec2f82b11afbe4933fa9a9b3ed567db14fd237 (patch)
tree2acdadd167643b793d9cc2e118ca2738bcb86237 /drivers/char/drm/drm_drv.c
parentb03ed6f2fc519930fe3950365be59f0c079ce5d8 (diff)
drm: Change first valid DRM drawable ID to be 1 instead of 0.
This makes it easier for userspace to know when it needs to allocate an ID. Also free drawable information memory when it's no longer needed. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_drv.c')
-rw-r--r--drivers/char/drm/drm_drv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index 59de4a01515f..a70af0de4453 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -153,6 +153,18 @@ int drm_lastclose(drm_device_t * dev)
153 if (dev->irq_enabled) 153 if (dev->irq_enabled)
154 drm_irq_uninstall(dev); 154 drm_irq_uninstall(dev);
155 155
156 /* Free drawable information memory */
157 for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield);
158 i++) {
159 drm_drawable_info_t *info = drm_get_drawable_info(dev, i);
160
161 if (info) {
162 drm_free(info->rects, info->num_rects *
163 sizeof(drm_clip_rect_t), DRM_MEM_BUFS);
164 drm_free(info, sizeof(*info), DRM_MEM_BUFS);
165 }
166 }
167
156 mutex_lock(&dev->struct_mutex); 168 mutex_lock(&dev->struct_mutex);
157 del_timer(&dev->timer); 169 del_timer(&dev->timer);
158 170