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
This commit is contained in:

committad av
Chris Wilson

förälder
69c6635544
incheckning
d858d5695f
@@ -97,7 +97,7 @@ static int live_active_wait(void *arg)
|
||||
/* Check that we get a callback when requests retire upon waiting */
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
err = __live_active_setup(i915, &active);
|
||||
|
||||
@@ -111,7 +111,7 @@ static int live_active_wait(void *arg)
|
||||
if (igt_flush_test(i915, I915_WAIT_LOCKED))
|
||||
err = -EIO;
|
||||
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ static int live_active_retire(void *arg)
|
||||
/* Check that we get a callback when requests are indirectly retired */
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
err = __live_active_setup(i915, &active);
|
||||
|
||||
@@ -140,7 +140,7 @@ static int live_active_retire(void *arg)
|
||||
}
|
||||
|
||||
i915_active_fini(&active.base);
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ static void simulate_hibernate(struct drm_i915_private *i915)
|
||||
{
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
/*
|
||||
* As a final sting in the tail, invalidate stolen. Under a real S4,
|
||||
@@ -74,7 +74,7 @@ static void simulate_hibernate(struct drm_i915_private *i915)
|
||||
*/
|
||||
trash_stolen(i915);
|
||||
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
|
||||
static int pm_prepare(struct drm_i915_private *i915)
|
||||
|
@@ -404,7 +404,7 @@ static int igt_evict_contexts(void *arg)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
/* Reserve a block so that we know we have enough to fit a few rq */
|
||||
memset(&hole, 0, sizeof(hole));
|
||||
@@ -515,7 +515,7 @@ out_locked:
|
||||
}
|
||||
if (drm_mm_node_allocated(&hole))
|
||||
drm_mm_remove_node(&hole);
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
|
||||
return err;
|
||||
|
@@ -295,9 +295,9 @@ static int lowlevel_hole(struct drm_i915_private *i915,
|
||||
mock_vma.node.size = BIT_ULL(size);
|
||||
mock_vma.node.start = addr;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
vm->insert_entries(vm, &mock_vma, I915_CACHE_NONE, 0);
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
count = n;
|
||||
|
||||
@@ -1171,7 +1171,7 @@ static int igt_ggtt_page(void *arg)
|
||||
if (err)
|
||||
goto out_unpin;
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
for (n = 0; n < count; n++) {
|
||||
u64 offset = tmp.start + n * PAGE_SIZE;
|
||||
@@ -1218,7 +1218,7 @@ static int igt_ggtt_page(void *arg)
|
||||
kfree(order);
|
||||
out_remove:
|
||||
ggtt->vm.clear_range(&ggtt->vm, tmp.start, tmp.size);
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
drm_mm_remove_node(&tmp);
|
||||
out_unpin:
|
||||
i915_gem_object_unpin_pages(obj);
|
||||
|
@@ -537,7 +537,7 @@ static int live_nop_request(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
for_each_engine(engine, i915, id) {
|
||||
struct i915_request *request = NULL;
|
||||
@@ -597,7 +597,7 @@ static int live_nop_request(void *arg)
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -682,7 +682,7 @@ static int live_empty_request(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
batch = empty_batch(i915);
|
||||
if (IS_ERR(batch)) {
|
||||
@@ -746,7 +746,7 @@ out_batch:
|
||||
i915_vma_unpin(batch);
|
||||
i915_vma_put(batch);
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -839,7 +839,7 @@ static int live_all_engines(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
err = igt_live_test_begin(&t, i915, __func__, "");
|
||||
if (err)
|
||||
@@ -919,7 +919,7 @@ out_request:
|
||||
i915_vma_unpin(batch);
|
||||
i915_vma_put(batch);
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -942,7 +942,7 @@ static int live_sequential_engines(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
err = igt_live_test_begin(&t, i915, __func__, "");
|
||||
if (err)
|
||||
@@ -1048,7 +1048,7 @@ out_request:
|
||||
i915_request_put(request[id]);
|
||||
}
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ static int live_breadcrumbs_smoketest(void *arg)
|
||||
* On real hardware this time.
|
||||
*/
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
file = mock_file(i915);
|
||||
if (IS_ERR(file)) {
|
||||
@@ -1220,7 +1220,7 @@ out_threads:
|
||||
out_file:
|
||||
mock_file_free(i915, file);
|
||||
out_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -515,7 +515,7 @@ static int live_hwsp_engine(void *arg)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
count = 0;
|
||||
for_each_engine(engine, i915, id) {
|
||||
@@ -558,7 +558,7 @@ out:
|
||||
i915_timeline_put(tl);
|
||||
}
|
||||
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
|
||||
kvfree(timelines);
|
||||
@@ -591,7 +591,7 @@ static int live_hwsp_alternate(void *arg)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
count = 0;
|
||||
for (n = 0; n < NUM_TIMELINES; n++) {
|
||||
@@ -634,7 +634,7 @@ out:
|
||||
i915_timeline_put(tl);
|
||||
}
|
||||
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
|
||||
kvfree(timelines);
|
||||
@@ -658,7 +658,7 @@ static int live_hwsp_wrap(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
tl = i915_timeline_create(i915, NULL);
|
||||
if (IS_ERR(tl)) {
|
||||
@@ -749,7 +749,7 @@ out:
|
||||
out_free:
|
||||
i915_timeline_put(tl);
|
||||
out_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
|
||||
return err;
|
||||
@@ -771,7 +771,7 @@ static int live_hwsp_recycle(void *arg)
|
||||
*/
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
count = 0;
|
||||
for_each_engine(engine, i915, id) {
|
||||
@@ -825,7 +825,7 @@ static int live_hwsp_recycle(void *arg)
|
||||
out:
|
||||
if (igt_flush_test(i915, I915_WAIT_LOCKED))
|
||||
err = -EIO;
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
|
||||
return err;
|
||||
|
@@ -873,7 +873,7 @@ static int igt_vma_remapped_gtt(void *arg)
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
for (t = types; *t; t++) {
|
||||
for (p = planes; p->width; p++) {
|
||||
@@ -965,7 +965,7 @@ static int igt_vma_remapped_gtt(void *arg)
|
||||
}
|
||||
|
||||
out:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
i915_gem_object_put(obj);
|
||||
|
||||
|
@@ -144,7 +144,7 @@ static int igt_guc_clients(void *args)
|
||||
|
||||
GEM_BUG_ON(!HAS_GUC(dev_priv));
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(dev_priv);
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
|
||||
guc = &dev_priv->guc;
|
||||
if (!guc) {
|
||||
@@ -227,7 +227,7 @@ out:
|
||||
guc_clients_create(guc);
|
||||
guc_clients_enable(guc);
|
||||
unlock:
|
||||
intel_runtime_pm_put(dev_priv, wakeref);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ static int igt_guc_doorbells(void *arg)
|
||||
|
||||
GEM_BUG_ON(!HAS_GUC(dev_priv));
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
wakeref = intel_runtime_pm_get(dev_priv);
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
|
||||
guc = &dev_priv->guc;
|
||||
if (!guc) {
|
||||
@@ -340,7 +340,7 @@ out:
|
||||
guc_client_free(clients[i]);
|
||||
}
|
||||
unlock:
|
||||
intel_runtime_pm_put(dev_priv, wakeref);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
return err;
|
||||
}
|
||||
|
@@ -176,7 +176,7 @@ static int live_forcewake_ops(void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
wakeref = intel_runtime_pm_get(i915);
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
|
||||
for_each_fw_domain(domain, uncore, tmp) {
|
||||
smp_store_mb(domain->active, false);
|
||||
@@ -247,7 +247,7 @@ static int live_forcewake_ops(void *arg)
|
||||
}
|
||||
|
||||
out_rpm:
|
||||
intel_runtime_pm_put(i915, wakeref);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Referens i nytt ärende
Block a user