Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915: Unlock the shared hwsp_gtt object after pinning
@ 2020-09-03 13:31 Mika Kuoppala
  2020-09-03 14:01 ` Chris Wilson
  2020-09-03 15:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Mika Kuoppala @ 2020-09-03 13:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: Thomas Hellström

From: Thomas Hellström <thomas.hellstrom@intel.com>

The hwsp_gtt object is used for sub-allocation and could therefore
be shared by many contexts causing unnecessary contention during
concurrent context pinning.
However since we're currently locking it only for pinning, it remains
resident until we unpin it, and therefore it's safe to drop the
lock early, allowing for concurrent thread access.

Signed-off-by: Thomas Hellström <thomas.hellstrom@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index 61b05cd4c47a..65e956ba19e1 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -271,6 +271,13 @@ int __intel_context_do_pin_ww(struct intel_context *ce,
 	i915_active_release(&ce->active);
 err_ctx_unpin:
 	intel_context_post_unpin(ce);
+
+	/*
+	 * Unlock the hwsp_ggtt object since it's shared. This is fine for now
+	 * since the lock has been used for pinning only, not fencing.
+	 */
+	i915_gem_ww_unlock_single(ce->timeline->hwsp_ggtt->obj);
+
 	return err;
 }
 
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-03 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-03 13:31 [Intel-gfx] [PATCH] drm/i915: Unlock the shared hwsp_gtt object after pinning Mika Kuoppala
2020-09-03 14:01 ` Chris Wilson
2020-09-03 14:18   ` Thomas Hellström (Intel)
2020-09-03 15:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox