From: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: matthew.brost@intel.com, thomas.hellstrom@linux.intel.com,
Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Subject: [PATCH v5 08/20] drm/xe/svm: Helper to add tile masks to svm ranges
Date: Tue, 29 Apr 2025 16:12:21 +0530 [thread overview]
Message-ID: <20250429104233.215602-9-himal.prasad.ghimiray@intel.com> (raw)
In-Reply-To: <20250429104233.215602-1-himal.prasad.ghimiray@intel.com>
Introduce a helper to add tile mask of binding present and invalidated
for the range. Add a lockdep_assert to ensure it is protected by GPU SVM
notifier lock.
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_pt.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
index b42cf5d1b20c..de4e3edda758 100644
--- a/drivers/gpu/drm/xe/xe_pt.c
+++ b/drivers/gpu/drm/xe/xe_pt.c
@@ -2216,6 +2216,16 @@ static void unbind_op_commit(struct xe_vm *vm, struct xe_tile *tile,
}
}
+static void range_present_and_invalidated_tile(struct xe_vm *vm,
+ struct xe_svm_range *range,
+ u8 tile_id)
+{
+ lockdep_assert_held(&vm->svm.gpusvm.notifier_lock);
+
+ range->tile_present |= BIT(tile_id);
+ range->tile_invalidated &= ~BIT(tile_id);
+}
+
static void op_commit(struct xe_vm *vm,
struct xe_tile *tile,
struct xe_vm_pgtable_update_ops *pt_update_ops,
@@ -2270,12 +2280,11 @@ static void op_commit(struct xe_vm *vm,
}
case DRM_GPUVA_OP_DRIVER:
{
- if (op->subop == XE_VMA_SUBOP_MAP_RANGE) {
- op->map_range.range->tile_present |= BIT(tile->id);
- op->map_range.range->tile_invalidated &= ~BIT(tile->id);
- } else if (op->subop == XE_VMA_SUBOP_UNMAP_RANGE) {
+ if (op->subop == XE_VMA_SUBOP_MAP_RANGE)
+ range_present_and_invalidated_tile(vm, op->map_range.range, tile->id);
+ else if (op->subop == XE_VMA_SUBOP_UNMAP_RANGE)
op->unmap_range.range->tile_present &= ~BIT(tile->id);
- }
+
break;
}
default:
--
2.34.1
next prev parent reply other threads:[~2025-04-29 10:17 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 10:42 [PATCH v5 00/20] Prefetch Support for svm ranges Himal Prasad Ghimiray
2025-04-29 10:36 ` ✓ CI.Patch_applied: success for Prefetch Support for svm ranges (rev4) Patchwork
2025-04-29 10:37 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-29 10:38 ` ✓ CI.KUnit: success " Patchwork
2025-04-29 10:42 ` [PATCH v5 01/20] drm/gpusvm: Introduce devmem_only flag for allocation Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 02/20] drm/xe: Strict migration policy for atomic SVM faults Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 03/20] drm/gpusvm: Add timeslicing support to GPU SVM Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 04/20] drm/xe: Timeslice GPU on atomic SVM fault Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 05/20] drm/xe: Add atomic_svm_timeslice_ms debugfs entry Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 06/20] drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of ranges Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 07/20] drm/xe: Make xe_svm_alloc_vram public Himal Prasad Ghimiray
2025-04-29 10:42 ` Himal Prasad Ghimiray [this message]
2025-04-29 10:42 ` [PATCH v5 09/20] drm/xe/svm: Make to_xe_range a public function Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 10/20] drm/xe/svm: Make xe_svm_range_* end/start/size public Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 11/20] drm/xe/vm: Update xe_vma_ops_incr_pt_update_ops to take an increment value Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 12/20] drm/xe/vm: Add an identifier in xe_vma_ops for svm prefetch Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 13/20] drm/xe: Rename lookup_vma function to xe_find_vma_by_addr Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 14/20] drm/xe/svm: Refactor usage of drm_gpusvm* function in xe_svm Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 15/20] drm/xe/svm: Make xe_svm_range_needs_migrate_to_vram() public Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 16/20] drm/xe/svm: Add xe_svm_range_validate_and_evict() function Himal Prasad Ghimiray
2025-04-29 18:42 ` Matthew Brost
[not found] ` <9f3f41e3-f3d0-49d6-ad3f-e725d86cd210@intel.com>
2025-04-30 3:45 ` Ghimiray, Himal Prasad
2025-04-30 3:49 ` Matthew Brost
2025-04-29 10:42 ` [PATCH v5 17/20] drm/gpusvm: Introduce drm_gpusvm_range_find_or_insert_start() function Himal Prasad Ghimiray
2025-04-29 18:35 ` Matthew Brost
2025-04-30 3:40 ` Ghimiray, Himal Prasad
2025-04-30 4:21 ` Matthew Brost
2025-04-29 10:42 ` [PATCH v5 18/20] drm/xe/svm: Add xe_svm_range_find_or_insert_start() Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 19/20] drm/xe/svm: Implement prefetch support for SVM ranges Himal Prasad Ghimiray
2025-04-29 10:42 ` [PATCH v5 20/20] drm/xe/vm: Add debug prints for SVM range prefetch Himal Prasad Ghimiray
2025-04-29 10:46 ` ✓ CI.Build: success for Prefetch Support for svm ranges (rev4) Patchwork
2025-04-29 10:49 ` ✓ CI.Hooks: " Patchwork
2025-04-29 10:51 ` ✓ CI.checksparse: " Patchwork
2025-04-29 12:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-06 7:14 ` ✗ Xe.CI.BAT: " Patchwork
2025-05-06 7:51 ` ✓ Xe.CI.BAT: success " Patchwork
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=20250429104233.215602-9-himal.prasad.ghimiray@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.