Commit ae1bef72 authored by Lang Yu's avatar Lang Yu Committed by Andrey Grodzovsky

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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210622162339.761651-1-andrey.grodzovsky@amd.com
parent 40379792
......@@ -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];
......
......@@ -47,8 +47,11 @@
* top of the memory area, instead of the bottom.
*/
#define TTM_PL_FLAG_CONTIGUOUS (1 << 19)
#define TTM_PL_FLAG_TOPDOWN (1 << 22)
#define TTM_PL_FLAG_CONTIGUOUS (1 << 0)
#define TTM_PL_FLAG_TOPDOWN (1 << 1)
/* For multihop handling */
#define TTM_PL_FLAG_TEMPORARY (1 << 2)
/**
* struct ttm_place
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment