]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Refactor duplicate object vmap functions
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Apr 2016 11:11:11 +0000 (12:11 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Apr 2016 16:11:44 +0000 (17:11 +0100)
commit379c8ff1a1bd4455f4e7e40d32441e44b6ffbfcc
tree642e2099c1b77ac324fb76418adeb0a26344fe57
parente033f33d3faa9a9870eb148803071fc8a04ca23e
drm/i915: Refactor duplicate object vmap functions

We now have two implementations for vmapping a whole object, one for
dma-buf and one for the ringbuffer. If we couple the mapping into the
obj->pages lifetime, then we can reuse an obj->mapping for both and at
the same time couple it into the shrinker. There is a third vmapping
routine in the cmdparser that maps only a range within the object, for
the time being that is left alone, but will eventually use these routines
in order to cache the mapping between invocations.

v2: Mark the failable kmalloc() as __GFP_NOWARN (vsyrjala)
v3: Call unpin_vmap from the right dmabuf unmapper

v4: Rename vmap to map as we don't wish to imply the type of mapping
involved, just that it contiguously maps the object into kernel space.
Add kerneldoc and lockdep annotations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Dave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1460113874-17366-4-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/i915/intel_ringbuffer.c