[PATCH 3/3] ttm: Update move_notify and swap_notify documentation.

Thomas Hellstrom thellstrom at vmware.com
Mon Nov 21 04:08:38 PST 2011


Update the documentation of these callbacks to reflect the TTM supported
way of setting up driver-private GPU maps, hoping to avoid the Radeon way
leaking into new drivers.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
 include/drm/ttm/ttm_bo_driver.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 94eb143..42c3e64 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -439,7 +439,15 @@ struct ttm_bo_driver {
 	void *(*sync_obj_ref) (void *sync_obj);
 
 	/* hook to notify driver about a driver move so it
-	 * can do tiling things */
+	 * can do tiling things. This hook can be used to tear
+	 * down driver private GPU mappings from the BO. It should not,
+	 * however be used to set up such mappings, since TTM will not
+	 * call this hook when SYSTEM placed bos are populated with pages.
+	 * It's recommended that populating driver private GPU maps is
+	 * done from the command-submission code, where the driver has
+	 * a more detailed knowledge of exactly what GPU maps need
+	 * populating.
+	 */
 	void (*move_notify)(struct ttm_buffer_object *bo,
 			    struct ttm_mem_reg *new_mem);
 	/* notify the driver we are taking a fault on this BO
@@ -447,7 +455,9 @@ struct ttm_bo_driver {
 	int (*fault_reserve_notify)(struct ttm_buffer_object *bo);
 
 	/**
-	 * notify the driver that we're about to swap out this bo
+	 * notify the driver that we're about to swap out this bo.
+	 * Any driver private GPU maps pointing to the bo should be
+	 * teared down at this point.
 	 */
 	void (*swap_notify) (struct ttm_buffer_object *bo);
 
-- 
1.7.4.4



More information about the dri-devel mailing list