Commit 6583b083 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Michał Winiarski

drm/xe: Allow VRAM BO allocations aligned to 64K

While today we are getting VRAM allocations aligned to 64K as the
XE_VRAM_FLAGS_NEED64K flag could be set, we shouldn't only rely on
that flag and we should also allow caller to specify required 64K
alignment explicitly.  Define new XE_BO_NEEDS_64K flag for that.

Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240313104132.1045-2-michal.wajdeczko@intel.comSigned-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
parent 54c65966
...@@ -1217,7 +1217,8 @@ struct xe_bo *___xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo, ...@@ -1217,7 +1217,8 @@ struct xe_bo *___xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
if (flags & (XE_BO_CREATE_VRAM_MASK | XE_BO_CREATE_STOLEN_BIT) && if (flags & (XE_BO_CREATE_VRAM_MASK | 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) ||
(flags & XE_BO_NEEDS_64K))) {
aligned_size = ALIGN(size, SZ_64K); aligned_size = ALIGN(size, SZ_64K);
if (type != ttm_bo_type_device) if (type != ttm_bo_type_device)
size = ALIGN(size, SZ_64K); size = ALIGN(size, SZ_64K);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#define XE_BO_PAGETABLE BIT(12) #define XE_BO_PAGETABLE BIT(12)
#define XE_BO_NEEDS_CPU_ACCESS BIT(13) #define XE_BO_NEEDS_CPU_ACCESS BIT(13)
#define XE_BO_NEEDS_UC BIT(14) #define XE_BO_NEEDS_UC BIT(14)
#define XE_BO_NEEDS_64K BIT(15)
/* this one is trigger internally only */ /* this one is trigger internally only */
#define XE_BO_INTERNAL_TEST BIT(30) #define XE_BO_INTERNAL_TEST BIT(30)
#define XE_BO_INTERNAL_64K BIT(31) #define XE_BO_INTERNAL_64K BIT(31)
......
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