From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, akash.goel@intel.com,
shashidhar.hiremath@intel.com
Subject: Re: [PATCH 5/5] drm/i915: Add support for getting size of the stolen region
Date: Tue, 05 May 2015 17:12:25 +0530 [thread overview]
Message-ID: <1430826145.17871.6.camel@ankitprasad-desktop> (raw)
In-Reply-To: <20150429102732.GN599@nuc-i3427.alporthouse.com>
On Wed, 2015-04-29 at 11:27 +0100, Chris Wilson wrote:
> On Wed, Apr 29, 2015 at 03:01:59PM +0530, ankitprasad.r.sharma@intel.com wrote:
> > From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> >
> > This patch extends the get_aperture_ioctl to add support
> > for getting total size of the stolen region and available
> > size of the stolen region.
> >
> > testcase: igt/gem_create_stolen
> >
> > Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 6 ++++++
> > drivers/gpu/drm/i915/i915_gem.c | 15 ++++++++++++++-
> > include/uapi/drm/i915_drm.h | 6 ++++++
> > 3 files changed, 26 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index a568cd1..a40b44f 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -3277,4 +3277,10 @@ inline static bool i915_gem_obj_is_prw_allowed(struct drm_i915_gem_object *obj)
> > return !obj->userptr.mm;
> > }
> >
> > +inline static bool i915_gem_obj_is_stolen_used(struct drm_i915_gem_object *obj)
> > +{
> > + return obj->stolen && (i915_gem_obj_is_pinned(obj)
> > + || obj->madv == I915_MADV_WILLNEED);
> > +}
> > +
> > #endif
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index 3491bd3..ee93508 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -150,17 +150,30 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct drm_i915_gem_get_aperture *args = data;
> > struct drm_i915_gem_object *obj;
> > - size_t pinned;
> > + size_t pinned, pinned_stolen;
> >
> > pinned = 0;
> > + pinned_stolen = 0;
> > mutex_lock(&dev->struct_mutex);
> > list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
> > if (i915_gem_obj_is_pinned(obj))
> > pinned += i915_gem_obj_ggtt_size(obj);
> > +
> > + /* Calculating available stolen size */
> > + list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
> > + if (i915_gem_obj_is_stolen_used(obj))
> > + pinned_stolen += i915_gem_obj_ggtt_size(obj);
> > +
> > + list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list)
> > + if (i915_gem_obj_is_stolen_used(obj))
> > + pinned_stolen += i915_gem_obj_ggtt_size(obj);
>
> Ah, here you will want to iterate over the stolen drm_mm range manager
> to get an accurate count.
>
> Could you respin this on top of
> id:1422276205-8532-5-git-send-email-rodrigo.vivi@intel.com ?
I have incorporated the comments suggested by you, as well as I went through Rodrigo's patch and as such there is no dependency between the two patches.
So how do I float this patch? Shall I resend this as a separate patch in the series (1422276205-8532-5-git-send-email-rodrigo.vivi@intel.com) rebasing on top of Rodrigo's changes Or as a part of this series only?
-Ankit
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-05-05 11:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 9:31 [PATCH v2 0/5] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-04-29 9:31 ` [PATCH 1/5] drm/i915: Clearing buffer objects via blitter engine ankitprasad.r.sharma
2015-04-29 9:31 ` [PATCH 2/5] drm/i915: Support for creating Stolen memory backed objects ankitprasad.r.sharma
2015-04-29 9:31 ` [PATCH 3/5] drm/i915: Add support for stealing purgable stolen pages ankitprasad.r.sharma
2015-04-29 9:31 ` [PATCH 4/5] drm/i915: Support for pread/pwrite from/to non shmem backed objects ankitprasad.r.sharma
2015-04-29 10:19 ` Chris Wilson
2015-04-29 10:57 ` Chris Wilson
2015-04-29 9:31 ` [PATCH 5/5] drm/i915: Add support for getting size of the stolen region ankitprasad.r.sharma
2015-04-29 10:27 ` Chris Wilson
2015-05-05 11:42 ` Ankitprasad Sharma [this message]
2015-05-05 12:54 ` Chris Wilson
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=1430826145.17871.6.camel@ankitprasad-desktop \
--to=ankitprasad.r.sharma@intel.com \
--cc=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shashidhar.hiremath@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