[Intel-gfx] [RFC 4/5] drm/i915: Drop GEM context reference while pinned

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 24 13:13:42 UTC 2019


Ostensibly, as far recorded at least, we take a reference to our GEM
context parent to keep the ppgtt alive as long as we are pinned. Now
that the context holds a reference to the ppgtt itself, we should no
longer need the back reference.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index 7075d03f508f..7b04a3ca19bd 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -72,8 +72,6 @@ int __intel_context_do_pin(struct intel_context *ce)
 			  ce->engine->name, ce->timeline->fence_context,
 			  ce->ring->head, ce->ring->tail);
 
-		i915_gem_context_get(ce->gem_context); /* for ctx->ppgtt */
-
 		smp_mb__before_atomic(); /* flush pin before it is visible */
 	}
 
@@ -103,7 +101,6 @@ void intel_context_unpin(struct intel_context *ce)
 
 		ce->ops->unpin(ce);
 
-		i915_gem_context_put(ce->gem_context);
 		intel_context_active_release(ce);
 	}
 
-- 
2.24.0.rc0



More information about the Intel-gfx mailing list