]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe: Add helper to extend CPU-mirrored VMA range for merge
authorHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Tue, 25 Nov 2025 07:56:24 +0000 (13:26 +0530)
committerHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Wed, 26 Nov 2025 10:12:33 +0000 (15:42 +0530)
commit5b12958b1ffa7db44c276b2d394f3ddb9e0ebaca
tree70163e3e37c0fc797d40456e8dcf5618a9638957
parent07cf4b864f523f01d2bb522a05813df30b076ba8
drm/xe: Add helper to extend CPU-mirrored VMA range for merge

Introduce xe_vm_find_cpu_addr_mirror_vma_range(), which computes an
extended range around a given range by including adjacent VMAs that are
CPU-address-mirrored and have default memory attributes. This helper is
useful for determining mergeable range without performing the actual merge.

v2
- Add assert
- Move unmap check to this patch

v3
- Decrease offset to check by SZ_4K to avoid wrong vma return in fast
  lookup path

v4
- *start should be >= SZ_4K (Matt)

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20251125075628.1182481-2-himal.prasad.ghimiray@intel.com
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm.h