Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Aug 2013 10:02:00 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254837 - head/sys/dev/drm2
Message-ID:  <201308251002.r7PA20Ih090623@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Aug 25 10:01:59 2013
New Revision: 254837
URL: http://svnweb.freebsd.org/changeset/base/254837

Log:
  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.

Modified:
  head/sys/dev/drm2/drm_gem.c

Modified: head/sys/dev/drm2/drm_gem.c
==============================================================================
--- head/sys/dev/drm2/drm_gem.c	Sun Aug 25 09:58:31 2013	(r254836)
+++ head/sys/dev/drm2/drm_gem.c	Sun Aug 25 10:01:59 2013	(r254837)
@@ -328,9 +328,17 @@ drm_gem_open(struct drm_device *dev, str
 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, 
 {
 
 	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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308251002.r7PA20Ih090623>