diff options
author | Christian König <christian.koenig@amd.com> | 2018-02-28 03:48:22 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-14 15:38:28 -0400 |
commit | 536bbeba9bd9ab6dc9d175a76a04aa10ea049fea (patch) | |
tree | 9619b509b8fbd2101f9aa2676f952255ed26dd95 | |
parent | dde5da2379319c08ceb2295467df6e60a3cf5da1 (diff) |
drm/ttm: move initializing ttm->sg into ttm_tt_init_fields
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>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 65976238d24b..7e672be987b5 100644 --- 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_object *bo, bool zero_alloc) | |||
77 | if (unlikely(bo->ttm == NULL)) | 77 | if (unlikely(bo->ttm == NULL)) |
78 | return -ENOMEM; | 78 | return -ENOMEM; |
79 | 79 | ||
80 | if (bo->type == ttm_bo_type_sg) | ||
81 | bo->ttm->sg = bo->sg; | ||
82 | |||
83 | return 0; | 80 | return 0; |
84 | } | 81 | } |
85 | 82 | ||
@@ -245,6 +242,7 @@ void ttm_tt_init_fields(struct ttm_tt *ttm, struct ttm_buffer_object *bo, | |||
245 | ttm->page_flags = page_flags; | 242 | ttm->page_flags = page_flags; |
246 | ttm->state = tt_unpopulated; | 243 | ttm->state = tt_unpopulated; |
247 | ttm->swap_storage = NULL; | 244 | ttm->swap_storage = NULL; |
245 | ttm->sg = bo->sg; | ||
248 | } | 246 | } |
249 | 247 | ||
250 | int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo, | 248 | int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo, |