diff options
author | Christian König <christian.koenig@amd.com> | 2019-05-13 15:42:52 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-05-31 10:39:34 -0500 |
commit | af1dac01a701a7cfc511d28c32ab5159c3c78c78 (patch) | |
tree | 352aa3908ff2c18b48d11dfceb5362988dc5841c /drivers/gpu | |
parent | b2f7a6161972a4ccd19ea14ea8d9afbdbda5c51d (diff) | |
download | linux-af1dac01a701a7cfc511d28c32ab5159c3c78c78.tar.bz2 |
drm/ttm: remove manual placement preference
If drivers don't prefer a system memory placement
they should not but it into the placement list first.
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 7b59e5ecde7f..702cd89adbf9 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1012,8 +1012,12 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, ttm_flag_masked(&cur_flags, place->flags, ~TTM_PL_MASK_MEMTYPE); - if (mem_type == TTM_PL_SYSTEM) - break; + if (mem_type == TTM_PL_SYSTEM) { + mem->mem_type = mem_type; + mem->placement = cur_flags; + mem->mm_node = NULL; + return 0; + } ret = (*man->func->get_node)(man, bo, place, mem); if (unlikely(ret)) @@ -1025,16 +1029,12 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, (*man->func->put_node)(man, mem); return ret; } - break; + mem->mem_type = mem_type; + mem->placement = cur_flags; + return 0; } } - if ((type_ok && (mem_type == TTM_PL_SYSTEM)) || mem->mm_node) { - mem->mem_type = mem_type; - mem->placement = cur_flags; - return 0; - } - for (i = 0; i < placement->num_busy_placement; ++i) { const struct ttm_place *place = &placement->busy_placement[i]; |