[PATCH i-g-t v2 07/66] lib/xe_ioctl: Add wrapper with vm_bind_op extension parameter
Piatkowski, Dominik Karol
dominik.karol.piatkowski at intel.com
Thu Aug 1 11:23:06 UTC 2024
Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>
> -----Original Message-----
> From: Manszewski, Christoph <christoph.manszewski at intel.com>
> Sent: Tuesday, July 30, 2024 1:44 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>; Kamil
> Konieczny <kamil.konieczny at linux.intel.com>; Grzegorzek, Dominik
> <dominik.grzegorzek at intel.com>; Patelczyk, Maciej
> <maciej.patelczyk at intel.com>; Piatkowski, Dominik Karol
> <dominik.karol.piatkowski at intel.com>; Sikora, Pawel
> <pawel.sikora at intel.com>; Hajda, Andrzej <andrzej.hajda at intel.com>;
> Kolanupaka Naveena <kolanupaka.naveena at intel.com>; Kuoppala, Mika
> <mika.kuoppala at intel.com>; Mun, Gwan-gyeong <gwan-
> gyeong.mun at intel.com>
> Subject: [PATCH i-g-t v2 07/66] lib/xe_ioctl: Add wrapper with vm_bind_op
> extension parameter
>
> 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 at linux.intel.com>
> Signed-off-by: Christoph Manszewski <christoph.manszewski at intel.com>
> ---
> lib/xe/xe_ioctl.c | 20 ++++++++++++++++---- lib/xe/xe_ioctl.h | 5 +++++
> 2 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c index ae43ffd15..6d8388918
> 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -96,15 +96,17 @@ void xe_vm_bind_array(int fd, uint32_t vm, uint32_t
> exec_queue,
> igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_VM_BIND, &bind), 0); }
>
> -int __xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
> - uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
> - uint32_t flags, struct drm_xe_sync *sync, uint32_t
> num_syncs,
> - uint32_t prefetch_region, uint8_t pat_index, uint64_t ext)
> +int ___xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
> + uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
> + uint32_t flags, struct drm_xe_sync *sync, uint32_t
> num_syncs,
> + uint32_t prefetch_region, uint8_t pat_index, uint64_t ext,
> + uint64_t op_ext)
> {
> struct drm_xe_vm_bind bind = {
> .extensions = ext,
> .vm_id = vm,
> .num_binds = 1,
> + .bind.extensions = op_ext,
> .bind.obj = bo,
> .bind.obj_offset = offset,
> .bind.range = size,
> @@ -125,6 +127,16 @@ int __xe_vm_bind(int fd, uint32_t vm, uint32_t
> exec_queue, uint32_t bo,
> return 0;
> }
>
> +int __xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
> + uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
> + uint32_t flags, struct drm_xe_sync *sync, uint32_t
> num_syncs,
> + uint32_t prefetch_region, uint8_t pat_index, uint64_t ext) {
> + return ___xe_vm_bind(fd, vm, exec_queue, bo, offset, addr, size, op,
> + flags, sync, num_syncs, prefetch_region,
> + pat_index, ext, 0);
> +}
> +
> void __xe_vm_bind_assert(int fd, uint32_t vm, uint32_t exec_queue,
> uint32_t bo,
> uint64_t offset, uint64_t addr, uint64_t size,
> uint32_t op, uint32_t flags, struct drm_xe_sync
> *sync, diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h index
> b27c0053f..18cc2b72b 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -20,6 +20,11 @@
> uint32_t xe_cs_prefetch_size(int fd);
> uint64_t xe_bb_size(int fd, uint64_t reqsize); uint32_t xe_vm_create(int fd,
> uint32_t flags, uint64_t ext);
> +int ___xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
> + uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
> + uint32_t flags, struct drm_xe_sync *sync, uint32_t
> num_syncs,
> + uint32_t prefetch_region, uint8_t pat_index, uint64_t ext,
> + uint64_t op_ext);
> int __xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
> uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
> uint32_t flags, struct drm_xe_sync *sync, uint32_t
> num_syncs,
> --
> 2.34.1
More information about the igt-dev
mailing list