summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm/ttm_bo_util.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2020-07-21 09:58:13 +0200
committerChristian König <christian.koenig@amd.com>2020-07-31 17:13:09 +0200
commitbe1213a341a289afc51f89181c310e368fba0b66 (patch)
tree4821ba39873497faafa02a8ff1080cc513ccb6a5 /drivers/gpu/drm/ttm/ttm_bo_util.c
parent418d2ad1ac521acc46f74f6bcbc8c1158d077346 (diff)
drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2
Instead use a boolean field in the memory manager structure. Also invert the meaning of the field since the use of a TT structure is the special case here. v2: cleanup zero init. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/382079/
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo_util.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 7fb3e0bcbab4..1f502be0b646 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -384,7 +384,7 @@ out2:
*old_mem = *new_mem;
new_mem->mm_node = NULL;
- if (man->flags & TTM_MEMTYPE_FLAG_FIXED) {
+ if (!man->use_tt) {
ttm_tt_destroy(ttm);
bo->ttm = NULL;
}
@@ -645,7 +645,7 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
if (ret)
return ret;
- if (man->flags & TTM_MEMTYPE_FLAG_FIXED) {
+ if (!man->use_tt) {
ttm_tt_destroy(bo->ttm);
bo->ttm = NULL;
}
@@ -674,7 +674,7 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
* bo to be unbound and destroyed.
*/
- if (!(man->flags & TTM_MEMTYPE_FLAG_FIXED))
+ if (man->use_tt)
ghost_obj->ttm = NULL;
else
bo->ttm = NULL;
@@ -730,7 +730,7 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
* bo to be unbound and destroyed.
*/
- if (!(to->flags & TTM_MEMTYPE_FLAG_FIXED))
+ if (to->use_tt)
ghost_obj->ttm = NULL;
else
bo->ttm = NULL;
@@ -738,7 +738,7 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
dma_resv_unlock(&ghost_obj->base._resv);
ttm_bo_put(ghost_obj);
- } else if (from->flags & TTM_MEMTYPE_FLAG_FIXED) {
+ } else if (!from->use_tt) {
/**
* BO doesn't have a TTM we need to bind/unbind. Just remember
@@ -768,7 +768,7 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
if (ret)
return ret;
- if (to->flags & TTM_MEMTYPE_FLAG_FIXED) {
+ if (!to->use_tt) {
ttm_tt_destroy(bo->ttm);
bo->ttm = NULL;
}