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-28 15:41:36 +0200 |
commit | df7551ef7334d728ec0371423661bb403d3e270a (patch) | |
tree | b89bc113d20c4bb5843d36d20d62761cb19860ef /linux-core | |
parent | d04751facea36cb888c7510b126658fdbc4277d5 (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.
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 2c878b61..228c8b89 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -156,6 +156,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); |