Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: add TTM_PL_FLAG_CONTIGUOUS v2

This allows drivers to specify if they need a contiguous allocation or not.

v2: use space instead of tab

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
c8b26bd1 ea642c32

+4 -1
+3 -1
drivers/gpu/drm/ttm/ttm_bo.c
··· 1036 1036 1037 1037 *new_flags = heap->flags; 1038 1038 if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) && 1039 - (*new_flags & mem->placement & TTM_PL_MASK_MEM)) 1039 + (*new_flags & mem->placement & TTM_PL_MASK_MEM) && 1040 + (!(*new_flags & TTM_PL_FLAG_CONTIGUOUS) || 1041 + (mem->placement & TTM_PL_FLAG_CONTIGUOUS))) 1040 1042 return true; 1041 1043 } 1042 1044 return false;
+1
include/drm/ttm/ttm_placement.h
··· 63 63 #define TTM_PL_FLAG_CACHED (1 << 16) 64 64 #define TTM_PL_FLAG_UNCACHED (1 << 17) 65 65 #define TTM_PL_FLAG_WC (1 << 18) 66 + #define TTM_PL_FLAG_CONTIGUOUS (1 << 19) 66 67 #define TTM_PL_FLAG_NO_EVICT (1 << 21) 67 68 #define TTM_PL_FLAG_TOPDOWN (1 << 22) 68 69