diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-08-22 17:26:32 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-08-22 17:26:32 +0100 |
commit | 675f868f23bd124b7c4d040573fece6a532b07f4 (patch) | |
tree | 3bed9ff0aeeb97c73c332d7944be083d965bf305 | |
parent | c2c4dbb6513bd938f5009e7b6293782dea37887d (diff) |
Release mapping resources when deleting a GEM object
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r-- | drivers/mfd/glamo/glamo-buffer.c | 19 |
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); } |