Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [i-g-t] lib/intel_aux_pgtable: Add XE support for pagetable mapping
@ 2023-10-30 16:08 Bhanuprakash Modem
  2023-10-30 20:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Bhanuprakash Modem @ 2023-10-30 16:08 UTC (permalink / raw)
  To: igt-dev

For XE device, use XE specific APIs to map pagetable.

Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/intel_aux_pgtable.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/intel_aux_pgtable.c b/lib/intel_aux_pgtable.c
index 7c7952134..3cbb0e26f 100644
--- a/lib/intel_aux_pgtable.c
+++ b/lib/intel_aux_pgtable.c
@@ -9,6 +9,7 @@
 #include "ioctl_wrappers.h"
 
 #include "i915/gem_mman.h"
+#include "xe/xe_ioctl.h"
 
 #define BITMASK(e, s)		((~0ULL << (s)) & \
 				 (~0ULL >> (BITS_PER_LONG_LONG - 1 - (e))))
@@ -371,10 +372,13 @@ pgt_populate_entries_for_buf(struct pgtable *pgt,
 	}
 }
 
-static void pgt_map(int i915, struct pgtable *pgt)
+static void pgt_map(int drm_fd, struct pgtable *pgt)
 {
-	pgt->ptr = gem_mmap__device_coherent(i915, pgt->buf->handle, 0,
-					     pgt->size, PROT_READ | PROT_WRITE);
+	pgt->ptr = is_i915_device(drm_fd) ?
+			gem_mmap__device_coherent(drm_fd, pgt->buf->handle, 0,
+						  pgt->size, PROT_READ | PROT_WRITE):
+			xe_bo_mmap_ext(drm_fd, pgt->buf->handle,
+				       pgt->size, PROT_READ | PROT_WRITE);
 }
 
 static void pgt_unmap(struct pgtable *pgt)
-- 
2.40.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-02 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30 16:08 [igt-dev] [i-g-t] lib/intel_aux_pgtable: Add XE support for pagetable mapping Bhanuprakash Modem
2023-10-30 20:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-10-30 21:48 ` [igt-dev] ✗ CI.xeBAT: failure " Patchwork
2023-10-31 14:22 ` [igt-dev] ✓ CI.xeBAT: success for lib/intel_aux_pgtable: Add XE support for pagetable mapping (rev2) Patchwork
2023-10-31 14:26 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-11-01  8:44 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/intel_aux_pgtable: Add XE support for pagetable mapping Patchwork
2023-11-02  1:40 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/intel_aux_pgtable: Add XE support for pagetable mapping (rev2) Patchwork
2023-11-02 11:51 ` [igt-dev] [i-g-t] lib/intel_aux_pgtable: Add XE support for pagetable mapping Juha-Pekka Heikkila

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox