Skip to contentSkip to conversation

drm/ttm: call driver move_notify() when doing system->tt bo moves

PATCH In review Ben Skeggs 2 participants 2 messages Feb 2, 2011

Subsystems (3)
lore
Share & tools
lore

Ben Skeggs

author
#0 lore raw

PATCH 1/1 drm/ttm: call driver move_notify() when doing system->tt bo moves

From: Ben Skeggs <[email protected]>

Nouveau doesn't have enough information at ttm_backend_func.bind() time to implement things like tiled GART, or to keep a buffer at a constant address in the GPU virtual address space no matter where in physical memory it's placed.

To resolve this, nouveau will handle binding of all buffers to the GPU itself from the move_notify() hook. This commit ensures it's called for all buffer moves.

Talked to Dave about the impact on radeon, which uses move_notify, it doesn't look like anything should break there.

---
 drivers/gpu/drm/ttm/ttm_bo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index af61fc2..0b6a55a 100644
@@ -406,11 +406,12 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 		}
 
 		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
+			if (bdev->driver->move_notify)
+				bdev->driver->move_notify(bo, mem);
 			bo->mem = *mem;
 			mem->mm_node = NULL;
 			goto moved;
 		}
-
 	}
 
 	if (bdev->driver->move_notify)
Signature · 1 line
1.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 42 lines · Ben Skeggs

From: Ben Skeggs <[email protected]>

Nouveau doesn't have enough information at ttm_backend_func.bind() time to implement things like tiled GART, or to keep a buffer at a constant address in the GPU virtual address space no matter where in physical memory it's placed.

To resolve this, nouveau will handle binding of all buffers to the GPU itself from the move_notify() hook. This commit ensures it's called for all buffer moves.

Talked to Dave about the impact on radeon, which uses move_notify, it doesn't look like anything should break there.

---
 drivers/gpu/drm/ttm/ttm_bo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index af61fc2..0b6a55a 100644
@@ -406,11 +406,12 @@ static int ttm_bo_handle_move_mem(struct
 ttm_buffer_object *bo,
 		}
 
 		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
+			if (bdev->driver->move_notify)
+				bdev->driver->move_notify(bo, mem);
 			bo->mem = *mem;
 			mem->mm_node = NULL;
 			goto moved;
 		}
-
 	}
 

if (bdev->driver->move_notify)
--
1.7.4