Commit 4d340832 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/display: convert to display runtime PM interfaces



Convert i915 runtime PM interfaces to display runtime PM interfaces all
over the place in display code.

Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/494d0bd0348e4aa99560f1aed21aaaff31706c44.1742483007.git.jani.nikula@intel.com
parent 31630f39
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "i915_reg.h"
#include "intel_color_regs.h"
#include "intel_de.h"
#include "intel_display_rpm.h"
#include "intel_display_types.h"
#include "intel_pcode.h"

@@ -344,10 +345,9 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
{
	struct intel_crtc *crtc = m->private;
	struct intel_display *display = to_intel_display(crtc);
	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
	intel_wakeref_t wakeref;
	struct ref_tracker *wakeref;

	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
	wakeref = intel_display_rpm_get(display);

	seq_printf(m, "Enabled by kernel parameter: %s\n",
		   str_yes_no(display->params.enable_ips));
@@ -361,7 +361,7 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
			seq_puts(m, "Currently: disabled\n");
	}

	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
	intel_display_rpm_put(display, wakeref);

	return 0;
}
+7 −10
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "intel_display_debugfs_params.h"
#include "intel_display_power.h"
#include "intel_display_power_well.h"
#include "intel_display_rpm.h"
#include "intel_display_types.h"
#include "intel_dmc.h"
#include "intel_dp.h"
@@ -580,13 +581,12 @@ static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
static int i915_display_info(struct seq_file *m, void *unused)
{
	struct intel_display *display = node_to_intel_display(m->private);
	struct drm_i915_private *dev_priv = to_i915(display->drm);
	struct intel_crtc *crtc;
	struct drm_connector *connector;
	struct drm_connector_list_iter conn_iter;
	intel_wakeref_t wakeref;
	struct ref_tracker *wakeref;

	wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
	wakeref = intel_display_rpm_get(display);

	drm_modeset_lock_all(display->drm);

@@ -605,7 +605,7 @@ static int i915_display_info(struct seq_file *m, void *unused)

	drm_modeset_unlock_all(display->drm);

	intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
	intel_display_rpm_put(display, wakeref);

	return 0;
}
@@ -690,14 +690,11 @@ static bool
intel_lpsp_power_well_enabled(struct intel_display *display,
			      enum i915_power_well_id power_well_id)
{
	struct drm_i915_private *i915 = to_i915(display->drm);
	intel_wakeref_t wakeref;
	bool is_enabled;

	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
	with_intel_display_rpm(display)
		is_enabled = intel_display_power_well_is_enabled(display,
								 power_well_id);
	intel_runtime_pm_put(&i915->runtime_pm, wakeref);

	return is_enabled;
}
+3 −3
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "intel_crtc.h"
#include "intel_de.h"
#include "intel_display_irq.h"
#include "intel_display_rpm.h"
#include "intel_display_trace.h"
#include "intel_display_types.h"
#include "intel_dmc_wl.h"
@@ -1517,10 +1518,9 @@ void gen11_gu_misc_irq_handler(struct intel_display *display, const u32 iir)

void gen11_display_irq_handler(struct intel_display *display)
{
	struct drm_i915_private *i915 = to_i915(display->drm);
	u32 disp_ctl;

	disable_rpm_wakeref_asserts(&i915->runtime_pm);
	intel_display_rpm_assert_block(display);
	/*
	 * GEN11_DISPLAY_INT_CTL has same format as GEN8_MASTER_IRQ
	 * for the display related bits.
@@ -1531,7 +1531,7 @@ void gen11_display_irq_handler(struct intel_display *display)
	gen8_de_irq_handler(display, disp_ctl);
	intel_de_write(display, GEN11_DISPLAY_INT_CTL, GEN11_DISPLAY_IRQ_ENABLE);

	enable_rpm_wakeref_asserts(&i915->runtime_pm);
	intel_display_rpm_assert_unblock(display);
}

static void i915gm_irq_cstate_wa_enable(struct intel_display *display)
+5 −4
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_de.h"
#include "intel_display_rpm.h"
#include "intel_dmc.h"
#include "intel_dmc_regs.h"
#include "intel_step.h"
@@ -595,7 +596,7 @@ void intel_dmc_load_program(struct intel_display *display)

	disable_all_event_handlers(display);

	assert_rpm_wakelock_held(&i915->runtime_pm);
	assert_display_rpm_held(display);

	preempt_disable();

@@ -1237,13 +1238,13 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
	struct intel_display *display = m->private;
	struct drm_i915_private *i915 = to_i915(display->drm);
	struct intel_dmc *dmc = display_to_dmc(display);
	intel_wakeref_t wakeref;
	struct ref_tracker *wakeref;
	i915_reg_t dc5_reg, dc6_reg = INVALID_MMIO_REG;

	if (!HAS_DMC(display))
		return -ENODEV;

	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
	wakeref = intel_display_rpm_get(display);

	seq_printf(m, "DMC initialized: %s\n", str_yes_no(dmc));
	seq_printf(m, "fw loaded: %s\n",
@@ -1299,7 +1300,7 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
		   intel_de_read(display, DMC_SSP_BASE));
	seq_printf(m, "htp: 0x%08x\n", intel_de_read(display, DMC_HTP_SKL));

	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
	intel_display_rpm_put(display, wakeref);

	return 0;
}
+2 −3
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@
#include "intel_ddi.h"
#include "intel_de.h"
#include "intel_display_driver.h"
#include "intel_display_rpm.h"
#include "intel_display_types.h"
#include "intel_dp.h"
#include "intel_dp_aux.h"
@@ -87,7 +88,6 @@
#include "intel_pfit.h"
#include "intel_pps.h"
#include "intel_psr.h"
#include "intel_runtime_pm.h"
#include "intel_quirks.h"
#include "intel_tc.h"
#include "intel_vdsc.h"
@@ -6144,13 +6144,12 @@ enum irqreturn
intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
{
	struct intel_display *display = to_intel_display(dig_port);
	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
	struct intel_dp *intel_dp = &dig_port->dp;
	u8 dpcd[DP_RECEIVER_CAP_SIZE];

	if (dig_port->base.type == INTEL_OUTPUT_EDP &&
	    (long_hpd ||
	     intel_runtime_pm_suspended(&i915->runtime_pm) ||
	     intel_display_rpm_suspended(display) ||
	     !intel_pps_have_panel_power_or_vdd(intel_dp))) {
		/*
		 * vdd off can generate a long/short pulse on eDP which
Loading