From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, akash.goel@intel.com
Subject: Re: [PATCH 3/3] igt/gem_stolen: Check for available stolen memory size
Date: Mon, 06 Jun 2016 14:55:21 +0530 [thread overview]
Message-ID: <1465205121.23549.8.camel@ankitprasad-desktop> (raw)
In-Reply-To: <575162ED.9080707@linux.intel.com>
On Fri, 2016-06-03 at 11:58 +0100, Tvrtko Ursulin wrote:
> On 03/06/16 09:51, ankitprasad.r.sharma@intel.com wrote:
> > From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> >
> > Check for available stolen memory size before attempting to run
> > the stolen memory tests. This way we make sure that we do not
> > create objects from stolen memory without knowing the available size.
> >
> > This checks if the kernel supports creation of stolen backed objects
> > before doing any operation on stolen backed objects.
> >
> > Also correcting the CREATE_VERSION ioctl number in getparam ioctl,
> > due to kernel changes added in between.
> >
> > Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > ---
> > lib/ioctl_wrappers.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
> > lib/ioctl_wrappers.h | 7 +++++--
> > tests/gem_create.c | 2 +-
> > tests/gem_pread.c | 3 +++
> > tests/gem_pwrite.c | 2 ++
> > tests/gem_stolen.c | 16 ++++++++--------
> > 6 files changed, 66 insertions(+), 12 deletions(-)
> >
> > diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> > index f224091..e6120bb 100644
> > --- a/lib/ioctl_wrappers.c
> > +++ b/lib/ioctl_wrappers.c
> > @@ -455,7 +455,7 @@ bool gem_create__has_stolen_support(int fd)
> >
> > if (has_stolen_support < 0) {
> > memset(&gp, 0, sizeof(gp));
> > - gp.param = 36; /* CREATE_VERSION */
> > + gp.param = 38; /* CREATE_VERSION */
> > gp.value = &val;
> >
> > /* Do we have the extended gem_create_ioctl? */
> > @@ -1230,6 +1230,52 @@ bool gem_has_bsd2(int fd)
> > has_bsd2 = has_param(fd, LOCAL_I915_PARAM_HAS_BSD2);
> > return has_bsd2;
> > }
> > +
> > +struct local_i915_gem_get_aperture {
> > + __u64 aper_size;
> > + __u64 aper_available_size;
> > + __u64 version;
> > + __u64 map_total_size;
> > + __u64 stolen_total_size;
> > +};
> > +#define DRM_I915_GEM_GET_APERTURE 0x23
> > +#define LOCAL_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct local_i915_gem_get_aperture)
> > +/**
> > + * gem_total_mappable_size:
> > + * @fd: open i915 drm file descriptor
> > + *
> > + * Feature test macro to query the kernel for the total mappable size.
>
> Minor: it is not a feature test nor a macro.
I have just added this to maintain consistency among other helper
functions. You want me to change it?
Thanks,
Ankit
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-06-06 9:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 8:51 [PATCH 1/3] igt/gem_stolen: Verify contents of stolen-backed objects across hibernation ankitprasad.r.sharma
2016-06-03 8:51 ` [PATCH 2/3] igt/gem_stolen: Fix for no_mmap subtest ankitprasad.r.sharma
2016-06-03 10:53 ` Tvrtko Ursulin
2016-06-03 8:51 ` [PATCH 3/3] igt/gem_stolen: Check for available stolen memory size ankitprasad.r.sharma
2016-06-03 10:58 ` Tvrtko Ursulin
2016-06-06 9:25 ` Ankitprasad Sharma [this message]
2016-06-03 10:52 ` [PATCH 1/3] igt/gem_stolen: Verify contents of stolen-backed objects across hibernation Tvrtko Ursulin
2016-06-03 11:32 ` ✗ Ro.CI.BAT: failure for series starting with [1/3] " Patchwork
2016-06-03 11:39 ` 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=1465205121.23549.8.camel@ankitprasad-desktop \
--to=ankitprasad.r.sharma@intel.com \
--cc=akash.goel@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@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;
as well as URLs for NNTP newsgroup(s).