From: Matthew Brost <matthew.brost@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
<thomas.hellstrom@linux.intel.com>, <oak.zeng@intel.com>
Subject: Re: [RFC 03/12] drm/xe/svm: Helper to add tile masks to svm ranges
Date: Mon, 10 Mar 2025 12:19:49 -0700 [thread overview]
Message-ID: <Z887VQswA/FNaBYX@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250310124341.1819568-4-himal.prasad.ghimiray@intel.com>
On Mon, Mar 10, 2025 at 06:13:32PM +0530, Himal Prasad Ghimiray wrote:
> 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>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@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 ffaf0d02dc7d..cf7a6ba2aec8 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -2178,6 +2178,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,
> @@ -2232,12 +2242,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-03-10 19:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 12:43 [RFC 00/12] Prefetch Support for svm ranges Himal Prasad Ghimiray
2025-03-10 12:35 ` ✓ CI.Patch_applied: success for " Patchwork
2025-03-10 12:35 ` ✓ CI.checkpatch: " Patchwork
2025-03-10 12:36 ` ✓ CI.KUnit: " Patchwork
2025-03-10 12:43 ` [RFC 01/12] drm/xe: Introduce xe_vma_op_prefetch_range struct for prefetch of ranges Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 02/12] drm/xe: Make xe_svm_alloc_vram public Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 03/12] drm/xe/svm: Helper to add tile masks to svm ranges Himal Prasad Ghimiray
2025-03-10 19:19 ` Matthew Brost [this message]
2025-03-11 6:26 ` Ghimiray, Himal Prasad
2025-03-10 12:43 ` [RFC 04/12] drm/xe/svm: Make to_xe_range a public function Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 05/12] drm/xe/svm: Make xe_svm_range_* end/start/size public Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 06/12] drm/xe/vm: Update xe_vma_ops_incr_pt_update_ops to take an increment value Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 07/12] drm/xe/vm: Add an identifier in xe_vma_ops for svm prefetch Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 08/12] drm/xe: Rename lookup_vma function to xe_find_vma_by_addr Himal Prasad Ghimiray
2025-03-28 2:58 ` Matthew Brost
2025-03-10 12:43 ` [RFC 09/12] drm/xe/svm: Allow unaligned addresses and ranges for prefetch Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 10/12] drm/xe/svm: Refactor usage of drm_gpusvm* function in xe_svm Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 11/12] drm/xe/svm: Implement prefetch support for SVM ranges Himal Prasad Ghimiray
2025-03-10 12:43 ` [RFC 12/12] drm/xe/vm: Add debug prints for SVM range prefetch Himal Prasad Ghimiray
2025-03-11 6:27 ` Ghimiray, Himal Prasad
2025-03-10 12:53 ` ✓ CI.Build: success for Prefetch Support for svm ranges Patchwork
2025-03-10 12:55 ` ✗ CI.Hooks: failure " Patchwork
2025-03-10 12:56 ` ✓ CI.checksparse: success " Patchwork
2025-03-10 13:17 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-11 8:57 ` ✗ Xe.CI.Full: failure " 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=Z887VQswA/FNaBYX@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=oak.zeng@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox