diff options
author | Matthew Auld <matthew.auld@intel.com> | 2019-05-29 13:31:07 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-05-30 12:00:41 +0100 |
commit | 0a4a6e74e7335d8c29eed70398505b5396695cc4 (patch) | |
tree | 5ca05ece710ee74f10fdd0d2641b1f81d3abe599 /drivers/gpu/drm | |
parent | 7f5f228008e4d6f59212b0ee693cbc36212096ba (diff) | |
download | linux-0a4a6e74e7335d8c29eed70398505b5396695cc4.tar.bz2 |
drm/i915/gtt: grab wakeref in gen6_alloc_va_range
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>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190529123108.24422-1-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 5b1a501c4159..ca8a69e8b098 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -1749,10 +1749,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); @@ -1778,12 +1781,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; } |