From: Tejas Upadhyay <tejas.upadhyay@intel.com>
To: igt-dev@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Subject: [PATCH i-g-t V2 1/2] drm-uapi/xe: Add new flag in mmap offset ioctl
Date: Wed, 23 Oct 2024 15:13:26 +0530 [thread overview]
Message-ID: <20241023094327.965050-2-tejas.upadhyay@intel.com> (raw)
In-Reply-To: <20241023094327.965050-1-tejas.upadhyay@intel.com>
Add flag in mmap offset for querying special defined
mmap offset for specific purpose like pci membarrier
which requires to write 4K doorbell page mapped at
defined offset.
For user to query special offset, special flag can be
passed in mmap_offset ioctl and used in mmap as follows,
struct drm_xe_gem_mmap_offset mmo = {
.handle = 0, (this must be set to 0)
.flags = DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER,
};
igt_ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo);
map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo);
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
include/drm-uapi/xe_drm.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/drm-uapi/xe_drm.h b/include/drm-uapi/xe_drm.h
index f0a450db9..a04d6f1de 100644
--- a/include/drm-uapi/xe_drm.h
+++ b/include/drm-uapi/xe_drm.h
@@ -817,7 +817,18 @@ struct drm_xe_gem_mmap_offset {
/** @handle: Handle for the object being mapped. */
__u32 handle;
- /** @flags: Must be zero */
+/**
+ * For user to query special offset we are adding special flag in
+ * mmap_offset ioctl which needs to be passed as follows,
+ * struct drm_xe_gem_mmap_offset mmo = {
+ * .handle = 0, (this must be set to 0)
+ * .flags = DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER,
+ * };
+ * igt_ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo);
+ * map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo);
+*/
+#define DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER (1 << 0)
+ /** @flags: Flag to indicate if any special offset, zero otherwise */
__u32 flags;
/** @offset: The fake offset to use for subsequent mmap call */
--
2.34.1
next prev parent reply other threads:[~2024-10-23 9:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 9:43 [PATCH i-g-t V2 0/2] Add xe_pci_membarrier test Tejas Upadhyay
2024-10-23 9:43 ` Tejas Upadhyay [this message]
2024-11-06 17:35 ` [PATCH i-g-t V2 1/2] drm-uapi/xe: Add new flag in mmap offset ioctl Matt Roper
2024-10-23 9:43 ` [PATCH i-g-t V2 2/2] tests/intel: Add xe_pci_membarrier test Tejas Upadhyay
2024-11-01 13:55 ` Matthew Auld
2024-11-06 12:00 ` Upadhyay, Tejas
2024-11-06 13:12 ` Upadhyay, Tejas
2024-11-11 11:48 ` Matthew Auld
2024-10-23 10:42 ` ✗ GitLab.Pipeline: warning for " Patchwork
2024-10-23 11:00 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-23 11:09 ` ✓ CI.xeBAT: " Patchwork
2024-10-23 12:58 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-23 15:56 ` ✗ Fi.CI.IGT: " Patchwork
2024-11-06 13:17 ` ✗ Fi.CI.BUILD: failure for Add xe_pci_membarrier test (rev2) Patchwork
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=20241023094327.965050-2-tejas.upadhyay@intel.com \
--to=tejas.upadhyay@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-xe@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