summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2013-08-25 10:01:59 +0000
committerdumbbell <dumbbell@FreeBSD.org>2013-08-25 10:01:59 +0000
commitd9c0d50323a4c9d8a2cb0f028e6d06236a8de7f6 (patch)
tree53d42ec4f8f2e5cb77ce82b9d6095bb634a9143d
parent71cbc49bf8557d2544373c2468241a0178d34fdc (diff)
downloadFreeBSD-src-d9c0d50323a4c9d8a2cb0f028e6d06236a8de7f6.zip
FreeBSD-src-d9c0d50323a4c9d8a2cb0f028e6d06236a8de7f6.tar.gz
drm: Call "gem_close_object" driver callback from drm_gem_object_release_handle()
This fixes leakage of "bo_va" for Cayman and following card generations.
-rw-r--r--sys/dev/drm2/drm_gem.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/drm2/drm_gem.c b/sys/dev/drm2/drm_gem.c
index 5604580..5215a41 100644
--- a/sys/dev/drm2/drm_gem.c
+++ b/sys/dev/drm2/drm_gem.c
@@ -328,9 +328,17 @@ drm_gem_open(struct drm_device *dev, struct drm_file *file_priv)
static int
drm_gem_object_release_handle(uint32_t name, void *ptr, void *arg)
{
+ struct drm_file *file_priv;
struct drm_gem_object *obj;
+ struct drm_device *dev;
+ file_priv = arg;
obj = ptr;
+ dev = obj->dev;
+
+ if (dev->driver->gem_close_object)
+ dev->driver->gem_close_object(obj, file_priv);
+
drm_gem_object_handle_unreference(obj);
return (0);
}
@@ -340,7 +348,7 @@ drm_gem_release(struct drm_device *dev, struct drm_file *file_priv)
{
drm_gem_names_foreach(&file_priv->object_names,
- drm_gem_object_release_handle, NULL);
+ drm_gem_object_release_handle, file_priv);
drm_gem_names_fini(&file_priv->object_names);
}
OpenPOWER on IntegriCloud