diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2006-08-30 19:24:04 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2006-09-29 12:55:08 +0200 |
commit | 00531cecad3cf9a1ec230f7f33535d153b9d9bd0 (patch) | |
tree | 0b8a06357a35f8a7f924482e825675a62161f7ff /linux-core | |
parent | 7d487602a31dd886037417db088b6e643ed86918 (diff) |
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.
(cherry picked from df7551ef7334d728ec0371423661bb403d3e270a commit)
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_drv.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index d4ef1306..37539f34 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -163,6 +163,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); |