[Intel-gfx] [PATCH v2 1/2] drm/i915: Add i915_gem_object_vmap to map GEM object to virtual space
yu.dai at intel.com
Thu Feb 18 21:30:18 UTC 2016
On 02/18/2016 01:05 PM, Chris Wilson wrote:
> On Thu, Feb 18, 2016 at 10:31:37AM -0800, yu.dai at intel.com wrote:
> > From: Alex Dai <yu.dai at intel.com>
> > There are several places inside driver where a GEM object is mapped to
> > kernel virtual space. The mapping is either done for the whole object
> > or certain page range of it.
> > This patch introduces a function i915_gem_object_vmap to do such job.
> > v2: Use obj->pages->nents for iteration within i915_gem_object_vmap;
> > break when it finishes all desired pages. The caller need to pass
> > in actual page number. (Tvrtko Ursulin)
> Who owns the pages? vmap doesn't increase the page refcount nor
> mapcount, so it is the callers responsibility to keep the pages alive
> for the duration of the vmapping.
> I suggested i915_gem_object_pin_vmap/unpin_vmap for that reason and that
> also provides the foundation for undoing one of the more substantial
> performance regressions from vmap_batch().
OK, found it at 050/190 of your patch series. That is a huge list of
patches. :-) The code I put here does not change (at least tries to
keep) the current code logic or driver behavior. I am not opposed to
using i915_gem_object_pin_vmap/unpin_vmap at all. I will now just keep
eyes on that patch.
More information about the Intel-gfx