public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drm/i915/gtt: grab wakeref in gen6_alloc_va_range
@ 2019-05-07 10:55 Matthew Auld
  2019-05-07 10:55 ` [PATCH v2 2/2] drm/i915: add in-kernel blitter client Matthew Auld
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Auld @ 2019-05-07 10:55 UTC (permalink / raw)
  To: intel-gfx

Some steps in gen6_alloc_va_range require the HW to be awake, so ideally
we should be grabbing the wakeref ourselves and not relying on the
caller already holding it for us.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 8f5db787b7f2..ffb8c3d011e9 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1745,10 +1745,13 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
 {
 	struct gen6_hw_ppgtt *ppgtt = to_gen6_ppgtt(i915_vm_to_ppgtt(vm));
 	struct i915_page_table *pt;
+	intel_wakeref_t wakeref;
 	u64 from = start;
 	unsigned int pde;
 	bool flush = false;
 
+	wakeref = intel_runtime_pm_get(vm->i915);
+
 	gen6_for_each_pde(pt, &ppgtt->base.pd, start, length, pde) {
 		const unsigned int count = gen6_pte_count(start, length);
 
@@ -1774,12 +1777,15 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
 
 	if (flush) {
 		mark_tlbs_dirty(&ppgtt->base);
-		gen6_ggtt_invalidate(ppgtt->base.vm.i915);
+		gen6_ggtt_invalidate(vm->i915);
 	}
 
+	intel_runtime_pm_put(vm->i915, wakeref);
+
 	return 0;
 
 unwind_out:
+	intel_runtime_pm_put(vm->i915, wakeref);
 	gen6_ppgtt_clear_range(vm, from, start - from);
 	return -ENOMEM;
 }
-- 
2.20.1

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

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

end of thread, other threads:[~2019-05-07 12:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-07 10:55 [PATCH v2 1/2] drm/i915/gtt: grab wakeref in gen6_alloc_va_range Matthew Auld
2019-05-07 10:55 ` [PATCH v2 2/2] drm/i915: add in-kernel blitter client Matthew Auld
2019-05-07 11:57   ` Chris Wilson
2019-05-07 11:36 ` [PATCH v2 1/2] drm/i915/gtt: grab wakeref in gen6_alloc_va_range Chris Wilson
2019-05-07 12:14 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/2] " Patchwork
2019-05-07 12:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-05-07 12:45 ` ✗ Fi.CI.BAT: failure " Patchwork

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