summaryrefslogtreecommitdiff
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 17:20:15 +0400
committerairlied <airlied@linux.ie>2006-12-07 07:53:29 +0300
commitcdec2f82b11afbe4933fa9a9b3ed567db14fd237 (patch)
tree2acdadd167643b793d9cc2e118ca2738bcb86237 /drivers/char/drm/drm_drv.c
parentb03ed6f2fc519930fe3950365be59f0c079ce5d8 (diff)
downloadlinux-cdec2f82b11afbe4933fa9a9b3ed567db14fd237.tar.xz
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)
if (dev->irq_enabled)
drm_irq_uninstall(dev);
+ /* Free drawable information memory */
+ for (i = 0; i < dev->drw_bitfield_length / sizeof(*dev->drw_bitfield);
+ i++) {
+ drm_drawable_info_t *info = drm_get_drawable_info(dev, i);
+
+ if (info) {
+ drm_free(info->rects, info->num_rects *
+ sizeof(drm_clip_rect_t), DRM_MEM_BUFS);
+ drm_free(info, sizeof(*info), DRM_MEM_BUFS);
+ }
+ }
+
mutex_lock(&dev->struct_mutex);
del_timer(&dev->timer);