Blob Blame History Raw
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Wed, 28 Feb 2018 09:48:22 +0100
Subject: drm/ttm: move initializing ttm->sg into ttm_tt_init_fields
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 536bbeba9bd9ab6dc9d175a76a04aa10ea049fea
Patch-mainline: v4.17-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

Better to set this with all other fields as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/ttm/ttm_tt.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -77,9 +77,6 @@ int ttm_tt_create(struct ttm_buffer_obje
 	if (unlikely(bo->ttm == NULL))
 		return -ENOMEM;
 
-	if (bo->type == ttm_bo_type_sg)
-		bo->ttm->sg = bo->sg;
-
 	return 0;
 }
 
@@ -245,6 +242,7 @@ void ttm_tt_init_fields(struct ttm_tt *t
 	ttm->page_flags = page_flags;
 	ttm->state = tt_unpopulated;
 	ttm->swap_storage = NULL;
+	ttm->sg = bo->sg;
 }
 
 int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,