Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Aug 2013 15:06:49 +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: r254874 - head/sys/dev/drm2/ttm
Message-ID:  <201308251506.r7PF6nKT055977@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Aug 25 15:06:48 2013
New Revision: 254874
URL: http://svnweb.freebsd.org/changeset/base/254874

Log:
  drm/ttm: Improve comment in ttm_bo_vm_ctor() about lack of ref acquisition
  
  Approved by:	kib@

Modified:
  head/sys/dev/drm2/ttm/ttm_bo_vm.c

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sun Aug 25 15:05:22 2013	(r254873)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c	Sun Aug 25 15:06:48 2013	(r254874)
@@ -285,8 +285,16 @@ ttm_bo_vm_ctor(void *handle, vm_ooffset_
 {
 
 	/*
-	 * We don't acquire a reference on bo->kref here, because it was
-	 * already done in ttm_bo_mmap_single().
+	 * On Linux, a reference to the buffer object is acquired here.
+	 * The reason is that this function is not called when the
+	 * mmap() is initialized, but only when a process forks for
+	 * instance. Therefore on Linux, the reference on the bo is
+	 * acquired either in ttm_bo_mmap() or ttm_bo_vm_open(). It's
+	 * then released in ttm_bo_vm_close().
+	 *
+	 * Here, this function is called during mmap() intialization.
+	 * Thus, the reference acquired in ttm_bo_mmap_single() is
+	 * sufficient.
 	 */
 
 	*color = 0;



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