[Nouveau] [PATCH 1/3] drm/ttm: make sure that we always zero init mem.bus

Christian König ckoenig.leichtzumerken at gmail.com
Fri Aug 21 16:00:48 UTC 2020


We are trying to remove the io_lru handling and depend
on zero init base and offset here.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index e3931e515906..60b583d07b04 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -650,6 +650,8 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
 	evict_mem.mm_node = NULL;
 	evict_mem.bus.io_reserved_vm = false;
 	evict_mem.bus.io_reserved_count = 0;
+	evict_mem.bus.base = 0;
+	evict_mem.bus.offset = 0;
 
 	ret = ttm_bo_mem_space(bo, &placement, &evict_mem, ctx);
 	if (ret) {
@@ -1084,6 +1086,8 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
 	mem.page_alignment = bo->mem.page_alignment;
 	mem.bus.io_reserved_vm = false;
 	mem.bus.io_reserved_count = 0;
+	mem.bus.base = 0;
+	mem.bus.offset = 0;
 	mem.mm_node = NULL;
 
 	/*
@@ -1243,6 +1247,8 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
 	bo->mem.page_alignment = page_alignment;
 	bo->mem.bus.io_reserved_vm = false;
 	bo->mem.bus.io_reserved_count = 0;
+	bo->mem.bus.base = 0;
+	bo->mem.bus.offset = 0;
 	bo->moving = NULL;
 	bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
 	bo->acc_size = acc_size;
-- 
2.17.1



More information about the Nouveau mailing list