drm/i915: update rpm_get/put to use the rpm structure
The functions where internally already only using the structure, so we need to just flip the interface. v2: rebase Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20190613232156.34940-7-daniele.ceraolospurio@intel.com
Šī revīzija ir iekļauta:

revīziju iesūtīja
Chris Wilson

vecāks
69c6635544
revīzija
d858d5695f
@@ -222,6 +222,7 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
|
||||
struct drm_i915_gem_object *obj = to_intel_bo(area->vm_private_data);
|
||||
struct drm_device *dev = obj->base.dev;
|
||||
struct drm_i915_private *i915 = to_i915(dev);
|
||||
struct intel_runtime_pm *rpm = &i915->runtime_pm;
|
||||
struct i915_ggtt *ggtt = &i915->ggtt;
|
||||
bool write = area->vm_flags & VM_WRITE;
|
||||
intel_wakeref_t wakeref;
|
||||
@@ -243,7 +244,7 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(rpm);
|
||||
|
||||
srcu = i915_reset_trylock(i915);
|
||||
if (srcu < 0) {
|
||||
@@ -308,7 +309,7 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
|
||||
goto err_fence;
|
||||
|
||||
/* Mark as being mmapped into userspace for later revocation */
|
||||
assert_rpm_wakelock_held(&i915->runtime_pm);
|
||||
assert_rpm_wakelock_held(rpm);
|
||||
if (!i915_vma_set_userfault(vma) && !obj->userfault_count++)
|
||||
list_add(&obj->userfault_link, &i915->ggtt.userfault_list);
|
||||
if (CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND)
|
||||
@@ -327,7 +328,7 @@ err_unlock:
|
||||
err_reset:
|
||||
i915_reset_unlock(i915, srcu);
|
||||
err_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(rpm, wakeref);
|
||||
i915_gem_object_unpin_pages(obj);
|
||||
err:
|
||||
switch (ret) {
|
||||
@@ -410,7 +411,7 @@ void i915_gem_object_release_mmap(struct drm_i915_gem_object *obj)
|
||||
* wakeref.
|
||||
*/
|
||||
lockdep_assert_held(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
if (!obj->userfault_count)
|
||||
goto out;
|
||||
@@ -427,7 +428,7 @@ void i915_gem_object_release_mmap(struct drm_i915_gem_object *obj)
|
||||
wmb();
|
||||
|
||||
out:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
|
||||
static int create_mmap_offset(struct drm_i915_gem_object *obj)
|
||||
|
@@ -181,7 +181,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
|
||||
struct drm_i915_gem_object *obj, *on;
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
llist_for_each_entry_safe(obj, on, freed, freed) {
|
||||
struct i915_vma *vma, *vn;
|
||||
|
||||
@@ -243,7 +243,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
|
||||
|
||||
cond_resched();
|
||||
}
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
|
||||
void i915_gem_flush_free_objects(struct drm_i915_private *i915)
|
||||
|
@@ -182,7 +182,7 @@ i915_gem_shrink(struct drm_i915_private *i915,
|
||||
* we will force the wake during oom-notifier.
|
||||
*/
|
||||
if (shrink & I915_SHRINK_BOUND) {
|
||||
wakeref = intel_runtime_pm_get_if_in_use(i915);
|
||||
wakeref = intel_runtime_pm_get_if_in_use(&i915->runtime_pm);
|
||||
if (!wakeref)
|
||||
shrink &= ~I915_SHRINK_BOUND;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ i915_gem_shrink(struct drm_i915_private *i915,
|
||||
}
|
||||
|
||||
if (shrink & I915_SHRINK_BOUND)
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
|
||||
i915_retire_requests(i915);
|
||||
|
||||
|
@@ -1754,7 +1754,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv)
|
||||
return PTR_ERR(file);
|
||||
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(dev_priv);
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
|
||||
ctx = live_context(dev_priv, file);
|
||||
if (IS_ERR(ctx)) {
|
||||
@@ -1768,7 +1768,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv)
|
||||
err = i915_subtests(tests, ctx);
|
||||
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(dev_priv, wakeref);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
|
||||
mock_file_free(dev_priv, file);
|
||||
|
@@ -293,7 +293,7 @@ static int igt_gem_coherency(void *arg)
|
||||
values = offsets + ncachelines;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
for (over = igt_coherency_mode; over->name; over++) {
|
||||
if (!over->set)
|
||||
continue;
|
||||
@@ -371,7 +371,7 @@ static int igt_gem_coherency(void *arg)
|
||||
}
|
||||
}
|
||||
unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
kfree(offsets);
|
||||
return err;
|
||||
|
@@ -53,7 +53,7 @@ static int live_nop_switch(void *arg)
|
||||
return PTR_ERR(file);
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
ctx = kcalloc(nctx, sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx) {
|
||||
@@ -156,7 +156,7 @@ static int live_nop_switch(void *arg)
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
mock_file_free(i915, file);
|
||||
return err;
|
||||
@@ -1084,7 +1084,7 @@ __igt_ctx_sseu(struct drm_i915_private *i915,
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
ce = i915_gem_context_get_engine(ctx, RCS0);
|
||||
if (IS_ERR(ce)) {
|
||||
@@ -1124,7 +1124,7 @@ out_fail:
|
||||
out_context:
|
||||
intel_context_put(ce);
|
||||
out_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
i915_gem_object_put(obj);
|
||||
|
||||
out_unlock:
|
||||
@@ -1541,7 +1541,7 @@ static int igt_vm_isolation(void *arg)
|
||||
GEM_BUG_ON(ctx_b->vm->total != vm_total);
|
||||
vm_total -= I915_GTT_PAGE_SIZE;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
count = 0;
|
||||
for_each_engine(engine, i915, id) {
|
||||
@@ -1586,7 +1586,7 @@ static int igt_vm_isolation(void *arg)
|
||||
count, RUNTIME_INFO(i915)->num_engines);
|
||||
|
||||
out_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
out_unlock:
|
||||
if (igt_live_test_end(&t))
|
||||
err = -EIO;
|
||||
|
@@ -205,7 +205,7 @@ static int igt_partial_tiling(void *arg)
|
||||
}
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
if (1) {
|
||||
IGT_TIMEOUT(end);
|
||||
@@ -316,7 +316,7 @@ next_tiling: ;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
i915_gem_object_unpin_pages(obj);
|
||||
out:
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user