drm/i915: Consolidate i915_vma_unpin_and_release()
In a few places, we repeat a call to clear a pointer to a vma whilst unpinning and releasing a reference to its owner. Refactor those into a common function. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1471254551-25805-26-git-send-email-chris@chris-wilson.co.uk
This commit is contained in:
@@ -1257,14 +1257,8 @@ static int init_render_ring(struct intel_engine_cs *engine)
|
||||
static void render_ring_cleanup(struct intel_engine_cs *engine)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = engine->i915;
|
||||
struct i915_vma *vma;
|
||||
|
||||
vma = fetch_and_zero(&dev_priv->semaphore);
|
||||
if (!vma)
|
||||
return;
|
||||
|
||||
i915_vma_unpin(vma);
|
||||
i915_vma_put(vma);
|
||||
i915_vma_unpin_and_release(&dev_priv->semaphore);
|
||||
}
|
||||
|
||||
static int gen8_rcs_signal(struct drm_i915_gem_request *req)
|
||||
|
Reference in New Issue
Block a user