Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: <igt-dev@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t V2 1/2] drm-uapi/xe: Add new flag in mmap offset ioctl
Date: Wed, 6 Nov 2024 09:35:49 -0800	[thread overview]
Message-ID: <20241106173549.GQ4891@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20241023094327.965050-2-tejas.upadhyay@intel.com>

On Wed, Oct 23, 2024 at 03:13:26PM +0530, Tejas Upadhyay wrote:
> 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

This header is supposed to be a direct copy of the kernel header; we
shouldn't be making manual changes to it since those will just get
delted the next time somebody resyncs with the kernel.

Definitions for uapi that isn't upstream yet can be put in a local
header.  E.g., see lib/i915/i915_drm_local.h for the i915 equivalent.


Matt

> @@ -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
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation

  reply	other threads:[~2024-11-06 17:36 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 ` [PATCH i-g-t V2 1/2] drm-uapi/xe: Add new flag in mmap offset ioctl Tejas Upadhyay
2024-11-06 17:35   ` Matt Roper [this message]
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=20241106173549.GQ4891@mdroper-desk1.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tejas.upadhyay@intel.com \
    /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