From: Daniel Vetter <daniel@ffwll.ch>
To: "Michael H. Nguyen" <michael.h.nguyen@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code
Date: Mon, 24 Nov 2014 10:20:19 +0100 [thread overview]
Message-ID: <20141124092018.GH25711@phenom.ffwll.local> (raw)
In-Reply-To: <546FE43E.7090600@intel.com>
On Fri, Nov 21, 2014 at 05:17:50PM -0800, Michael H. Nguyen wrote:
> Hi Chris,
>
> >>
> >>+static struct drm_i915_gem_object*
> >>+i915_gem_execbuffer_parse(struct intel_engine_cs *ring,
> >>+ struct drm_i915_gem_exec_object2 *shadow_exec_entry,
> >>+ struct eb_vmas *eb,
> >>+ struct drm_i915_gem_object *batch_obj,
> >>+ u32 batch_start_offset,
> >>+ u32 batch_len,
> >>+ bool is_master,
> >>+ u32 *flags)
> >>+{
> >>+ struct drm_i915_private *dev_priv = to_i915(batch_obj->base.dev);
> >>+ struct drm_i915_gem_object *shadow_batch_obj;
> >>+ int ret;
> >>+
> >>+ shadow_batch_obj = i915_gem_batch_pool_get(&dev_priv->mm.batch_pool,
> >>+ batch_obj->base.size);
> >>+ if (IS_ERR(shadow_batch_obj))
> >>+ return shadow_batch_obj;
> >>+
> >>+ shadow_batch_obj->madv = I915_MADV_WILLNEED;
> >>+
> >>+ ret = i915_gem_obj_ggtt_pin(shadow_batch_obj, 4096, 0);
> >>+ if (ret)
> >>+ goto err;
> >
> >Pardon? This feels an implementation issue of i915_parse_cmds() and should
> >be resolved there. Presumably you are not actually reading back through
> >the GTT? That would be insane...
> >
> >>+ ret = i915_parse_cmds(ring,
> >>+ batch_obj,
> >>+ shadow_batch_obj,
> >>+ batch_start_offset,
> >>+ batch_len,
> >>+ is_master);
> >>+ i915_gem_object_ggtt_unpin(shadow_batch_obj);
> >
> >Yet pin+unpin around the parser seems to serve no other purpose.
> Are you suggesting to remove the pin/unpin calls? If so, isn't pinning
> needed to ensure the backing store pages are available in vmap_batch()? i.e.
> obj->pages->sgl is populated w/ physical pages.
>
> Or, are you suggesting to move the pin/unpin calls inside i915_parse_cmds()
> ?
Yeah please push them down into the cmd parser around the part that
copies/checks the shadow batch. If we ever change the way we do that
copy/parsing (likely due to performance issues on vlv) then we also might
need to change the type of pinning. So better to keep things together.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-24 9:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 22:22 [PATCH v4 0/7] Command parser batch buffer copy bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 1/7] drm/i915: Implement a framework for batch buffer pools bradley.d.volkin
2014-11-12 8:44 ` Daniel Vetter
2014-11-12 9:46 ` Chris Wilson
2014-11-12 16:33 ` Daniel Vetter
2014-11-12 16:38 ` Chris Wilson
2014-11-22 1:28 ` Michael H. Nguyen
2014-11-24 9:18 ` Daniel Vetter
2014-11-12 9:42 ` Chris Wilson
2014-11-07 22:22 ` [PATCH v4 2/7] drm/i915: Use batch pools with the command parser bradley.d.volkin
2014-11-12 9:49 ` Chris Wilson
2014-11-07 22:22 ` [PATCH v4 3/7] drm/i915: Add a batch pool debugfs file bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 4/7] drm/i915: Add batch pool details to i915_gem_objects debugfs bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 5/7] drm/i915: Use batch length instead of object size in command parser bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 6/7] drm/i915: Mark shadow batch buffers as purgeable bradley.d.volkin
2014-11-12 8:46 ` Daniel Vetter
2014-11-07 22:22 ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code bradley.d.volkin
2014-11-07 22:25 ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command shuang.he
2014-11-12 9:37 ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code Chris Wilson
2014-11-22 1:17 ` Michael H. Nguyen
2014-11-24 9:20 ` Daniel Vetter [this message]
2014-11-12 8:51 ` [PATCH v4 0/7] Command parser batch buffer copy Daniel Vetter
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=20141124092018.GH25711@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michael.h.nguyen@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