Commit 8deba79f authored by Matthew Auld's avatar Matthew Auld Committed by Rodrigo Vivi

drm/xe: add XE_BO_CREATE_VRAM_MASK

So we don't have to keep repeating VRAM0 | VRAM1. Also if there are ever
more instances, then we have less places to update.
Suggested-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarGwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 7321a713
...@@ -999,8 +999,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo, ...@@ -999,8 +999,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
return bo; return bo;
} }
if (flags & (XE_BO_CREATE_VRAM0_BIT | XE_BO_CREATE_VRAM1_BIT | if (flags & (XE_BO_CREATE_VRAM_MASK | XE_BO_CREATE_STOLEN_BIT) &&
XE_BO_CREATE_STOLEN_BIT) &&
!(flags & XE_BO_CREATE_IGNORE_MIN_PAGE_SIZE_BIT) && !(flags & XE_BO_CREATE_IGNORE_MIN_PAGE_SIZE_BIT) &&
xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K) { xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K) {
size = ALIGN(size, SZ_64K); size = ALIGN(size, SZ_64K);
...@@ -1064,8 +1063,7 @@ static int __xe_bo_fixed_placement(struct xe_device *xe, ...@@ -1064,8 +1063,7 @@ static int __xe_bo_fixed_placement(struct xe_device *xe,
place->fpfn = start >> PAGE_SHIFT; place->fpfn = start >> PAGE_SHIFT;
place->lpfn = end >> PAGE_SHIFT; place->lpfn = end >> PAGE_SHIFT;
switch (flags & (XE_BO_CREATE_STOLEN_BIT | switch (flags & (XE_BO_CREATE_STOLEN_BIT | XE_BO_CREATE_VRAM_MASK)) {
XE_BO_CREATE_VRAM0_BIT |XE_BO_CREATE_VRAM1_BIT)) {
case XE_BO_CREATE_VRAM0_BIT: case XE_BO_CREATE_VRAM0_BIT:
place->mem_type = XE_PL_VRAM0; place->mem_type = XE_PL_VRAM0;
break; break;
...@@ -1771,7 +1769,7 @@ bool xe_bo_needs_ccs_pages(struct xe_bo *bo) ...@@ -1771,7 +1769,7 @@ bool xe_bo_needs_ccs_pages(struct xe_bo *bo)
{ {
return bo->ttm.type == ttm_bo_type_device && return bo->ttm.type == ttm_bo_type_device &&
!(bo->flags & XE_BO_CREATE_SYSTEM_BIT) && !(bo->flags & XE_BO_CREATE_SYSTEM_BIT) &&
(bo->flags & (XE_BO_CREATE_VRAM0_BIT | XE_BO_CREATE_VRAM1_BIT)); (bo->flags & XE_BO_CREATE_VRAM_MASK);
} }
/** /**
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#define XE_BO_CREATE_SYSTEM_BIT BIT(1) #define XE_BO_CREATE_SYSTEM_BIT BIT(1)
#define XE_BO_CREATE_VRAM0_BIT BIT(2) #define XE_BO_CREATE_VRAM0_BIT BIT(2)
#define XE_BO_CREATE_VRAM1_BIT BIT(3) #define XE_BO_CREATE_VRAM1_BIT BIT(3)
#define XE_BO_CREATE_VRAM_MASK (XE_BO_CREATE_VRAM0_BIT | \
XE_BO_CREATE_VRAM1_BIT)
/* -- */ /* -- */
#define XE_BO_CREATE_STOLEN_BIT BIT(4) #define XE_BO_CREATE_STOLEN_BIT BIT(4)
#define XE_BO_CREATE_VRAM_IF_DGFX(gt) \ #define XE_BO_CREATE_VRAM_IF_DGFX(gt) \
......
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