From: Dave Gordon <david.s.gordon@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org, Alex Dai <yu.dai@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: introduce and use i915_gem_object_map_range()
Date: Wed, 13 Apr 2016 21:49:03 +0100 [thread overview]
Message-ID: <570EB0BF.7080905@intel.com> (raw)
In-Reply-To: <20160413201423.GA9283@nuc-i3427.alporthouse.com>
On 13/04/16 21:14, Chris Wilson wrote:
> On Wed, Apr 13, 2016 at 09:00:53PM +0100, Dave Gordon wrote:
>> From: Alex Dai <yu.dai@intel.com>
>>
>> The recent pin-and-map unification didn't include the command parser's
>> own custom vmapping code, which essentially duplicates the same
>> algorithm but without some of the optimisations.
>
> No. There is no need for extra hacks for the cmdparser when the very
> issue is that it takes a vmap every batch.
> -Chris
Actually, sharing your mapping code will mean that it won't use vmap()
for "sufficiently small" batches (i.e. one page), it will take the kmap
path instead. And then for larger batches it will take advantage of the
stack optimisation instead; only the largest won't benefit from that.
Even without the utility of sharing the code with the command parser,
I'd still be inclined to refactor the pin-and-map into the function that
does the mapping, with whatever clever optimisations we can apply, and
the outer wrapper that manages the pinning and error recovery.
BTW, I expected to find a kvunmap() which would do exactly what I moved
into i915_gem_addr_unmap(), but there doesn't seem to be one.
+static inline void i915_gem_addr_unmap(void *mapped_addr)
+{
+ if (is_vmalloc_addr(mapped_addr))
+ vunmap(mapped_addr);
+ else
+ kunmap(kmap_to_page(mapped_addr));
+}
Do you think this would be of sufficient utility to be pushed upstream?
The analogous kvfree() is quite widely used!
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-13 20:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 20:00 [PATCH 1/2] drm/i915: introduce and use i915_gem_object_map_range() Dave Gordon
2016-04-13 20:00 ` [PATCH 2/2] drm/i915: optimise i915_gem_object_map_range() for small objects Dave Gordon
2016-04-13 20:14 ` [PATCH 1/2] drm/i915: introduce and use i915_gem_object_map_range() Chris Wilson
2016-04-13 20:49 ` Dave Gordon [this message]
2016-04-14 15:55 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " 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=570EB0BF.7080905@intel.com \
--to=david.s.gordon@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@intel.com \
--cc=yu.dai@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