summaryrefslogtreecommitdiff
path: root/lib/xe/xe_ioctl.c
AgeCommit message (Collapse)AuthorFilesLines
2026-05-29lib/xe: add xe_exec_queue_create_class_gtJuha-Pekka Heikkila1-0/+20
add function to create exec queue with class and gt id Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
2026-04-28lib/xe: Add failable variant of xe_vm_bind_lr_sync()Sobin Thomas1-9/+24
Add __xe_vm_bind_lr_sync helper function which returns standard error codes instead of asserting on failure. This allows calling function to handle VM bind failures explicitly while preserving the existing xe_vm_bind_lr_sync() wrapper for tests. This enables callers that expect bind / overcommit failures. v7: Introduced xe_vm_bind_lr_sync_failable (Thomas) v8: Modified xe_vm_bind_lr_sync_failable and xe_vm_bind_lr_sync to call __xe_vm_bind_lr_sync v9: Removed redundant typecast and removed xe_vm_bind_lr_sync_failable Signed-off-by: Sobin Thomas <sobin.thomas@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2026-04-17lib/xe: Add purgeable memory ioctl supportArvind Yadav1-0/+33
Add xe_vm_madvise_purgeable() helper function to support purgeable memory management through the XE madvise ioctl. This allows applications to hint to the kernel about buffer object usage patterns for better memory management under pressure. The function provides a clean interface to: - Mark buffer objects as DONTNEED (purgeable) - Mark buffer objects as WILLNEED (not purgeable) Returns the retained value directly (1 if backing store exists, 0 if purged). Also update __xe_vm_madvise() to reject purgeable state operations and direct users to the dedicated helper. Here purgeable state requires an output (retained_ptr) field, which does not fit the generic type/op_val model of __xe_vm_madvise(). Add a dedicated helper that populates the purgeable-specific ioctl fields and returns the retained value directly. Cc: Matthew Brost <matthew.brost@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Pravalika Gurram <pravalika.gurram@intel.com> Reviewed-by: Nishit Sharma <nishit.sharma@intel.com> Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
2026-04-04lib/xe/xe_ioctl: Add xe_vm_get_property helper functionJonathan Cavitt1-0/+5
Add a helper function, xe_vm_get_property, that calls the drm_xe_vm_get_property ioctl. Since the ioctl behaves similarly to an xe_query in that it needs to be called once to get the size of the return data and again to save the data, the helper function takes the ioctl structure as a parameter. Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Reviewed-by: Nishit Sharma <nishit.sharma@intel.com>
2026-03-14lib/xe: Introduce aligned buffer mappingNishit Sharma1-0/+46
Added aligned buffer mapping which is providing an interface for mapping buffer objects with a specified alignment. This API improves cross-platform compatibility and simplifies batch buffer setup by eliminating the need for platform-specific address handling. Signed-off-by: Thomas Hellstrom <thomas.hellstrom@intel.com> Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2026-01-05lib/xe: Add synchronous helpers for VM bind/unbind operationsNishit Sharma1-0/+39
Introduce synchronous wrappers for VM bind/unbind operations that handle user fence allocation, waiting, and cleanup internally. This simplifies test code by eliminating repetitive synchronization boilerplate. Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Pravalika Gurram <pravalika.gurram@intel.com>
2026-01-05lib/xe: Add instance parameter to xe_vm_madviseNishit Sharma1-4/+9
tests/intel/xe_exec_system_allocator: Add parameter in madvise call Add an 'instance' parameter to __xe_vm_madvise() and xe_vm_madvise() to specify which VRAM instance should be targeted for memory advise operations. Getting compilation issues in xe_exec_system_allocator test after adding 'instance' parameters in xe_vm_madvise(). As a fix 0 as instance parameter passed in xe_vm_madvise() calls available in xe_exec_system_allocator test. Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Reviewed-by: Pravalika Gurram <pravalika.gurram@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2025-12-12lib/xe: Add exec_queue set_property ioctl supportNiranjana Vishwanathapura1-0/+27
Add infrastructure to support xe_exec_queue_set_property_ioctl() Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Reviewed-by: Stuart Summers <stuart.summers@intel.com> Link: https://lore.kernel.org/r/20251212011115.1685703-29-niranjana.vishwanathapura@intel.com
2025-09-19tests/intel/xe_exec_system_allocator: Add pat-index-madvisePravalika Gurram1-10/+19
Add pat-index-madvise test to verify setting different pat_index values for multiple VMAs. These subtests use madvise to set various pat_index values and verifies that different PAT values can be assigned to multiple VMAs as expected. v2: - Remove macro which is not needed and alignment (Nishit) - use existing struct by adding new member - Remove num_ranges to NULL assignment v3: code style (Nishit) v4: skip compression related PAT index on iGPUs (Ashutosh) Signed-off-by: Pravalika Gurram <pravalika.gurram@intel.com> Reviewed-by: Nishit Sharma <nishit.sharma@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Himal Prasad <himal.prasad.ghimiray@intel.com> Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Acked-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2025-09-11lib/xe_ioctl: use valid type for boZbigniew Kempczyński1-1/+1
Fix bo handle type as it is uint32_t, not uint16_t. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2025-09-08lib/xe: Add Helper to get memory attributesNishit Sharma1-0/+91
xe_vm_print_mem_attr_values_in_range() function added which calls QUERY_MEM_RANGES_ATTRS ioctl to get different memory attributes from KMD and then prints memory attributes returned by KMD for different access policies like atomic access, preferred loc and pat index. Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Reviewed-by: Pravalika Gurram <pravalika.gurram@intel.com>
2025-09-08lib/xe: Add xe_vm_madvise ioctl supportNishit Sharma1-0/+57
xe_vm_madvise() defined which issues madvise ioctl DRM_IOCTL_XE_MADVISE for VM region advising the driver about expected usage or memory policy for specified address range. MADVISE ioctl requires pointer to drm_xe_madvise structure as one of the inputs. Depending upon type of madvise operation like Atomic, Preferred LOC or PAT required members of drm_xe_madvise structure are initialized and passed in MADVISE ioctl. Signed-off-by: Nishit Sharma <nishit.sharma@intel.com> Reviewed-by: Pravalika Gurram <pravalika.gurram@intel.com>
2025-06-02lib/xe_gt: Move reset related function to xe_gt.cMichal Wajdeczko1-23/+0
Those helper functions are per GT and related query function is already there. While around add simple documentation. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2025-04-28lib/xe/xe_ioctl: Fix compilation on 32-bit armhfKamil Konieczny1-1/+1
Fix some compilation errors on 32-bit platforms like armhf: ../lib/xe/xe_ioctl.c:443:7: error: conflicting types for xe_bo_map_fixed void *xe_bo_map_fixed(int fd, uint32_t bo, size_t size, uint64_t addr) ^~~~~~~~~~~~~~~ In file included from ../lib/xe/xe_ioctl.c:46: ../lib/xe/xe_ioctl.h:89:7: note: previous declaration of xe_bo_map_fixed was here void *xe_bo_map_fixed(int fd, uint32_t bo, size_t size, long unsigned int addr); ^~~~~~~~~~~~~~~ ../lib/xe/xe_ioctl.c: In function xe_bo_map_fixed: ../lib/xe/xe_ioctl.c:449:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] map = mmap((void *)addr, size, PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, mmo); ^ cc1: some warnings being treated as errors Fixes: 9eda33fedff7 ("tests/xe: Add system_allocator test") Cc: Matthew Brost <matthew.brost@intel.com> Cc: Jonathan Cavitt <jonathan.cavitt@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2025-04-25tests/xe: Add system_allocator testMatthew Brost1-0/+12
Test various uses of system allocator in single thread, multiple threads, and multiple processes. Features tested: - Malloc with various size - Mmap with various sizes and flags including file backed mappings - Mixing BO allocations with system allocator - Various page sizes - Dynamically freeing / unmapping memory - Sharing VM across threads - Faults racing on different hardware engines / GTs / Tiles - GPU faults and CPU faults racing - CPU faults on multiple threads racing - CPU faults on multiple process racing - GPU faults of memory not faulted in by CPU - Partial unmap of allocations - Attempting to unmap system allocations when GPU has mappings - Eviction of both system allocations and BOs - Forking child processes and reading data from VRAM - mremap data in VRAM - Protection changes - Multiple faults per execbuf Running on LNL, BMG, PVC 1 tile, and PVC 2 tile. v2: - Rebase - Fix memory allocation to not interfear with malloc (Thomas) v3: - Fix memory leak (Francois) - Break out uAPI into own patch (Francois) - Use mkstemp for sync file (Francois) - Use mkstemp for file backed data (Francois) - Drop i argument from READ_VALUE (Francois) - Fix test description (Francois) - Add comment to check_all_pages_process (Francois) - Prefer igt_info over printf (Francois) - Fix types in messages (Francois) - Prefer odd macro (Francois) v4: - Fix alignment (Johnathan) v5: - Add ifdef for MREMAP_DONTUNMAP (build error) Cc: Jonathan Cavitt <jonathan.cavitt@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
2025-04-25Revert "tests/xe: Add system_allocator test"Kamil Konieczny1-12/+0
This reverts commit 41ee4d698fd87085494ceeec1985a2b99222c5b0. Fix compilation failure on our containers: ../tests/intel/xe_exec_system_allocator.c: In function test_exec: ../tests/intel/xe_exec_system_allocator.c:1210:21: error: MREMAP_DONTUNMAP undeclared (first use in this function); did you mean DONTUNMAP? remap_flags |= MREMAP_DONTUNMAP; Cc: Matthew Brost <matthew.brost@intel.com> Cc: Jonathan Cavitt <jonathan.cavitt@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2025-04-25tests/xe: Add system_allocator testMatthew Brost1-0/+12
Test various uses of system allocator in single thread, multiple threads, and multiple processes. Features tested: - Malloc with various size - Mmap with various sizes and flags including file backed mappings - Mixing BO allocations with system allocator - Various page sizes - Dynamically freeing / unmapping memory - Sharing VM across threads - Faults racing on different hardware engines / GTs / Tiles - GPU faults and CPU faults racing - CPU faults on multiple threads racing - CPU faults on multiple process racing - GPU faults of memory not faulted in by CPU - Partial unmap of allocations - Attempting to unmap system allocations when GPU has mappings - Eviction of both system allocations and BOs - Forking child processes and reading data from VRAM - mremap data in VRAM - Protection changes - Multiple faults per execbuf Running on LNL, BMG, PVC 1 tile, and PVC 2 tile. v2: - Rebase - Fix memory allocation to not interfear with malloc (Thomas) v3: - Fix memory leak (Francois) - Break out uAPI into own patch (Francois) - Use mkstemp for sync file (Francois) - Use mkstemp for file backed data (Francois) - Drop i argument from READ_VALUE (Francois) - Fix test description (Francois) - Add comment to check_all_pages_process (Francois) - Prefer igt_info over printf (Francois) - Fix types in messages (Francois) - Prefer odd macro (Francois) v4: - Fix alignment (Johnathan) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Reviewed-by: Francois Dugast <francois.dugast@intel.com>
2025-04-08tests/intel/xe_pxp: Termination testsDaniele Ceraolo Spurio1-3/+32
There are several events that can cause the PXP key to be invalidated and trigger a PXP termination (suspend, PXP termination irq). After a termination, we expect the key to be different and the raw encrypted data to change for the same source data. Additionally, all PXP objects are invalidated during a termination and can no longer be used in submission or kept mapped to VMs; we therefore need to test both the execution and bind ioctls to make sure they work as expected after a termination. v2: move igt_require calls inside the subtest v3: block rpm for tests trying a different type of termination, rework invalid bind test to try a new vm as well (Alan) v4: move file open and igt_require() inside the subtest (Kamil) v5: add documentation for new helpers (Kamil), turn off display in RPM tests. Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
2025-04-08tests/intel/xe_pxp: Add PXP object and queue creation testsDaniele Ceraolo Spurio1-5/+9
PXP support introduces new SET_PROPERTY extensions to both BOs and exec_queues to mark them as being used for PXP workloads, so we need to test both correct and incorrect usage of those new interfaces. Since this is the first usage of extensions for BO creation, the common BO code has been update to support the extra parameter. v2: fix memory lead, remove unneeded igt_require (Alan) Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
2024-09-19lib/xe_ioctl: Add wrapper with vm_bind_op extension parameterChristoph Manszewski1-4/+16
Currently there is no way to set drm_xe_vm_bind_op extension field. Add vm_bind wrapper that allows pass this field as a parameter. Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com> Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Link: https://lore.kernel.org/r/20240918113017.144687-2-christoph.manszewski@intel.com
2024-06-06lib/xe: Add sync and async xe_force_gt_reset optionsJonathan Cavitt1-3/+13
Add a new xe_force_gt_reset function, xe_force_gt_reset_sync, renaming the original xe_force_gt_reset to xe_force_gt_reset_async. This allows the user to decide whether or not they want to initiate a synchronous or asynchronous gt reset. The asynchronous reset function was otherwise unchanged, but the synchronous reset function operates by calling a new debugfs function. For now, default to using the asynchronous version for all current use cases. v2: - Add *async and *sync versions of xe_force_gt_reset (Matthew Brost) v3: - Fix compile error v4: - Use helper function for xe_force_gt_reset_[sync|async] functions to reduce code duplication (Matthew Brost) - Add missing revision notes Suggested-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> CC: John Harrison <john.c.harrison@intel.com> CC: Stuart Summers <stuart.summers@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://lore.kernel.org/r/20240605175843.2789838-2-jonathan.cavitt@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2024-04-01lib/xe: Update __xe_exec_queue_create()Niranjana Vishwanathapura1-4/+4
Add ability to specify width and num_placement in __xe_exec_queue_create() call. Use __xe_exec_queue_create() instead of ioctl calls in the tests. Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Reviewed-by: Pallavi Mishra <pallavi.mishra@intel.com> Reviewed-by: Jagmeet Randhawa <jagmeet.randhawa@intel.com> Link: https://lore.kernel.org/r/20240401202520.17572-1-niranjana.vishwanathapura@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2024-01-26lib/xe/ioctl: introduce xe_bb_size() helperMatthew Auld1-0/+6
We have a number of tests open coding this, plus some tests lacking any handling for the prefetch size, leading to CAT errors due to overfetch hitting an invalid page. End goal is to fix all the tests that are missing the overfetch handling first, using the new helper, and then convert all the places that were open coding this. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2024-01-23tests/xe_waitfence: Removed duplicate code in waitfenceBommu Krishnaiah1-35/+0
Removed duplicate code in xe_waitfence@waitfence Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2024-01-22lib/xe: Boost prefetch size to 4KBLucas De Marchi1-1/+1
For Xe2, the prefetch for RCS is 4KB, so boost it. BSpec: 60223 Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2023-12-15drm-uapi/xe: Remove sync bindsMatthew Brost1-28/+20
Align with commit ("drm/xe/uapi: Remove sync binds") v2: Fix exec_queue_reset_wait in xe_waitfence.c (Francois Dugast) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-12-15drm-uapi/xe: add exec_queue_id member to drm_xe_wait_user_fence structureBommu Krishnaiah1-16/+13
remove the num_engines/instances members from drm_xe_wait_user_fence structure and add a exec_queue_id member Right now this is only checking if the engine list is sane and nothing else. In the end every operation with this IOCTL is a soft check. So, let's formalize that and only use this IOCTL to wait on the fence. exec_queue_id member will help to user space to get proper error code from kernel while in exec_queue reset v2: Also fix test invalid_flag (Francois Dugast) v3: Replace -ETIME with -EIO in test_compute_mode (Brian Welty) Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-12-11lib/xe_ioctl: fix default cpu_caching helperMatthew Auld1-3/+3
The placement and flags were split in some recent refactoring, but looks like we forgot to update __xe_default_cpu_caching_from_placement to account for flags and placement. In particular we are no longer considering the FLAG_SCANOUT here. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Francois Dugast <francois.dugast@intel.com>
2023-12-08lib/xe: Add __xe_exec_queue_create()Niranjana Vishwanathapura1-5/+24
Add __xe_exec_queue_create() which does not assert upon error. v2: Change __xe_exec_queue_create() return type to int. Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2023-12-06lib/xe_ioctl: Add __xe_wait_ufence()Brian Welty1-6/+45
xe_wait_ufence is expected to fail if GPU hangs or is reset. We need a version of calling XE_WAIT_USER_FENCE without the assertion that it won't expire (timeout), for use with IGTs that intentionally cause hangs or reset. Signed-off-by: Brian Welty <brian.welty@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-12-05drm-uapi/xe: Split xe_sync types from flagsFrancois Dugast1-1/+2
Align with commit ("drm/xe/uapi: Split xe_sync types from flags") Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-12-05drm-uapi/xe: Separate bo_create placement from flagsRodrigo Vivi1-19/+20
Align with kernel commit ("drm/xe/uapi: Separate bo_create placement from flags") Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-12-05xe_query: Kill visible_vram_if_possibleRodrigo Vivi1-0/+19
Let the caller set the flag and the xe_bo_query clear if not needed. Although the current helper makes the code cleaner, the goal is to split the flags into placement and flags as two different arguments on xe_bo_create. So, the flag decision cannot be hidden under the helper. v2: Fix one comment (Kamil Konieczny) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-12-05xe_ioctl: Rename *xe_bo_create_flags to simply xe_bo_createRodrigo Vivi1-6/+6
Now that we have only one variant we can unify to the simplest version. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-12-05xe_ioctl: Converge bo_create to the most used versionRodrigo Vivi1-10/+0
Let's unify the call instead of having 2 separated options for the same goal. v2: Fix some xe_bo_create_flags arguments, remove extra new line (Kamil Konieczny) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-11-29lib/xe_ioctl: update vm_bind to account for pat_indexMatthew Auld1-2/+6
Keep things minimal and select the 1way+ by default on all platforms. Other users can use intel_buf, get_offset_pat_index etc or use __xe_vm_bind() directly. Display tests don't directly use this interface. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Cc: Pallavi Mishra <pallavi.mishra@intel.com> Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
2023-11-29lib/xe: support explicit cpu_caching gem_createMatthew Auld1-11/+44
Most tests shouldn't about such things, so likely it's just a case of picking the most sane default. However we also add some helpers for the tests that do care. v2: Rebase on coh_mode removal Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Cc: Pallavi Mishra <pallavi.mishra@intel.com> Reviewed-by: Pallavi Mishra <pallavi.mishra@intel.com>
2023-11-17drm-uapi/xe: Be more specific about vm_bind prefetch regionRodrigo Vivi1-4/+4
Align with kernel commit ("drm/xe/uapi: Be more specific about the vm_bind prefetch region") Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-11-17drm-uapi/xe: Differentiate WAIT_OP from WAIT_MASKRodrigo Vivi1-4/+4
Align with kernel commit ("drm/xe/uapi: Differentiate WAIT_OP from WAIT_MASK") Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-11-17drm-uapi/xe: Add _FLAG to uAPI constants usable for flagsFrancois Dugast1-3/+3
Align with commit ("drm/xe/uapi: Add _FLAG to uAPI constants usable for flags") Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-11-17drm-uapi/xe: Add missing DRM_ prefix in uAPI constantsFrancois Dugast1-11/+11
Align with commit ("drm/xe/uapi: Add missing DRM_ prefix in uAPI constants") Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-11-16drm-uapi/xe: Kill VM_MADVISE IOCTL and the atomic testsRodrigo Vivi1-14/+0
Align with commit ("drm/xe/uapi: Kill VM_MADVISE IOCTL"). Cc: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2023-10-17xe: Update to new VM bind uAPIMatthew Brost1-11/+4
Sync vs. async changes and new error handling. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> [Rodrigo and Francois rebased and fixed conflicts]
2023-10-17drm-uapi/xe_drm: Separate VM_BIND's operation and flag, align with latest uapiFrancois Dugast1-15/+16
Align with commit ("drm/xe/uapi: Separate VM_BIND's operation and flag") Signed-off-by: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2023-08-02xe: Rename engine to exec_queueFrancois Dugast1-40/+40
Engine was inappropriately used to refer to execution queues and it also created some confusion with hardware engines. Update to the kernel header where this was fixed and also update variable names in tests. The xe_drm.h uapi header is now in sync with drm-xe-next commit ("drm/xe: Rename engine to exec_queue"). Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-07-25tests/xe/mmap: sanity check small-barMatthew Auld1-3/+17
Some basic sanity checks. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2023-07-24tests/xe: Boost command streamer prefetch sizeMatt Roper1-1/+1
The actual prefetch size variest by platform and by engine. MTL's RCS engine currently has the highest prefetch size of 2KB. Bspec: 45718 Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2023-07-13lib/xe_ioctl: Export non-assert xe_exec functionZbigniew Kempczyński1-1/+1
Export __xe_exec() helper to allow caller to handle the error individually. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Karolina Stolarek <karolina.stolarek@intel.com>
2023-06-19lib/xe_ioctl: Return remaining timeout of user fence waitZbigniew Kempczyński1-3/+5
When user fence is signalled we may want to be aware how long did it take. Return remaining timeout after fence was successfully signalled. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
2023-06-19lib/xe_ioctl: Add xe_wait_ufence_abstime() helperZbigniew Kempczyński1-0/+35
Xe user fences supports passing timeout in relative or absolute form. Add helper for absolute one. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>