Skip to contentSkip to conversation

drm/i915: Unlock the shared hwsp_gtt object after pinning

PATCH New Thomas Hellström 2 participants 2 messages Sep 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915: Unlock the shared hwsp_gtt object after pinning

From: Thomas Hellström <[email protected]>

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.

---
v2: Added additional clarifying code comments (Chris Wilson)

---
 drivers/gpu/drm/i915/gt/intel_context.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/i915/gt/intel_context.c +9 -0
index 61b05cd4c47a..d301dda1b261 100644
@@ -271,6 +271,15 @@ 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.
+	 * In principle we can unlock all the global state locked above
+	 * since it's pinned and doesn't need fencing, and will
+	 * thus remain resident until it is explicitly unpinned.
+	 */
+	i915_gem_ww_unlock_single(ce->timeline->hwsp_ggtt->obj);
+
 	return err;
 }
 
Signature · 6 lines
2.25.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Unlock the shared hwsp_gtt object after pinning (rev2)

== Series Details ==

== Series Details ==

Series: drm/i915: Unlock the shared hwsp_gtt object after pinning (rev2)
URL : https://patchwork.freedesktop.org/series/81290/
State : failure

== Summary ==

Applying: drm/i915: Unlock the shared hwsp_gtt object after pinning Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/gt/intel_context.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx