Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [i-g-t] lib/intel_aux_pgtable: Add XE support for pagetable mapping
Date: Mon, 30 Oct 2023 21:38:04 +0530	[thread overview]
Message-ID: <20231030160804.4083739-1-bhanuprakash.modem@intel.com> (raw)

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

             reply	other threads:[~2023-10-30 16:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 16:08 Bhanuprakash Modem [this message]
2023-10-30 20:11 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/intel_aux_pgtable: Add XE support for pagetable mapping 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

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=20231030160804.4083739-1-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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