summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorLang Yu <Lang.Yu@amd.com>2021-06-22 19:23:34 +0300
committerAndrey Grodzovsky <andrey.grodzovsky@amd.com>2021-06-23 21:59:39 +0300
commitae1bef72c20f9231898e2f5595751a2635d49db8 (patch)
tree8e7361ebdcce7284e69f78c993bc82594fb5fdcd /drivers/gpu/drm/ttm
parent403797925768d9fa870f5b1ebcd20016b397083b (diff)
downloadlinux-ae1bef72c20f9231898e2f5595751a2635d49db8.tar.xz
drm/ttm: add TTM_PL_FLAG_TEMPORARY flag v3
Sometimes drivers need to use bounce buffers to evict BOs. While those reside in some domain they are not necessarily suitable for CS. Add a flag so that drivers can note that a bounce buffers needs to be reallocated during validation. v2: add detailed comments v3 (chk): merge commits and rework commit message Suggested-by: Christian König <christian.koenig@amd.com> Signed-off-by: Lang Yu <Lang.Yu@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Acked-by: Nirmoy Das <nirmoy.das@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-1-andrey.grodzovsky@amd.com
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 6c78149360c4..5a2dc712c632 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -918,6 +918,9 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
{
unsigned i;
+ if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+ return false;
+
for (i = 0; i < num_placement; i++) {
const struct ttm_place *heap = &places[i];