-
- Downloads
drm/i915: Export a preallocate variant of i915_active_acquire()
Sometimes we have to be very careful not to allocate underneath a mutex (or spinlock) and yet still want to track activity. Enter i915_active_acquire_for_context(). This raises the activity counter on i915_active prior to use and ensures that the fence-tree contains a slot for the context. v2: Refactor active_lookup() so it can be called again before/after locking to resolve contention. Since we protect the rbtree until we idle, we can do a lockfree lookup, with the caveat that if another thread performs a concurrent insertion, the rotations from the insert may cause us to not find our target. A second pass holding the treelock will find the target if it exists, or the place to perform our insertion. Signed-off-by:Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by:
Thomas Hellström <thomas.hellstrom@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200731085015.32368-3-chris@chris-wilson.co.uk
Showing
- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 1 addition, 1 deletiondrivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
- drivers/gpu/drm/i915/gt/intel_timeline.c 3 additions, 1 deletiondrivers/gpu/drm/i915/gt/intel_timeline.c
- drivers/gpu/drm/i915/i915_active.c 118 additions, 32 deletionsdrivers/gpu/drm/i915/i915_active.c
- drivers/gpu/drm/i915/i915_active.h 8 additions, 4 deletionsdrivers/gpu/drm/i915/i915_active.h
Loading
Please register or sign in to comment