From owner-svn-src-head@FreeBSD.ORG Sun Aug 25 10:02:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77FF42C1; Sun, 25 Aug 2013 10:02:00 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6475C24E6; Sun, 25 Aug 2013 10:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7PA20V4090624; Sun, 25 Aug 2013 10:02:00 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7PA20Ih090623; Sun, 25 Aug 2013 10:02:00 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308251002.r7PA20Ih090623@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 25 Aug 2013 10:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254837 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2013 10:02:00 -0000 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); }