Commit cd6a8513 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915/gt: Prefer local path to runtime powermanagement



Avoid going to the base i915 device when we already have a path from gt
to the runtime powermanagement interface. The benefit is that it looks a
bit more self-consistent to always be acquiring the gt->uncore->rpm for
use with the gt->uncore.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191007154531.1750-1-chris@chris-wilson.co.uk
parent b9dcb97b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ int __intel_context_do_pin(struct intel_context *ce)
		}

		err = 0;
		with_intel_runtime_pm(&ce->engine->i915->runtime_pm, wakeref)
		with_intel_runtime_pm(ce->engine->uncore->rpm, wakeref)
			err = ce->ops->pin(ce);
		if (err)
			goto err;
+2 −2
Original line number Diff line number Diff line
@@ -1458,10 +1458,10 @@ void intel_engine_dump(struct intel_engine_cs *engine,
	spin_unlock_irqrestore(&engine->active.lock, flags);

	drm_printf(m, "\tMMIO base:  0x%08x\n", engine->mmio_base);
	wakeref = intel_runtime_pm_get_if_in_use(&engine->i915->runtime_pm);
	wakeref = intel_runtime_pm_get_if_in_use(engine->uncore->rpm);
	if (wakeref) {
		intel_engine_print_registers(engine, m);
		intel_runtime_pm_put(&engine->i915->runtime_pm, wakeref);
		intel_runtime_pm_put(engine->uncore->rpm, wakeref);
	} else {
		drm_printf(m, "\tDevice is asleep; skipping register dump\n");
	}
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ static const struct intel_wakeref_ops wf_ops = {

void intel_engine_init__pm(struct intel_engine_cs *engine)
{
	struct intel_runtime_pm *rpm = &engine->i915->runtime_pm;
	struct intel_runtime_pm *rpm = engine->uncore->rpm;

	intel_wakeref_init(&engine->wakeref, rpm, &wf_ops);
}
+3 −4
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ void intel_gt_check_and_clear_faults(struct intel_gt *gt)

void intel_gt_flush_ggtt_writes(struct intel_gt *gt)
{
	struct drm_i915_private *i915 = gt->i915;
	struct intel_uncore *uncore = gt->uncore;
	intel_wakeref_t wakeref;

	/*
@@ -297,13 +297,12 @@ void intel_gt_flush_ggtt_writes(struct intel_gt *gt)

	wmb();

	if (INTEL_INFO(i915)->has_coherent_ggtt)
	if (INTEL_INFO(gt->i915)->has_coherent_ggtt)
		return;

	intel_gt_chipset_flush(gt);

	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
		struct intel_uncore *uncore = gt->uncore;
	with_intel_runtime_pm(uncore->rpm, wakeref) {
		unsigned long flags;

		spin_lock_irqsave(&uncore->lock, flags);
+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static const struct intel_wakeref_ops wf_ops = {

void intel_gt_pm_init_early(struct intel_gt *gt)
{
	intel_wakeref_init(&gt->wakeref, &gt->i915->runtime_pm, &wf_ops);
	intel_wakeref_init(&gt->wakeref, gt->uncore->rpm, &wf_ops);

	BLOCKING_INIT_NOTIFIER_HEAD(&gt->pm_notifications);
}
@@ -222,7 +222,7 @@ void intel_gt_suspend(struct intel_gt *gt)
	/* We expect to be idle already; but also want to be independent */
	wait_for_idle(gt);

	with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref)
	with_intel_runtime_pm(gt->uncore->rpm, wakeref)
		intel_rc6_disable(&gt->rc6);
}

Loading