aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-08-22 17:26:32 +0100
committerThomas White <taw@bitwiz.org.uk>2009-08-22 17:26:32 +0100
commit675f868f23bd124b7c4d040573fece6a532b07f4 (patch)
tree3bed9ff0aeeb97c73c332d7944be083d965bf305 /drivers
parentc2c4dbb6513bd938f5009e7b6293782dea37887d (diff)
Release mapping resources when deleting a GEM object
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/glamo/glamo-buffer.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-buffer.c b/drivers/mfd/glamo/glamo-buffer.c
index 6529e5f51ac..ae8eeadb25a 100644
--- a/drivers/mfd/glamo/glamo-buffer.c
+++ b/drivers/mfd/glamo/glamo-buffer.c
@@ -299,12 +299,31 @@ int glamodrm_gem_init_object(struct drm_gem_object *obj)
void glamodrm_gem_free_object(struct drm_gem_object *obj)
{
struct drm_glamo_gem_object *gobj;
+ struct drm_map_list *list;
+ struct drm_device *dev;
+ struct drm_gem_mm *mm;
+ struct drm_map *map;
+ dev = obj->dev;
+ mm = dev->mm_private;
gobj = obj->driver_private;
/* Free the VRAM */
drm_mm_put_block(gobj->block);
+ /* Release mappings */
+ list = &obj->map_list;
+ drm_ht_remove_item(&mm->offset_hash, &list->hash);
+ if (list->file_offset_node) {
+ drm_mm_put_block(list->file_offset_node);
+ list->file_offset_node = NULL;
+ }
+ map = list->map;
+ if (map) {
+ drm_free(map, sizeof(*map), DRM_MEM_DRIVER);
+ list->map = NULL;
+ }
+
/* Free the private structure */
drm_free(obj->driver_private, 1, DRM_MEM_DRIVER);
}