[Intel-gfx] [PATCH 4/6] drm/i915: Improve dynamic management/eviction of lrc backing objects
Chris Wilson
chris at chris-wilson.co.uk
Tue Oct 20 02:54:30 PDT 2015
On Tue, Oct 20, 2015 at 10:23:54AM +0100, Nick Hoath wrote:
> Shovel all context related objects through the active queue and obj
> management.
>
> - Added callback in vma_(un)bind to add CPU (un)mapping at same time
> if desired
> - Inserted LRC hw context & ringbuf to vma active list
>
> Issue: VIZ-4277
> Signed-off-by: Nick Hoath <nicholas.hoath at intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 4 ++
> drivers/gpu/drm/i915/i915_gem.c | 3 ++
> drivers/gpu/drm/i915/i915_gem_gtt.c | 8 ++++
> drivers/gpu/drm/i915/intel_lrc.c | 28 +++++++++++--
> drivers/gpu/drm/i915/intel_ringbuffer.c | 71 ++++++++++++++++++---------------
> drivers/gpu/drm/i915/intel_ringbuffer.h | 3 --
> 6 files changed, 79 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index ae08e57..0dd4ace 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2161,6 +2161,10 @@ struct drm_i915_gem_object {
> struct work_struct *work;
> } userptr;
> };
> +
> + /** Support for automatic CPU side mapping of object */
> + int (*mmap)(struct drm_i915_gem_object *obj, bool unmap);
> + void *mappable;
> };
> #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 290a1ac..8bd318a 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3222,6 +3222,9 @@ static int __i915_vma_unbind(struct i915_vma *vma, bool wait)
> if (vma->pin_count)
> return -EBUSY;
>
> + if (obj->mmap)
> + obj->mmap(obj, true);
This is not a per-obj callback.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list