From: Nareshkumar Gollakoti <naresh.kumar.g@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: himal.prasad.ghimiray@intel.com, naresh.kumar.g@intel.com
Subject: [PATCH v3 6/8] drm/xe/vm: propagate BO page-size requirements to VMA map flags
Date: Sun, 12 Jul 2026 16:45:15 +0530 [thread overview]
Message-ID: <20260712111517.1956177-7-naresh.kumar.g@intel.com> (raw)
In-Reply-To: <20260712111517.1956177-1-naresh.kumar.g@intel.com>
Propagate user BO page-size requirement flags into VM bind map
operations.
When a user BO carries a page-size requirement flag, set the
corresponding VMA PTE flag during bind-op construction. This covers
64K, 2M, and 1G page sizes and allows the debug page-size allocation
policy selected at BO creation time to be reflected in page-table
mapping behavior.
v3
- BO page-size requirement overrides prior map-state flags
- reword commit message
Signed-off-by: Nareshkumar Gollakoti <naresh.kumar.g@intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 080c2fff0e95..96d4e6ee4ffa 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -2390,6 +2390,26 @@ static void xe_svm_prefetch_gpuva_ops_fini(struct drm_gpuva_ops *ops)
}
}
+static void xe_vma_apply_debug_page_size_flag(struct xe_vm *vm,
+ struct xe_vma_op *op,
+ struct xe_bo *bo)
+{
+ if (!bo)
+ return;
+
+ if (!(bo->flags & XE_BO_FLAG_USER))
+ return;
+
+ op->map.vma_flags &= ~(XE_VMA_PTE_64K | XE_VMA_PTE_2M | XE_VMA_PTE_1G);
+
+ if (bo->flags & XE_BO_FLAG_NEEDS_1G)
+ op->map.vma_flags |= XE_VMA_PTE_1G;
+ else if (bo->flags & XE_BO_FLAG_NEEDS_2M)
+ op->map.vma_flags |= XE_VMA_PTE_2M;
+ else if (bo->flags & XE_BO_FLAG_NEEDS_64K)
+ op->map.vma_flags |= XE_VMA_PTE_64K;
+}
+
/*
* Create operations list from IOCTL arguments, setup operations fields so parse
* and commit steps are decoupled from IOCTL arguments. This step can fail.
@@ -2485,6 +2505,11 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_vma_ops *vops,
op->map.pat_index = pat_index;
op->map.invalidate_on_bind =
__xe_vm_needs_clear_scratch_pages(vm, flags);
+ /*
+ * Propagate debug BO page-size selection into the VMA mapping flags for
+ * user BO binds.
+ */
+ xe_vma_apply_debug_page_size_flag(vm, op, bo);
} else if (__op->op == DRM_GPUVA_OP_PREFETCH) {
struct xe_vma *vma = gpuva_to_vma(op->base.prefetch.va);
struct xe_tile *tile;
--
2.43.0
next prev parent reply other threads:[~2026-07-12 11:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-12 11:15 [PATCH v3 0/8] drm/xe:add page size allocation mode control and coverage Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 1/8] drm/xe: add page size allocation control state to xe_device Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 2/8] drm/xe/debugfs: add page-size allocation mode knob Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 3/8] drm/xe: add Kconfig option for debug page-size allocation control Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 4/8] drm/xe: add XE_BO_FLAG_NEEDS_1G for minimum page-size sizing Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 5/8] drm/xe: apply debug page-size allocation policy to user BOs Nareshkumar Gollakoti
2026-07-12 11:15 ` Nareshkumar Gollakoti [this message]
2026-07-12 11:15 ` [PATCH v3 7/8] drm/xe/pt: allow selecting the bind leaf PTE level Nareshkumar Gollakoti
2026-07-12 11:15 ` [PATCH v3 8/8] drm/xe/tests: add live KUnit coverage for BO page-size allocation modes Nareshkumar Gollakoti
2026-07-12 11:21 ` ✗ CI.checkpatch: warning for drm/xe:add page size allocation mode control and coverage Patchwork
2026-07-12 11:22 ` ✓ CI.KUnit: success " Patchwork
2026-07-13 4:46 ` [PATCH v3 0/8] " Simon Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260712111517.1956177-7-naresh.kumar.g@intel.com \
--to=naresh.kumar.g@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox