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
Subject: Re: [PATCH 1/3] drm/i915: Support for pre-populating the object with system pages
Date: Thu, 27 Aug 2015 11:18:15 +0530 [thread overview]
Message-ID: <1440654495.26385.5.camel@ankitprasad-desktop> (raw)
In-Reply-To: <20150824123554.GD25712@nuc-i3427.alporthouse.com>
On Mon, 2015-08-24 at 13:35 +0100, Chris Wilson wrote:
> On Mon, Aug 24, 2015 at 05:28:14PM +0530, ankitprasad.r.sharma@intel.com wrote:
> > +static int
> > +__i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
> > +{
> > + const struct drm_i915_gem_object_ops *ops = obj->ops;
> > + int ret;
> > +
> > + WARN_ON(obj->pages);
> > +
> > + if (obj->madv != I915_MADV_WILLNEED) {
> > + DRM_DEBUG("Attempting to obtain a purgeable object\n");
> > + return -EFAULT;
> > + }
> > +
> > + BUG_ON(obj->pages_pin_count);
>
> Put the parameter checking into i915_gem_object_get_pages(). The __i915
> version is only allowed from strict contexts and we can place the burden
> of being correct on the caller.
>
> > + ret = ops->get_pages(obj);
> > + if (ret)
> > + return ret;
> > +
> > + obj->get_page.sg = obj->pages->sgl;
> > + obj->get_page.last = 0;
> > +
> > + return 0;
> > +}
> > +
> > /* Ensure that the associated pages are gathered from the backing storage
> > * and pinned into our object. i915_gem_object_get_pages() may be called
> > * multiple times before they are released by a single call to
> > @@ -2339,28 +2377,17 @@ int
> > i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
> > {
> > struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
> > - const struct drm_i915_gem_object_ops *ops = obj->ops;
> > int ret;
> >
> > if (obj->pages)
> > return 0;
> >
> > - if (obj->madv != I915_MADV_WILLNEED) {
> > - DRM_DEBUG("Attempting to obtain a purgeable object\n");
> > - return -EFAULT;
> > - }
> > -
> > - BUG_ON(obj->pages_pin_count);
> > -
> > - ret = ops->get_pages(obj);
> > + ret = __i915_gem_object_get_pages(obj);
> > if (ret)
> > return ret;
> >
> > list_add_tail(&obj->global_list, &dev_priv->mm.unbound_list);
>
> I am tempted to say this should be in a new
>
> __i915_gem_object_get_pages__tail_locked()
>
> so that we don't have to hunt down users if we ever need to modify the
> global lists.
Could not get you here.
is it just to add list_add_tail in a separate function
__i915_gem_object_get_pages__tail_locked(), or a new variant of
__i915_gem_object_get_pages() that will also do the link list insertion
Thanks,
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-08-27 6:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 11:58 [PATCH 0/3] Reduce the time for which 'struct_mutex' is held ankitprasad.r.sharma
2015-08-24 11:58 ` [PATCH 1/3] drm/i915: Support for pre-populating the object with system pages ankitprasad.r.sharma
2015-08-24 12:35 ` Chris Wilson
2015-08-27 5:48 ` Ankitprasad Sharma [this message]
2015-08-27 7:45 ` Chris Wilson
2015-08-25 10:51 ` Siluvery, Arun
2015-08-27 6:34 ` Ankitprasad Sharma
2015-08-27 7:43 ` Chris Wilson
2015-08-24 11:58 ` [PATCH 2/3] drm/i915: Support for the clflush of pre-populated pages ankitprasad.r.sharma
2015-08-24 12:43 ` Chris Wilson
2015-08-24 11:58 ` [PATCH 3/3] drm/i915: Only move to the CPU write domain if keeping the GTT pages ankitprasad.r.sharma
2015-08-24 12:46 ` Chris Wilson
2015-08-26 9:25 ` [PATCH 0/3] Reduce the time for which 'struct_mutex' is held Daniel Vetter
2015-08-27 10:48 ` Ankitprasad Sharma
-- strict thread matches above, loose matches on Subject: below --
2015-08-27 11:04 [PATCH v2 " ankitprasad.r.sharma
2015-08-27 11:04 ` [PATCH 1/3] drm/i915: Support for pre-populating the object with system pages ankitprasad.r.sharma
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=1440654495.26385.5.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 \
/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