From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] i915: Handle the case where legacy mmap is not available
Date: Thu, 24 Jun 2021 11:33:11 -0700 [thread overview]
Message-ID: <87h7hnjeoo.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <ae91867b-546c-ce56-5b32-e293236e6f9b@linux.intel.com>
On Thu, 24 Jun 2021 02:02:04 -0700, Maarten Lankhorst wrote:
>
> Op 24-06-2021 om 03:30 schreef Dixit, Ashutosh:
> > On Tue, 11 May 2021 02:00:00 -0700, Maarten Lankhorst wrote:
> >> @@ -84,10 +93,14 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot)
> >> {
> >> struct drm_i915_gem_mmap_gtt mmap_arg;
> >> void *ptr;
> >> + int ret;
> >>
> >> memset(&mmap_arg, 0, sizeof(mmap_arg));
> >> mmap_arg.handle = handle;
> >> - if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg))
> >> + ret = igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg);
> >> + if (ret == -1 && errno == EOPNOTSUPP)
> > What is the handler for DRM_IOCTL_I915_GEM_MMAP_GTT ioctl in i915 (in the
> > kernel)? I am unable to find it so for now I am just assuming that it will
> > just get routed to the handler for DRM_IOCTL_I915_GEM_MMAP and return
> > EOPNOTSUPP for Gen12+ which is what the code above seems to be assuming.
>
> tools/include/uapi/drm/i915_drm.h:#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
> tools/include/uapi/drm/i915_drm.h:#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
> tools/include/uapi/drm/i915_drm.h:#define DRM_IOCTL_I915_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_offset)
>
> I wasn't aware of that, even..
>
> MMAP_GTT is MMAP_OFFSET with flags and extensions set to 0. Which means
> flags = I915_MMAP_OFFSET_GTT.
Ah, got it! Thanks!
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2021-06-24 18:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 9:00 [igt-dev] [PATCH i-g-t] i915: Handle the case where legacy mmap is not available Maarten Lankhorst
2021-05-11 9:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-11 9:50 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2021-05-11 10:07 ` Maarten Lankhorst
2021-05-11 10:41 ` Petri Latvala
2021-05-11 10:48 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2021-05-11 16:19 ` [igt-dev] [PATCH i-g-t] " Dixit, Ashutosh
2021-05-26 9:36 ` Maarten Lankhorst
2021-05-18 15:08 ` [igt-dev] ✓ Fi.CI.BAT: success for i915: Handle the case where legacy mmap is not available (rev2) Patchwork
2021-05-19 3:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-18 13:45 ` [igt-dev] ✓ Fi.CI.BAT: success for i915: Handle the case where legacy mmap is not available (rev3) Patchwork
2021-06-18 15:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-24 1:30 ` [igt-dev] [PATCH i-g-t] i915: Handle the case where legacy mmap is not available Dixit, Ashutosh
2021-06-24 9:02 ` Maarten Lankhorst
2021-06-24 18:33 ` Dixit, Ashutosh [this message]
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=87h7hnjeoo.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.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