Skip to contentSkip to conversation

drm/i915: Refactor the display power domain mappings

PATCH Superseded Imre Deak 3 participants 37 messages Feb 8, 2022 – Feb 22, 2022 Page 1 of 2

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Imre Deak

author
#0 lore raw

v2 cover drm/i915: Refactor the display power domain mappings

This is v2 of [1] addressing the review comments from Jani, moving the power well ops/desc struct accessor functions and implementation of the platform specific power well hooks to a separate file.

[1] https://patchwork.freedesktop.org/series/99476/

Cc Jani Nikula <[email protected]>

Imre Deak (26):
drm/i915: Fix the VDSC_PW2 power domain enum value drm/i915: Sanitize open-coded power well enable()/disable() calls drm/i915: Remove redundant state verification during TypeC AUX power
well disabling
drm/i915: Move i915_power_well_regs struct into i915_power_well_ops drm/i915: Move power well get/put/enable/disable functions to a new
file
drm/i915: Add function to call a power well's sync_hw() hook drm/i915: Add functions to get a power well's
state/name/domains/mask/refcount
drm/i915: Move intel_display_power_well_is_enabled() to
intel_display_power_well.c
drm/i915: Move per-platform power well hooks to
intel_display_power_well.c
drm/i915: Unexport the for_each_power_well() macros drm/i915: Move the power domain->well mappings to
intel_display_power_map.c
drm/i915: Move the dg2 fixed_enable_delay power well param to a common
bitfield
drm/i915: Move the HSW power well flags to a common bitfield drm/i915: Rename the power domain names to end with pipes/ports drm/i915: Sanitize the power well names
drm/i915: Convert the power well descriptor domain mask to an array of
domains
drm/i915: Convert the u64 power well domains mask to a bitmap drm/i915: Simplify power well definitions by adding power well
instances
drm/i915: Allow platforms to share power well descriptors drm/i915: Simplify the DG1 power well descriptors drm/i915: Sanitize the ADL-S power well definition drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each
platform
drm/i915: Remove the aliasing of power domain enum values drm/i915: Remove the ICL specific TBT power domains drm/i915: Remove duplicate DDI/AUX power domain mappings drm/i915: Remove the XELPD specific AUX and DDI power domains

 drivers/gpu/drm/i915/Makefile                 |    2 +
 drivers/gpu/drm/i915/display/g4x_dp.c         |    3 +-
 drivers/gpu/drm/i915/display/g4x_hdmi.c       |    3 +-
 drivers/gpu/drm/i915/display/icl_dsi.c        |    8 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      |    6 +-
 drivers/gpu/drm/i915/display/intel_display.c  |  150 +-
 drivers/gpu/drm/i915/display/intel_display.h  |    4 +-
 .../drm/i915/display/intel_display_debugfs.c  |    1 +
 .../drm/i915/display/intel_display_power.c    | 4842 ++---------------
 .../drm/i915/display/intel_display_power.h    |  154 +-
 .../i915/display/intel_display_power_map.c    | 1487 +++++
 .../i915/display/intel_display_power_map.h    |   14 +
 .../i915/display/intel_display_power_well.c   | 1937 +++++++
 .../i915/display/intel_display_power_well.h   |  168 +
 drivers/gpu/drm/i915/display/intel_hdcp.c     |    1 +
 drivers/gpu/drm/i915/display/intel_tc.c       |    5 +-
 16 files changed, 4105 insertions(+), 4680 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_map.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_map.h
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_well.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_well.h
Signature · 1 line
2.27.0
author
#1 lore raw

PATCH v2 1/26 drm/i915: Fix the VDSC_PW2 power domain enum value

The POWER_DOMAIN_TRANSCODER() macro depends on the POWER_DOMAIN_TRANSCODER_A/B .. DSI_A/C enum values to be consecutive, move POWER_DOMAIN_TRANSCODER_VDSC_PW2 after these to ensure this. The wrong order didn't cause a problem, since the DSI_A/C domains are in always-on power wells on all relevant platforms. The same power well ends up being enabled/disabled when the VDSC_PW2 domain is selected incorrectly.

While at it add a code comment about enum values that need to stay consecutive.

---
 drivers/gpu/drm/i915/display/intel_display_power.c |  4 ++--
 drivers/gpu/drm/i915/display/intel_display_power.h | 11 +++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
index d2102cc17bb4c..143f5c0e1f43c 100644
@@ -152,12 +152,12 @@ intel_display_power_domain_str(enum intel_display_power_domain domain)
 		return "TRANSCODER_D";
 	case POWER_DOMAIN_TRANSCODER_EDP:
 		return "TRANSCODER_EDP";
-	case POWER_DOMAIN_TRANSCODER_VDSC_PW2:
-		return "TRANSCODER_VDSC_PW2";
 	case POWER_DOMAIN_TRANSCODER_DSI_A:
 		return "TRANSCODER_DSI_A";
 	case POWER_DOMAIN_TRANSCODER_DSI_C:
 		return "TRANSCODER_DSI_C";
+	case POWER_DOMAIN_TRANSCODER_VDSC_PW2:
+		return "TRANSCODER_VDSC_PW2";
 	case POWER_DOMAIN_PORT_DDI_A_LANES:
 		return "PORT_DDI_A_LANES";
 	case POWER_DOMAIN_PORT_DDI_B_LANES:
drivers/gpu/drm/i915/display/intel_display_power.h +9 -2
index f6d0e6e73c6d9..f28aa4b500c42 100644
@@ -14,6 +14,11 @@ struct drm_i915_private;
 struct i915_power_well;
 struct intel_encoder;
 
+/*
+ * Keep the pipe, transcoder, port (DDI_LANES,DDI_IO,AUX) domain instances
+ * consecutive, so that the pipe,transcoder,port -> power domain macros
+ * work correctly.
+ */
 enum intel_display_power_domain {
 	POWER_DOMAIN_DISPLAY_CORE,
 	POWER_DOMAIN_PIPE_A,
@@ -29,10 +34,12 @@ enum intel_display_power_domain {
 	POWER_DOMAIN_TRANSCODER_C,
 	POWER_DOMAIN_TRANSCODER_D,
 	POWER_DOMAIN_TRANSCODER_EDP,
-	/* VDSC/joining for eDP/DSI transcoder (ICL) or pipe A (TGL) */
-	POWER_DOMAIN_TRANSCODER_VDSC_PW2,
 	POWER_DOMAIN_TRANSCODER_DSI_A,
 	POWER_DOMAIN_TRANSCODER_DSI_C,
+
+	/* VDSC/joining for eDP/DSI transcoder (ICL) or pipe A (TGL) */
+	POWER_DOMAIN_TRANSCODER_VDSC_PW2,
+
 	POWER_DOMAIN_PORT_DDI_A_LANES,
 	POWER_DOMAIN_PORT_DDI_B_LANES,
 	POWER_DOMAIN_PORT_DDI_C_LANES,
Signature · 1 line
2.27.0
author
#2 lore raw

PATCH v2 2/26 drm/i915: Sanitize open-coded power well enable()/disable() calls

In reply to Imre Deak

Instead of open-coding the call of the power wells' enable()/disable() hooks use the corresponding helper functions. This will also ensure that the power well's cached-enable state is always up-to-date. Luckily the lack of this updating hasn't been a problem, since the state either didn't change (in intel_display_power_set_target_dc_state()), or got updated subsequently (for vlv_cmnlane_wa(), in the following intel_power_domains_sync_hw()).

---
 drivers/gpu/drm/i915/display/intel_display_power.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +4 -4
index 143f5c0e1f43c..a90866b8bf7c4 100644
@@ -1129,12 +1129,12 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,
 	 * DC off power well to effect target DC state.
 	 */
 	if (!dc_off_enabled)
-		power_well->desc->ops->enable(dev_priv, power_well);
+		intel_power_well_enable(dev_priv, power_well);
 
 	dev_priv->dmc.target_dc_state = state;
 
 	if (!dc_off_enabled)
-		power_well->desc->ops->disable(dev_priv, power_well);
+		intel_power_well_disable(dev_priv, power_well);
 
 unlock:
 	mutex_unlock(&power_domains->lock);
@@ -6072,7 +6072,7 @@ static void vlv_cmnlane_wa(struct drm_i915_private *dev_priv)
 	drm_dbg_kms(&dev_priv->drm, "toggling display PHY side reset\n");
 
 	/* cmnlane needs DPLL registers */
-	disp2d->desc->ops->enable(dev_priv, disp2d);
+	intel_power_well_enable(dev_priv, disp2d);
 
 	/*
 	 * From VLV2A0_DP_eDP_HDMI_DPIO_driver_vbios_notes_11.docx:
@@ -6081,7 +6081,7 @@ static void vlv_cmnlane_wa(struct drm_i915_private *dev_priv)
 	 * Simply ungating isn't enough to reset the PHY enough to get
 	 * ports and lanes running.
 	 */
-	cmn->desc->ops->disable(dev_priv, cmn);
+	intel_power_well_disable(dev_priv, cmn);
 }
 
 static bool vlv_punit_is_power_gated(struct drm_i915_private *dev_priv, u32 reg0)
Signature · 1 line
2.27.0
author
#3 lore raw

PATCH v2 3/26 drm/i915: Remove redundant state verification during TypeC AUX power well disabling

In reply to Imre Deak

Commit d5ce34da31456a
("drm/i915: Add state verification for the TypeC port mode") added a verification to the TypeC AUX power well enable()/disable() hooks to check if the TypeC port related to this power well is properly locked. If the disabling happens asynchronously the verification is skipped, since in this case the port is unlocked. The detection of asnychronous disabling doesn't work as intended though, since the power well's reference count is always 0 when its disable() hook is called (and since there won't be any domain reference held for this power well either, the verification is always skipped); remove the verification from the disable() hook for now. In the power well's enable() hook the power well's reference will be always >0 and there won't be any asynchronous disabling pending for it, so we can drop the async refcount check from there.

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 32 +------------------
 1 file changed, 1 insertion(+), 31 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +1 -31
index a90866b8bf7c4..621aa890ff6f4 100644
@@ -635,28 +635,10 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
 
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
 
-static u64 async_put_domains_mask(struct i915_power_domains *power_domains);
-
-static int power_well_async_ref_count(struct drm_i915_private *dev_priv,
-				      struct i915_power_well *power_well)
-{
-	int refs = hweight64(power_well->desc->domains &
-			     async_put_domains_mask(&dev_priv->power_domains));
-
-	drm_WARN_ON(&dev_priv->drm, refs > power_well->count);
-
-	return refs;
-}
-
 static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
 					struct i915_power_well *power_well,
 					struct intel_digital_port *dig_port)
 {
-	/* Bypass the check if all references are released asynchronously */
-	if (power_well_async_ref_count(dev_priv, power_well) ==
-	    power_well->count)
-		return;
-
 	if (drm_WARN_ON(&dev_priv->drm, !dig_port))
 		return;
 
@@ -747,18 +729,6 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
 	}
 }
 
-static void
-icl_tc_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
-				  struct i915_power_well *power_well)
-{
-	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);
-
-	icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
-
-	hsw_power_well_disable(dev_priv, power_well);
-}
-
 static void
 icl_aux_power_well_enable(struct drm_i915_private *dev_priv,
 			  struct i915_power_well *power_well)
@@ -781,7 +751,7 @@ icl_aux_power_well_disable(struct drm_i915_private *dev_priv,
 	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
 
 	if (intel_phy_is_tc(dev_priv, phy))
-		return icl_tc_phy_aux_power_well_disable(dev_priv, power_well);
+		return hsw_power_well_disable(dev_priv, power_well);
 	else if (IS_ICELAKE(dev_priv))
 		return icl_combo_phy_aux_power_well_disable(dev_priv,
 							    power_well);
Signature · 1 line
2.27.0
author
#4 lore raw

PATCH v2 4/26 drm/i915: Move i915_power_well_regs struct into i915_power_well_ops

In reply to Imre Deak

Move the i915_power_well_regs struct into i915_power_well_ops. Most of the power wells use the same ops/regs combination, so this saves some space and also simplifies the platform power domain->power well definitions.

---
 .../drm/i915/display/intel_display_power.c    | 256 +++++-------------
 1 file changed, 73 insertions(+), 183 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +73 -183
index 621aa890ff6f4..3269a08435e35 100644
@@ -25,7 +25,15 @@
 #include "intel_vga.h"
 #include "vlv_sideband.h"
 
+struct i915_power_well_regs {
+	i915_reg_t bios;
+	i915_reg_t driver;
+	i915_reg_t kvmr;
+	i915_reg_t debug;
+};
+
 struct i915_power_well_ops {
+	const struct i915_power_well_regs *regs;
 	/*
 	 * Synchronize the well's hw state to match the current sw state, for
 	 * example enable/disable it based on the current refcount. Called
@@ -52,13 +60,6 @@ struct i915_power_well_ops {
 			   struct i915_power_well *power_well);
 };
 
-struct i915_power_well_regs {
-	i915_reg_t bios;
-	i915_reg_t driver;
-	i915_reg_t kvmr;
-	i915_reg_t debug;
-};
-
 /* Power well structure for haswell */
 struct i915_power_well_desc {
 	const char *name;
@@ -82,7 +83,6 @@ struct i915_power_well_desc {
 			enum dpio_phy phy;
 		} bxt;
 		struct {
-			const struct i915_power_well_regs *regs;
 			/*
 			 * request/status flag index in the power well
 			 * constrol/status registers.
@@ -437,7 +437,7 @@ static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
 					   struct i915_power_well *power_well,
 					   bool timeout_expected)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	int enable_delay = power_well->desc->hsw.fixed_enable_delay;
 
@@ -481,7 +481,7 @@ static u32 hsw_power_well_requesters(struct drm_i915_private *dev_priv,
 static void hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,
 					    struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	bool disabled;
 	u32 reqs;
@@ -519,7 +519,7 @@ static void gen9_wait_for_power_well_fuses(struct drm_i915_private *dev_priv,
 static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
 				  struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	u32 val;
 
@@ -566,7 +566,7 @@ static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
 static void hsw_power_well_disable(struct drm_i915_private *dev_priv,
 				   struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	u32 val;
 
@@ -583,7 +583,7 @@ static void
 icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
 				    struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
 	u32 val;
@@ -615,7 +615,7 @@ static void
 icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
 				     struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
 	u32 val;
@@ -687,7 +687,7 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
 {
 	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
 	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	bool is_tbt = power_well->desc->hsw.is_tc_tbt;
 	bool timeout_expected;
 	u32 val;
@@ -767,7 +767,7 @@ icl_aux_power_well_disable(struct drm_i915_private *dev_priv,
 static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,
 				   struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	enum i915_power_well_id id = power_well->desc->id;
 	int pw_idx = power_well->desc->hsw.idx;
 	u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
@@ -1177,7 +1177,7 @@ static void skl_enable_dc6(struct drm_i915_private *dev_priv)
 static void hsw_power_well_sync_hw(struct drm_i915_private *dev_priv,
 				   struct i915_power_well *power_well)
 {
-	const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
+	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
 	u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
 	u32 bios_req = intel_de_read(dev_priv, regs->bios);
@@ -3249,7 +3249,15 @@ static const struct i915_power_well_desc i830_power_wells[] = {
 	},
 };
 
+static const struct i915_power_well_regs hsw_power_well_regs = {
+	.bios	= HSW_PWR_WELL_CTL1,
+	.driver	= HSW_PWR_WELL_CTL2,
+	.kvmr	= HSW_PWR_WELL_CTL3,
+	.debug	= HSW_PWR_WELL_CTL4,
+};
+
 static const struct i915_power_well_ops hsw_power_well_ops = {
+	.regs = &hsw_power_well_regs,
 	.sync_hw = hsw_power_well_sync_hw,
 	.enable = hsw_power_well_enable,
 	.disable = hsw_power_well_disable,
@@ -3270,13 +3278,6 @@ static const struct i915_power_well_ops bxt_dpio_cmn_power_well_ops = {
 	.is_enabled = bxt_dpio_cmn_power_well_enabled,
 };
 
-static const struct i915_power_well_regs hsw_power_well_regs = {
-	.bios	= HSW_PWR_WELL_CTL1,
-	.driver	= HSW_PWR_WELL_CTL2,
-	.kvmr	= HSW_PWR_WELL_CTL3,
-	.debug	= HSW_PWR_WELL_CTL4,
-};
-
 static const struct i915_power_well_desc hsw_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3291,7 +3292,6 @@ static const struct i915_power_well_desc hsw_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = HSW_DISP_PW_GLOBAL,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = HSW_PW_CTL_IDX_GLOBAL,
 			.hsw.has_vga = true,
 		},
@@ -3312,7 +3312,6 @@ static const struct i915_power_well_desc bdw_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = HSW_DISP_PW_GLOBAL,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = HSW_PW_CTL_IDX_GLOBAL,
 			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
 			.hsw.has_vga = true,
@@ -3484,7 +3483,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -3497,7 +3495,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_MISC_IO,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_MISC_IO,
 		},
 	},
@@ -3513,7 +3510,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
 			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
 			.hsw.has_vga = true,
@@ -3526,7 +3522,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_A_E,
 		},
 	},
@@ -3536,7 +3531,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_B,
 		},
 	},
@@ -3546,7 +3540,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_C,
 		},
 	},
@@ -3556,7 +3549,6 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_D,
 		},
 	},
@@ -3578,7 +3570,6 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -3595,7 +3586,6 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
 			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
 			.hsw.has_vga = true,
@@ -3638,7 +3628,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -3655,7 +3644,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
 			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
 			.hsw.has_vga = true,
@@ -3695,7 +3683,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_A,
 		},
 	},
@@ -3705,7 +3692,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_B,
 		},
 	},
@@ -3715,7 +3701,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_C,
 		},
 	},
@@ -3725,7 +3710,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = GLK_PW_CTL_IDX_DDI_A,
 		},
 	},
@@ -3735,7 +3719,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_B,
 		},
 	},
@@ -3745,31 +3728,39 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_C,
 		},
 	},
 };
 
-static const struct i915_power_well_ops icl_aux_power_well_ops = {
-	.sync_hw = hsw_power_well_sync_hw,
-	.enable = icl_aux_power_well_enable,
-	.disable = icl_aux_power_well_disable,
-	.is_enabled = hsw_power_well_enabled,
-};
-
 static const struct i915_power_well_regs icl_aux_power_well_regs = {
 	.bios	= ICL_PWR_WELL_CTL_AUX1,
 	.driver	= ICL_PWR_WELL_CTL_AUX2,
 	.debug	= ICL_PWR_WELL_CTL_AUX4,
 };
 
+static const struct i915_power_well_ops icl_aux_power_well_ops = {
+	.regs = &icl_aux_power_well_regs,
+	.sync_hw = hsw_power_well_sync_hw,
+	.enable = icl_aux_power_well_enable,
+	.disable = icl_aux_power_well_disable,
+	.is_enabled = hsw_power_well_enabled,
+};
+
 static const struct i915_power_well_regs icl_ddi_power_well_regs = {
 	.bios	= ICL_PWR_WELL_CTL_DDI1,
 	.driver	= ICL_PWR_WELL_CTL_DDI2,
 	.debug	= ICL_PWR_WELL_CTL_DDI4,
 };
 
+static const struct i915_power_well_ops icl_ddi_power_well_ops = {
+	.regs = &icl_ddi_power_well_regs,
+	.sync_hw = hsw_power_well_sync_hw,
+	.enable = hsw_power_well_enable,
+	.disable = hsw_power_well_disable,
+	.is_enabled = hsw_power_well_enabled,
+};
+
 static const struct i915_power_well_desc icl_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3786,7 +3777,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -3803,7 +3793,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 			.hsw.has_fuses = true,
 		},
@@ -3814,7 +3803,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = ICL_DISP_PW_3,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 			.hsw.irq_pipe_mask = BIT(PIPE_B),
 			.hsw.has_vga = true,
@@ -3824,60 +3812,54 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 	{
 		.name = "DDI A IO",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		},
 	},
 	{
 		.name = "DDI B IO",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		},
 	},
 	{
 		.name = "DDI C IO",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		},
 	},
 	{
 		.name = "DDI D IO",
 		.domains = ICL_DDI_IO_D_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_D,
 		},
 	},
 	{
 		.name = "DDI E IO",
 		.domains = ICL_DDI_IO_E_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_E,
 		},
 	},
 	{
 		.name = "DDI F IO",
 		.domains = ICL_DDI_IO_F_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_F,
 		},
 	},
@@ -3887,7 +3869,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	},
@@ -3897,7 +3878,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	},
@@ -3907,7 +3887,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 			.hsw.is_tc_tbt = false,
 		},
@@ -3918,7 +3897,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_D,
 			.hsw.is_tc_tbt = false,
 		},
@@ -3929,7 +3907,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_E,
 			.hsw.is_tc_tbt = false,
 		},
@@ -3940,7 +3917,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_F,
 			.hsw.is_tc_tbt = false,
 		},
@@ -3951,7 +3927,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT1,
 			.hsw.is_tc_tbt = true,
 		},
@@ -3962,7 +3937,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT2,
 			.hsw.is_tc_tbt = true,
 		},
@@ -3973,7 +3947,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT3,
 			.hsw.is_tc_tbt = true,
 		},
@@ -3984,7 +3957,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT4,
 			.hsw.is_tc_tbt = true,
 		},
@@ -3995,7 +3967,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_C),
@@ -4103,7 +4074,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -4120,7 +4090,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 			.hsw.has_fuses = true,
 		},
@@ -4131,7 +4100,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = ICL_DISP_PW_3,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 			.hsw.irq_pipe_mask = BIT(PIPE_B),
 			.hsw.has_vga = true,
@@ -4141,90 +4109,81 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 	{
 		.name = "DDI A IO",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	},
 	{
 		.name = "DDI B IO",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	},
 	{
 		.name = "DDI C IO",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		}
 	},
 	{
 		.name = "DDI IO TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	},
 	{
 		.name = "DDI IO TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	},
 	{
 		.name = "DDI IO TC3",
 		.domains = TGL_DDI_IO_TC3_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC3,
 		},
 	},
 	{
 		.name = "DDI IO TC4",
 		.domains = TGL_DDI_IO_TC4_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC4,
 		},
 	},
 	{
 		.name = "DDI IO TC5",
 		.domains = TGL_DDI_IO_TC5_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC5,
 		},
 	},
 	{
 		.name = "DDI IO TC6",
 		.domains = TGL_DDI_IO_TC6_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC6,
 		},
 	},
@@ -4240,7 +4199,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	},
@@ -4250,7 +4208,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	},
@@ -4260,7 +4217,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 		},
 	},
@@ -4270,7 +4226,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4281,7 +4236,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4292,7 +4246,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC3,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4303,7 +4256,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC4,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4314,7 +4266,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC5,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4325,7 +4276,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC6,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4336,7 +4286,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4347,7 +4296,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4358,7 +4306,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4369,7 +4316,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT4,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4380,7 +4326,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT5,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4391,7 +4336,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT6,
 			.hsw.is_tc_tbt = true,
 		},
@@ -4402,7 +4346,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_C),
@@ -4414,7 +4357,6 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_PW_5,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_D),
@@ -4438,7 +4380,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -4455,7 +4396,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = ICL_DISP_PW_3,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 			.hsw.irq_pipe_mask = BIT(PIPE_B),
 			.hsw.has_vga = true,
@@ -4468,7 +4408,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_C),
@@ -4477,40 +4416,36 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 	{
 		.name = "DDI A IO",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	},
 	{
 		.name = "DDI B IO",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	},
 	{
 		.name = "DDI IO TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	},
 	{
 		.name = "DDI IO TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	},
@@ -4520,7 +4455,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	},
@@ -4530,7 +4464,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	},
@@ -4540,7 +4473,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 		},
 	},
@@ -4550,7 +4482,6 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 		},
 	},
@@ -4572,7 +4503,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -4589,7 +4519,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 			.hsw.has_fuses = true,
 		},
@@ -4600,7 +4529,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = ICL_DISP_PW_3,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 			.hsw.irq_pipe_mask = BIT(PIPE_B),
 			.hsw.has_vga = true,
@@ -4610,40 +4538,36 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 	{
 		.name = "DDI A IO",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	},
 	{
 		.name = "DDI B IO",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	},
 	{
 		.name = "DDI IO TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	},
 	{
 		.name = "DDI IO TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	},
@@ -4653,7 +4577,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	},
@@ -4663,7 +4586,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	},
@@ -4673,7 +4595,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4684,7 +4605,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 			.hsw.is_tc_tbt = false,
 		},
@@ -4695,7 +4615,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_C),
@@ -4707,7 +4626,6 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_PW_5,
 			.hsw.has_fuses = true,
 			.hsw.irq_pipe_mask = BIT(PIPE_D),
@@ -4731,7 +4649,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_1,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 			.hsw.has_fuses = true,
 		},
@@ -4748,7 +4665,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = SKL_DISP_PW_2,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 			.hsw.has_vga = true,
 			.hsw.has_fuses = true,
@@ -4760,7 +4676,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_A,
 			.hsw.irq_pipe_mask = BIT(PIPE_A),
 			.hsw.has_fuses = true,
@@ -4772,7 +4687,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_B,
 			.hsw.irq_pipe_mask = BIT(PIPE_B),
 			.hsw.has_fuses = true,
@@ -4784,7 +4698,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_C,
 			.hsw.irq_pipe_mask = BIT(PIPE_C),
 			.hsw.has_fuses = true,
@@ -4796,7 +4709,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &hsw_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_D,
 			.hsw.irq_pipe_mask = BIT(PIPE_D),
 			.hsw.has_fuses = true,
@@ -4805,90 +4717,81 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 	{
 		.name = "DDI A IO",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	},
 	{
 		.name = "DDI B IO",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	},
 	{
 		.name = "DDI C IO",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		}
 	},
 	{
 		.name = "DDI IO D_XELPD",
 		.domains = XELPD_DDI_IO_D_XELPD_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_DDI_D,
 		}
 	},
 	{
 		.name = "DDI IO E_XELPD",
 		.domains = XELPD_DDI_IO_E_XELPD_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_DDI_E,
 		}
 	},
 	{
 		.name = "DDI IO TC1",
 		.domains = XELPD_DDI_IO_TC1_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		}
 	},
 	{
 		.name = "DDI IO TC2",
 		.domains = XELPD_DDI_IO_TC2_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		}
 	},
 	{
 		.name = "DDI IO TC3",
 		.domains = XELPD_DDI_IO_TC3_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC3,
 		}
 	},
 	{
 		.name = "DDI IO TC4",
 		.domains = XELPD_DDI_IO_TC4_POWER_DOMAINS,
-		.ops = &hsw_power_well_ops,
+		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_ddi_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC4,
 		}
 	},
@@ -4898,7 +4801,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 			.hsw.fixed_enable_delay = 600,
 		},
@@ -4909,7 +4811,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 			.hsw.fixed_enable_delay = 600,
 		},
@@ -4920,7 +4821,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 			.hsw.fixed_enable_delay = 600,
 		},
@@ -4931,7 +4831,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_AUX_D,
 			.hsw.fixed_enable_delay = 600,
 		},
@@ -4942,7 +4841,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = XELPD_PW_CTL_IDX_AUX_E,
 		},
 	},
@@ -4952,7 +4850,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 			.hsw.fixed_enable_delay = 600,
 		},
@@ -4963,7 +4860,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 		},
 	},
@@ -4973,7 +4869,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC3,
 		},
 	},
@@ -4983,7 +4878,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC4,
 		},
 	},
@@ -4993,7 +4887,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
 			.hsw.is_tc_tbt = true,
 		},
@@ -5004,7 +4897,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
 			.hsw.is_tc_tbt = true,
 		},
@@ -5015,7 +4907,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
 			.hsw.is_tc_tbt = true,
 		},
@@ -5026,7 +4917,6 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
 		{
-			.hsw.regs = &icl_aux_power_well_regs,
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT4,
 			.hsw.is_tc_tbt = true,
 		},
Signature · 1 line
2.27.0
author
#5 lore raw

PATCH v2 5/26 drm/i915: Move power well get/put/enable/disable functions to a new file

In reply to Imre Deak

Move the power well get/put/enable/disable hooks to the new intel_display_power_well.c file. The motivation is to reduce the clutter in intel_display_power.c, keeping the functionality related to power domains in that file and moving the low-level power well functionality to intel_display_power_well.c.

No functional change.

---
 drivers/gpu/drm/i915/Makefile                 |   1 +
 .../drm/i915/display/intel_display_power.c    | 127 +-----------------
 .../i915/display/intel_display_power_well.c   |  41 ++++++
 .../i915/display/intel_display_power_well.h   | 115 ++++++++++++++++
 4 files changed, 158 insertions(+), 126 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_well.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_well.h
drivers/gpu/drm/i915/Makefile +1 -0
index a26e6736bebbc..71aeb94d0d734 100644
@@ -210,6 +210,7 @@ i915-y += \
 	display/intel_cursor.o \
 	display/intel_display.o \
 	display/intel_display_power.o \
+	display/intel_display_power_well.o \
 	display/intel_dmc.o \
 	display/intel_dpio_phy.o \
 	display/intel_dpll.o \
drivers/gpu/drm/i915/display/intel_display_power.c +1 -126

145 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c new file +41 -0

41 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.h new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
2.27.0
author
#6 lore raw

PATCH v2 6/26 drm/i915: Add function to call a power well's sync_hw() hook

In reply to Imre Deak

Add a function to call a power well's sync_hw() hook, instead of open-coding the same, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden.

The cached-enable state should be always up-to-date, so update it whenever sync_hw() is called.

No functional change.

---
 drivers/gpu/drm/i915/display/intel_display_power.c      | 7 ++-----
 drivers/gpu/drm/i915/display/intel_display_power_well.c | 8 ++++++++
 drivers/gpu/drm/i915/display/intel_display_power_well.h | 2 ++
 3 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +2 -5
index 3b8b745f1729f..056965248a3b2 100644
@@ -5015,11 +5015,8 @@ static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
 	struct i915_power_well *power_well;
 
 	mutex_lock(&power_domains->lock);
-	for_each_power_well(dev_priv, power_well) {
-		power_well->desc->ops->sync_hw(dev_priv, power_well);
-		power_well->hw_enabled =
-			power_well->desc->ops->is_enabled(dev_priv, power_well);
-	}
+	for_each_power_well(dev_priv, power_well)
+		intel_power_well_sync_hw(dev_priv, power_well);
 	mutex_unlock(&power_domains->lock);
 }
 
drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0
index e21190854fa0f..63b97bcc64bc3 100644
@@ -22,6 +22,14 @@ void intel_power_well_disable(struct drm_i915_private *i915,
 	power_well->desc->ops->disable(i915, power_well);
 }
 
+void intel_power_well_sync_hw(struct drm_i915_private *i915,
+			      struct i915_power_well *power_well)
+{
+	power_well->desc->ops->sync_hw(i915, power_well);
+	power_well->hw_enabled =
+		power_well->desc->ops->is_enabled(i915, power_well);
+}
+
 void intel_power_well_get(struct drm_i915_private *i915,
 			  struct i915_power_well *power_well)
 {
drivers/gpu/drm/i915/display/intel_display_power_well.h +2 -0
index bc77de3a8d4fc..ba5bbd36f7fc0 100644
@@ -107,6 +107,8 @@ void intel_power_well_enable(struct drm_i915_private *i915,
 			     struct i915_power_well *power_well);
 void intel_power_well_disable(struct drm_i915_private *i915,
 			      struct i915_power_well *power_well);
+void intel_power_well_sync_hw(struct drm_i915_private *i915,
+			      struct i915_power_well *power_well);
 void intel_power_well_get(struct drm_i915_private *i915,
 			  struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,
Signature · 1 line
2.27.0
author
#7 lore raw

PATCH v2 7/26 drm/i915: Add functions to get a power well's state/name/domains/mask/refcount

In reply to Imre Deak

Add functions to get a power well's actual- and cached-enabled state, name, domain mask and refcount, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden.

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 69 +++++++++----------
 .../i915/display/intel_display_power_well.c   | 31 +++++++++
 .../i915/display/intel_display_power_well.h   |  7 ++
 3 files changed, 72 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +34 -35
index 056965248a3b2..321b271c4b674 100644
@@ -191,10 +191,10 @@ bool __intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
 	is_enabled = true;
 
 	for_each_power_domain_well_reverse(dev_priv, power_well, BIT_ULL(domain)) {
-		if (power_well->desc->always_on)
+		if (intel_power_well_is_always_on(power_well))
 			continue;
 
-		if (!power_well->hw_enabled) {
+		if (!intel_power_well_is_enabled_cached(power_well)) {
 			is_enabled = false;
 			break;
 		}
@@ -330,7 +330,7 @@ static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
 	if (intel_de_wait_for_set(dev_priv, regs->driver,
 				  HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
 		drm_dbg_kms(&dev_priv->drm, "%s power well enable timeout\n",
-			    power_well->desc->name);
+			    intel_power_well_name(power_well));
 
 		drm_WARN_ON(&dev_priv->drm, !timeout_expected);
 
@@ -378,7 +378,7 @@ static void hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,
 
 	drm_dbg_kms(&dev_priv->drm,
 		    "%s forced on (bios:%d driver:%d kvmr:%d debug:%d)\n",
-		    power_well->desc->name,
+		    intel_power_well_name(power_well),
 		    !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs & 8));
 }
 
@@ -967,8 +967,7 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,
 	if (state == dev_priv->dmc.target_dc_state)
 		goto unlock;
 
-	dc_off_enabled = power_well->desc->ops->is_enabled(dev_priv,
-							   power_well);
+	dc_off_enabled = intel_power_well_is_enabled(dev_priv, power_well);
 	/*
 	 * If DC off power well is disabled, need to enable and disable the
 	 * DC off power well to effect target DC state.
@@ -1090,17 +1089,17 @@ static void bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
 	struct i915_power_well *power_well;
 
 	power_well = lookup_power_well(dev_priv, BXT_DISP_PW_DPIO_CMN_A);
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		bxt_ddi_phy_verify_state(dev_priv, power_well->desc->bxt.phy);
 
 	power_well = lookup_power_well(dev_priv, VLV_DISP_PW_DPIO_CMN_BC);
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		bxt_ddi_phy_verify_state(dev_priv, power_well->desc->bxt.phy);
 
 	if (IS_GEMINILAKE(dev_priv)) {
 		power_well = lookup_power_well(dev_priv,
 					       GLK_DISP_PW_DPIO_CMN_C);
-		if (power_well->count > 0)
+		if (intel_power_well_refcount(power_well) > 0)
 			bxt_ddi_phy_verify_state(dev_priv,
 						 power_well->desc->bxt.phy);
 	}
@@ -1226,7 +1225,7 @@ static bool i830_pipes_power_well_enabled(struct drm_i915_private *dev_priv,
 static void i830_pipes_power_well_sync_hw(struct drm_i915_private *dev_priv,
 					  struct i915_power_well *power_well)
 {
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		i830_pipes_power_well_enable(dev_priv, power_well);
 	else
 		i830_pipes_power_well_disable(dev_priv, power_well);
@@ -1499,7 +1498,7 @@ static void assert_chv_phy_status(struct drm_i915_private *dev_priv)
 				     PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 0) |
 				     PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 1));
 
-	if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
 		phy_status |= PHY_POWERGOOD(DPIO_PHY0);
 
 		/* this assumes override is only used to enable lanes */
@@ -1540,7 +1539,7 @@ static void assert_chv_phy_status(struct drm_i915_private *dev_priv)
 			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 1);
 	}
 
-	if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
 		phy_status |= PHY_POWERGOOD(DPIO_PHY1);
 
 		/* this assumes override is only used to enable lanes */
@@ -3334,12 +3333,10 @@ bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
 					 enum i915_power_well_id power_well_id)
 {
 	struct i915_power_well *power_well;
-	bool ret;
 
 	power_well = lookup_power_well(dev_priv, power_well_id);
-	ret = power_well->desc->ops->is_enabled(dev_priv, power_well);
 
-	return ret;
+	return intel_power_well_is_enabled(dev_priv, power_well);
 }
 
 static const struct i915_power_well_desc skl_power_wells[] = {
@@ -3909,7 +3906,7 @@ static void
 tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private *i915,
 				   struct i915_power_well *power_well)
 {
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		tgl_tc_cold_off_power_well_enable(i915, power_well);
 	else
 		tgl_tc_cold_off_power_well_disable(i915, power_well);
@@ -3923,7 +3920,7 @@ tgl_tc_cold_off_power_well_is_enabled(struct drm_i915_private *dev_priv,
 	 * Not the correctly implementation but there is no way to just read it
 	 * from PCODE, so returning count to avoid state mismatch errors
 	 */
-	return power_well->count;
+	return intel_power_well_refcount(power_well);
 }
 
 static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
@@ -5729,7 +5726,7 @@ static void chv_phy_control_init(struct drm_i915_private *dev_priv)
 	 * override and set the lane powerdown bits accding to the
 	 * current lane status.
 	 */
-	if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
 		u32 status = intel_de_read(dev_priv, DPLL(PIPE_A));
 		unsigned int mask;
 
@@ -5760,7 +5757,7 @@ static void chv_phy_control_init(struct drm_i915_private *dev_priv)
 		dev_priv->chv_phy_assert[DPIO_PHY0] = true;
 	}
 
-	if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
 		u32 status = intel_de_read(dev_priv, DPIO_PHY_STATUS);
 		unsigned int mask;
 
@@ -5796,8 +5793,8 @@ static void vlv_cmnlane_wa(struct drm_i915_private *dev_priv)
 		lookup_power_well(dev_priv, VLV_DISP_PW_DISP2D);
 
 	/* If the display might be already active skip this */
-	if (cmn->desc->ops->is_enabled(dev_priv, cmn) &&
-	    disp2d->desc->ops->is_enabled(dev_priv, disp2d) &&
+	if (intel_power_well_is_enabled(dev_priv, cmn) &&
+	    intel_power_well_is_enabled(dev_priv, disp2d) &&
 	    intel_de_read(dev_priv, DPIO_CTL) & DPIO_CMNRST)
 		return;
 
@@ -5964,12 +5961,12 @@ void intel_power_domains_sanitize_state(struct drm_i915_private *i915)
 
 	for_each_power_well_reverse(i915, power_well) {
 		if (power_well->desc->always_on || power_well->count ||
-		    !power_well->desc->ops->is_enabled(i915, power_well))
+		    !intel_power_well_is_enabled(i915, power_well))
 			continue;
 
 		drm_dbg_kms(&i915->drm,
 			    "BIOS left unused %s power well enabled, disabling it\n",
-			    power_well->desc->name);
+			    intel_power_well_name(power_well));
 		intel_power_well_disable(i915, power_well);
 	}
 
@@ -6108,9 +6105,9 @@ static void intel_power_domains_dump_info(struct drm_i915_private *i915)
 		enum intel_display_power_domain domain;
 
 		drm_dbg(&i915->drm, "%-25s %d\n",
-			power_well->desc->name, power_well->count);
+			intel_power_well_name(power_well), intel_power_well_refcount(power_well));
 
-		for_each_power_domain(domain, power_well->desc->domains)
+		for_each_power_domain(domain, intel_power_well_domains(power_well))
 			drm_dbg(&i915->drm, "  %-23s %d\n",
 				intel_display_power_domain_str(domain),
 				power_domains->domain_use_count[domain]);
@@ -6143,23 +6140,25 @@ static void intel_power_domains_verify_state(struct drm_i915_private *i915)
 		int domains_count;
 		bool enabled;
 
-		enabled = power_well->desc->ops->is_enabled(i915, power_well);
-		if ((power_well->count || power_well->desc->always_on) !=
+		enabled = intel_power_well_is_enabled(i915, power_well);
+		if ((intel_power_well_refcount(power_well) ||
+		     intel_power_well_is_always_on(power_well)) !=
 		    enabled)
 			drm_err(&i915->drm,
 				"power well %s state mismatch (refcount %d/enabled %d)",
-				power_well->desc->name,
-				power_well->count, enabled);
+				intel_power_well_name(power_well),
+				intel_power_well_refcount(power_well), enabled);
 
 		domains_count = 0;
-		for_each_power_domain(domain, power_well->desc->domains)
+		for_each_power_domain(domain, intel_power_well_domains(power_well))
 			domains_count += power_domains->domain_use_count[domain];
 
-		if (power_well->count != domains_count) {
+		if (intel_power_well_refcount(power_well) != domains_count) {
 			drm_err(&i915->drm,
 				"power well %s refcount/domain refcount mismatch "
 				"(refcount %d/domains refcount %d)\n",
-				power_well->desc->name, power_well->count,
+				intel_power_well_name(power_well),
+				intel_power_well_refcount(power_well),
 				domains_count);
 			dump_domain_info = true;
 		}
@@ -6264,10 +6263,10 @@ void intel_display_power_debug(struct drm_i915_private *i915, struct seq_file *m
 		enum intel_display_power_domain power_domain;
 
 		power_well = &power_domains->power_wells[i];
-		seq_printf(m, "%-25s %d\n", power_well->desc->name,
-			   power_well->count);
+		seq_printf(m, "%-25s %d\n", intel_power_well_name(power_well),
+			   intel_power_well_refcount(power_well));
 
-		for_each_power_domain(power_domain, power_well->desc->domains)
+		for_each_power_domain(power_domain, intel_power_well_domains(power_well))
 			seq_printf(m, "  %-23s %d\n",
 				   intel_display_power_domain_str(power_domain),
 				   power_domains->domain_use_count[power_domain]);
drivers/gpu/drm/i915/display/intel_display_power_well.c +31 -0
index 63b97bcc64bc3..415ad193a8e83 100644
@@ -47,3 +47,34 @@ void intel_power_well_put(struct drm_i915_private *i915,
 	if (!--power_well->count)
 		intel_power_well_disable(i915, power_well);
 }
+
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+				 struct i915_power_well *power_well)
+{
+	return power_well->desc->ops->is_enabled(i915, power_well);
+}
+
+bool intel_power_well_is_enabled_cached(struct i915_power_well *power_well)
+{
+	return power_well->hw_enabled;
+}
+
+bool intel_power_well_is_always_on(struct i915_power_well *power_well)
+{
+	return power_well->desc->always_on;
+}
+
+const char *intel_power_well_name(struct i915_power_well *power_well)
+{
+	return power_well->desc->name;
+}
+
+u64 intel_power_well_domains(struct i915_power_well *power_well)
+{
+	return power_well->desc->domains;
+}
+
+int intel_power_well_refcount(struct i915_power_well *power_well)
+{
+	return power_well->count;
+}
drivers/gpu/drm/i915/display/intel_display_power_well.h +7 -0
index ba5bbd36f7fc0..43affbdbc48c1 100644
@@ -113,5 +113,12 @@ void intel_power_well_get(struct drm_i915_private *i915,
 			  struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,
 			  struct i915_power_well *power_well);
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+				 struct i915_power_well *power_well);
+bool intel_power_well_is_enabled_cached(struct i915_power_well *power_well);
+bool intel_power_well_is_always_on(struct i915_power_well *power_well);
+const char *intel_power_well_name(struct i915_power_well *power_well);
+u64 intel_power_well_domains(struct i915_power_well *power_well);
+int intel_power_well_refcount(struct i915_power_well *power_well);
 
 #endif
Signature · 1 line
2.27.0
#8 lore raw

Re: [Intel-gfx] [PATCH v2 07/26] drm/i915: Add functions to get a power well's state/name/domains/mask/refcount

Quoted 4 lines · Imre Deak

Add functions to get a power well's actual- and cached-enabled state, name, domain mask and refcount, as a step towards making the low- level
power well internals (i915_power_well_ops/desc structs) hidden.

It's not really in scope of this patch, but still: Why this cached- enabled state is needed on the first hand? Are we expecting seeing hw_state as enabled while count == 0 or vice versa?

Quoted 366 lines

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 69 +++++++++------
----
 .../i915/display/intel_display_power_well.c   | 31 +++++++++
 .../i915/display/intel_display_power_well.h   |  7 ++
 3 files changed, 72 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
index 056965248a3b2..321b271c4b674 100644
@@ -191,10 +191,10 @@ bool __intel_display_power_is_enabled(struct
 drm_i915_private *dev_priv,
 	is_enabled = true;
 
 	for_each_power_domain_well_reverse(dev_priv, power_well,
 BIT_ULL(domain)) {
-		if (power_well->desc->always_on)
+		if (intel_power_well_is_always_on(power_well))
 			continue;
 
-		if (!power_well->hw_enabled) {
+		if (!intel_power_well_is_enabled_cached(power_well)) {
 			is_enabled = false;
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
 			break;
 		}
@@ -330,7 +330,7 @@ static void hsw_wait_for_power_well_enable(struct
 drm_i915_private *dev_priv,
 	if (intel_de_wait_for_set(dev_priv, regs->driver,
 				  HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
 		drm_dbg_kms(&dev_priv->drm, "%s power well enable
 timeout\n",
-			    power_well->desc->name);
+			    intel_power_well_name(power_well));
 
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
 		drm_WARN_ON(&dev_priv->drm, !timeout_expected);
@@ -378,7 +378,7 @@ static void
 hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,
 
 	drm_dbg_kms(&dev_priv->drm,
 		    "%s forced on (bios:%d driver:%d kvmr:%d
 debug:%d)\n",
-		    power_well->desc->name,
+		    intel_power_well_name(power_well),
 		    !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs &

8));
}

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -967,8 +967,7 @@ void

intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +1 -2
 	if (state == dev_priv->dmc.target_dc_state)
 		goto unlock;
 
-	dc_off_enabled = power_well->desc->ops->is_enabled(dev_priv,
-							   power_well);
+	dc_off_enabled = intel_power_well_is_enabled(dev_priv,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
 	/*
 	 * If DC off power well is disabled, need to enable and disable

the

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
 	 * DC off power well to effect target DC state.
@@ -1090,17 +1089,17 @@ static void
 bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
 	struct i915_power_well *power_well;
 
 	power_well = lookup_power_well(dev_priv,
 BXT_DISP_PW_DPIO_CMN_A);
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
 >bxt.phy);
 
 	power_well = lookup_power_well(dev_priv,
 VLV_DISP_PW_DPIO_CMN_BC);
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
 >bxt.phy);
 
 	if (IS_GEMINILAKE(dev_priv)) {
 		power_well = lookup_power_well(dev_priv,
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
 					       GLK_DISP_PW_DPIO_CMN_C);
-		if (power_well->count > 0)
+		if (intel_power_well_refcount(power_well) > 0)
 			bxt_ddi_phy_verify_state(dev_priv,
 						 power_well->desc-
Quoted 1 line

bxt.phy);

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
 	}
@@ -1226,7 +1225,7 @@ static bool
 i830_pipes_power_well_enabled(struct drm_i915_private *dev_priv,
 static void i830_pipes_power_well_sync_hw(struct drm_i915_private
 *dev_priv,
 					  struct i915_power_well
 *power_well)
 {
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
 		i830_pipes_power_well_enable(dev_priv, power_well);
 	else
 		i830_pipes_power_well_disable(dev_priv, power_well);
@@ -1499,7 +1498,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
 				     PHY_STATUS_SPLINE_LDO(DPIO_PHY1,

DPIO_CH0, 0) |
PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 1));

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-	if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
 		phy_status |= PHY_POWERGOOD(DPIO_PHY0);
 
 		/* this assumes override is only used to enable lanes

*/

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -1540,7 +1539,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
 			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
 DPIO_CH1, 1);
 	}
 
-	if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
 		phy_status |= PHY_POWERGOOD(DPIO_PHY1);

/* this assumes override is only used to enable lanes
*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -3334,12 +3333,10 @@ bool

intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
enum i915_power_well_id
power_well_id)
{

drivers/gpu/drm/i915/display/intel_display_power.c +2 -4
 	struct i915_power_well *power_well;
-	bool ret;
 
 	power_well = lookup_power_well(dev_priv, power_well_id);
-	ret = power_well->desc->ops->is_enabled(dev_priv, power_well);
 
-	return ret;
+	return intel_power_well_is_enabled(dev_priv, power_well);
 }
 
 static const struct i915_power_well_desc skl_power_wells[] = {
@@ -3909,7 +3906,7 @@ static void
 tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private *i915,
 				   struct i915_power_well *power_well)
 {
-	if (power_well->count > 0)
+	if (intel_power_well_refcount(power_well) > 0)
 		tgl_tc_cold_off_power_well_enable(i915, power_well);
 	else
 		tgl_tc_cold_off_power_well_disable(i915, power_well);
@@ -3923,7 +3920,7 @@ tgl_tc_cold_off_power_well_is_enabled(struct
 drm_i915_private *dev_priv,
 	 * Not the correctly implementation but there is no way to just

read it
* from PCODE, so returning count to avoid state mismatch
errors

drivers/gpu/drm/i915/display/intel_display_power.c +7 -7
 	 */
-	return power_well->count;
+	return intel_power_well_refcount(power_well);
 }
 
 static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
@@ -5729,7 +5726,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
 	 * override and set the lane powerdown bits accding to the
 	 * current lane status.
 	 */
-	if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
 		u32 status = intel_de_read(dev_priv, DPLL(PIPE_A));
 		unsigned int mask;
@@ -5760,7 +5757,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
 		dev_priv->chv_phy_assert[DPIO_PHY0] = true;
 	}
 
-	if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+	if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
 		u32 status = intel_de_read(dev_priv, DPIO_PHY_STATUS);
 		unsigned int mask;
@@ -5796,8 +5793,8 @@ static void vlv_cmnlane_wa(struct
 drm_i915_private *dev_priv)
 		lookup_power_well(dev_priv, VLV_DISP_PW_DISP2D);
 
 	/* If the display might be already active skip this */
-	if (cmn->desc->ops->is_enabled(dev_priv, cmn) &&
-	    disp2d->desc->ops->is_enabled(dev_priv, disp2d) &&
+	if (intel_power_well_is_enabled(dev_priv, cmn) &&
+	    intel_power_well_is_enabled(dev_priv, disp2d) &&
 	    intel_de_read(dev_priv, DPIO_CTL) & DPIO_CMNRST)
 		return;
@@ -5964,12 +5961,12 @@ void
 intel_power_domains_sanitize_state(struct drm_i915_private *i915)
 
 	for_each_power_well_reverse(i915, power_well) {
 		if (power_well->desc->always_on || power_well->count ||
-		    !power_well->desc->ops->is_enabled(i915,
 power_well))
+		    !intel_power_well_is_enabled(i915, power_well))
 			continue;
 
 		drm_dbg_kms(&i915->drm,
 			    "BIOS left unused %s power well enabled,
 disabling it\n",
-			    power_well->desc->name);
+			    intel_power_well_name(power_well));
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
 		intel_power_well_disable(i915, power_well);
 	}
@@ -6108,9 +6105,9 @@ static void
 intel_power_domains_dump_info(struct drm_i915_private *i915)
 		enum intel_display_power_domain domain;
 
 		drm_dbg(&i915->drm, "%-25s %d\n",
-			power_well->desc->name, power_well->count);
+			intel_power_well_name(power_well),
 intel_power_well_refcount(power_well));
 
-		for_each_power_domain(domain, power_well->desc-
 >domains)
+		for_each_power_domain(domain,

intel_power_well_domains(power_well))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
 			drm_dbg(&i915->drm, "  %-23s %d\n",
 				intel_display_power_domain_str(domain),
 				power_domains-
Quoted 1 line

domain_use_count[domain]);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
@@ -6143,23 +6140,25 @@ static void
 intel_power_domains_verify_state(struct drm_i915_private *i915)
 		int domains_count;
 		bool enabled;
 
-		enabled = power_well->desc->ops->is_enabled(i915,
 power_well);
-		if ((power_well->count || power_well->desc->always_on)

!=

drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
+		enabled = intel_power_well_is_enabled(i915,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+		if ((intel_power_well_refcount(power_well) ||
+		     intel_power_well_is_always_on(power_well)) !=
 		    enabled)
 			drm_err(&i915->drm,
 				"power well %s state mismatch (refcount

%d/enabled %d)",

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
-				power_well->desc->name,
-				power_well->count, enabled);
+				intel_power_well_name(power_well),
+				intel_power_well_refcount(power_well),

enabled);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
 		domains_count = 0;
-		for_each_power_domain(domain, power_well->desc-
Quoted 1 line

domains)

drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
+		for_each_power_domain(domain,

intel_power_well_domains(power_well))
domains_count += power_domains-

Quoted 1 line

domain_use_count[domain];

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-		if (power_well->count != domains_count) {
+		if (intel_power_well_refcount(power_well) !=

domains_count) {

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
 			drm_err(&i915->drm,
 				"power well %s refcount/domain refcount

mismatch "

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
 				"(refcount %d/domains refcount %d)\n",
-				power_well->desc->name, power_well-
Quoted 1 line

count,

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+				intel_power_well_name(power_well),
+				intel_power_well_refcount(power_well),
 				domains_count);
 			dump_domain_info = true;
 		}
@@ -6264,10 +6263,10 @@ void intel_display_power_debug(struct

drm_i915_private *i915, struct seq_file *m

drivers/gpu/drm/i915/display/intel_display_power.c +1 -2
 		enum intel_display_power_domain power_domain;
 
 		power_well = &power_domains->power_wells[i];
-		seq_printf(m, "%-25s %d\n", power_well->desc->name,
-			   power_well->count);
+		seq_printf(m, "%-25s %d\n",

intel_power_well_name(power_well),

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
+			   intel_power_well_refcount(power_well));
 
-		for_each_power_domain(power_domain, power_well->desc-
Quoted 1 line

domains)

drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
+		for_each_power_domain(power_domain,

intel_power_well_domains(power_well))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
 			seq_printf(m, "  %-23s %d\n",
 				   intel_display_power_domain_str(power

_domain),
power_domains-

Quoted 1 line

domain_use_count[power_domain]);

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0
index 63b97bcc64bc3..415ad193a8e83 100644
@@ -47,3 +47,34 @@ void intel_power_well_put(struct drm_i915_private
 *i915,
 	if (!--power_well->count)
 		intel_power_well_disable(i915, power_well);
 }
+
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+				 struct i915_power_well *power_well)
+{
+	return power_well->desc->ops->is_enabled(i915, power_well);
+}
+
+bool intel_power_well_is_enabled_cached(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+	return power_well->hw_enabled;
+}
+
+bool intel_power_well_is_always_on(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+	return power_well->desc->always_on;
+}
+
+const char *intel_power_well_name(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +13 -0
+{
+	return power_well->desc->name;
+}
+
+u64 intel_power_well_domains(struct i915_power_well *power_well)
+{
+	return power_well->desc->domains;
+}
+
+int intel_power_well_refcount(struct i915_power_well *power_well)
+{
+	return power_well->count;
+}
drivers/gpu/drm/i915/display/intel_display_power_well.h +4 -0
index ba5bbd36f7fc0..43affbdbc48c1 100644
@@ -113,5 +113,12 @@ void intel_power_well_get(struct
 drm_i915_private *i915,
 			  struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,
 			  struct i915_power_well *power_well);
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+				 struct i915_power_well *power_well);
+bool intel_power_well_is_enabled_cached(struct i915_power_well
 *power_well);
+bool intel_power_well_is_always_on(struct i915_power_well

*power_well);
+const char *intel_power_well_name(struct i915_power_well *power_well);

drivers/gpu/drm/i915/display/intel_display_power_well.h void intel_power_well_get(struct drm_i915_private *i915, · line 124

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display_power_well.h +2 -0
+u64 intel_power_well_domains(struct i915_power_well *power_well);
+int intel_power_well_refcount(struct i915_power_well *power_well);
 
 #endif

BR,

Jouni Högander

author
#9 lore raw

Re: [Intel-gfx] [PATCH v2 07/26] drm/i915: Add functions to get a power well's state/name/domains/mask/refcount

Quoted 9 lines · Jouni
Quoted 4 lines · Imre Deak

Add functions to get a power well's actual- and cached-enabled state, name, domain mask and refcount, as a step towards making the low- level
power well internals (i915_power_well_ops/desc structs) hidden.

It's not really in scope of this patch, but still: Why this cached- enabled state is needed on the first hand? Are we expecting seeing hw_state as enabled while count == 0 or vice versa?

It was added for VLV/CHV where PUNIT accesses to determine the actual HW state had too much overhead (20ms per access). After the initial sync_hw() call for the given power well and the read-out of its enabled HW state during driver loading and system resume, the cached value provides the state regardless of the refcount of the power well. During the sanitization of pipes/encoders etc and during the verification of HW vs. SW state after modesets, the driver gets (multiple) if_enabled() reference where the cached value should speed things up.

For debugging purposes (intel_power_domains_verify_state()) it still makes sense to check the actual HW state, hence the presence of functions to get both the cached and non-cached state.

Quoted 374 lines
Quoted 365 lines

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 69 +++++++++------
----
 .../i915/display/intel_display_power_well.c   | 31 +++++++++
 .../i915/display/intel_display_power_well.h   |  7 ++
 3 files changed, 72 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
index 056965248a3b2..321b271c4b674 100644
@@ -191,10 +191,10 @@ bool __intel_display_power_is_enabled(struct
 drm_i915_private *dev_priv,
      is_enabled = true;
 
      for_each_power_domain_well_reverse(dev_priv, power_well,
 BIT_ULL(domain)) {
-             if (power_well->desc->always_on)
+             if (intel_power_well_is_always_on(power_well))
                      continue;
 
-             if (!power_well->hw_enabled) {
+             if (!intel_power_well_is_enabled_cached(power_well)) {
                      is_enabled = false;
                      break;
              }
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -330,7 +330,7 @@ static void hsw_wait_for_power_well_enable(struct
 drm_i915_private *dev_priv,
      if (intel_de_wait_for_set(dev_priv, regs->driver,
                                HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
              drm_dbg_kms(&dev_priv->drm, "%s power well enable
 timeout\n",
-                         power_well->desc->name);
+                         intel_power_well_name(power_well));
 
              drm_WARN_ON(&dev_priv->drm, !timeout_expected);
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -378,7 +378,7 @@ static void
 hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,
 
      drm_dbg_kms(&dev_priv->drm,
                  "%s forced on (bios:%d driver:%d kvmr:%d
 debug:%d)\n",
-                 power_well->desc->name,
+                 intel_power_well_name(power_well),
                  !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs &

8));
}

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -967,8 +967,7 @@ void

intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,

      if (state == dev_priv->dmc.target_dc_state)
              goto unlock;
drivers/gpu/drm/i915/display/intel_display_power.c +1 -2
-     dc_off_enabled = power_well->desc->ops->is_enabled(dev_priv,
-                                                        power_well);
+     dc_off_enabled = intel_power_well_is_enabled(dev_priv,

power_well);
/*
* If DC off power well is disabled, need to enable and disable
the
* DC off power well to effect target DC state.

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
@@ -1090,17 +1089,17 @@ static void
 bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
      struct i915_power_well *power_well;
 
      power_well = lookup_power_well(dev_priv,
 BXT_DISP_PW_DPIO_CMN_A);
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
 >bxt.phy);
 
      power_well = lookup_power_well(dev_priv,
 VLV_DISP_PW_DPIO_CMN_BC);
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
 >bxt.phy);
 
      if (IS_GEMINILAKE(dev_priv)) {
              power_well = lookup_power_well(dev_priv,
                                             GLK_DISP_PW_DPIO_CMN_C);
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-             if (power_well->count > 0)
+             if (intel_power_well_refcount(power_well) > 0)
                      bxt_ddi_phy_verify_state(dev_priv,
                                               power_well->desc-
Quoted 1 line

bxt.phy);

      }
drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -1226,7 +1225,7 @@ static bool
 i830_pipes_power_well_enabled(struct drm_i915_private *dev_priv,
 static void i830_pipes_power_well_sync_hw(struct drm_i915_private
 *dev_priv,
                                        struct i915_power_well
 *power_well)
 {
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              i830_pipes_power_well_enable(dev_priv, power_well);
      else
              i830_pipes_power_well_disable(dev_priv, power_well);
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -1499,7 +1498,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
                                   PHY_STATUS_SPLINE_LDO(DPIO_PHY1,

DPIO_CH0, 0) |
PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 1));

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-     if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
              phy_status |= PHY_POWERGOOD(DPIO_PHY0);
 
              /* this assumes override is only used to enable lanes

*/

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -1540,7 +1539,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
                      phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
 DPIO_CH1, 1);
      }
 
-     if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
              phy_status |= PHY_POWERGOOD(DPIO_PHY1);
              /* this assumes override is only used to enable lanes

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -3334,12 +3333,10 @@ bool

intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,

                                       enum i915_power_well_id
power_well_id)
 {
      struct i915_power_well *power_well;
drivers/gpu/drm/i915/display/intel_display_power.c +2 -4
-     bool ret;
 
      power_well = lookup_power_well(dev_priv, power_well_id);
-     ret = power_well->desc->ops->is_enabled(dev_priv, power_well);
 
-     return ret;
+     return intel_power_well_is_enabled(dev_priv, power_well);
 }
 
 static const struct i915_power_well_desc skl_power_wells[] = {
@@ -3909,7 +3906,7 @@ static void
 tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private *i915,
                                 struct i915_power_well *power_well)
 {
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              tgl_tc_cold_off_power_well_enable(i915, power_well);
      else
              tgl_tc_cold_off_power_well_disable(i915, power_well);
@@ -3923,7 +3920,7 @@ tgl_tc_cold_off_power_well_is_enabled(struct
 drm_i915_private *dev_priv,
       * Not the correctly implementation but there is no way to just

read it
* from PCODE, so returning count to avoid state mismatch
errors

       */
drivers/gpu/drm/i915/display/intel_display_power.c +7 -7
-     return power_well->count;
+     return intel_power_well_refcount(power_well);
 }
 
 static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
@@ -5729,7 +5726,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
       * override and set the lane powerdown bits accding to the
       * current lane status.
       */
-     if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
              u32 status = intel_de_read(dev_priv, DPLL(PIPE_A));
              unsigned int mask;
@@ -5760,7 +5757,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
              dev_priv->chv_phy_assert[DPIO_PHY0] = true;
      }
 
-     if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
              u32 status = intel_de_read(dev_priv, DPIO_PHY_STATUS);
              unsigned int mask;
@@ -5796,8 +5793,8 @@ static void vlv_cmnlane_wa(struct
 drm_i915_private *dev_priv)
              lookup_power_well(dev_priv, VLV_DISP_PW_DISP2D);
 
      /* If the display might be already active skip this */
-     if (cmn->desc->ops->is_enabled(dev_priv, cmn) &&
-         disp2d->desc->ops->is_enabled(dev_priv, disp2d) &&
+     if (intel_power_well_is_enabled(dev_priv, cmn) &&
+         intel_power_well_is_enabled(dev_priv, disp2d) &&
          intel_de_read(dev_priv, DPIO_CTL) & DPIO_CMNRST)
              return;
@@ -5964,12 +5961,12 @@ void
 intel_power_domains_sanitize_state(struct drm_i915_private *i915)
 
      for_each_power_well_reverse(i915, power_well) {
              if (power_well->desc->always_on || power_well->count ||
-                 !power_well->desc->ops->is_enabled(i915,
 power_well))
+                 !intel_power_well_is_enabled(i915, power_well))
                      continue;
 
              drm_dbg_kms(&i915->drm,
                          "BIOS left unused %s power well enabled,
 disabling it\n",
-                         power_well->desc->name);
+                         intel_power_well_name(power_well));
              intel_power_well_disable(i915, power_well);
      }
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
@@ -6108,9 +6105,9 @@ static void
 intel_power_domains_dump_info(struct drm_i915_private *i915)
              enum intel_display_power_domain domain;
 
              drm_dbg(&i915->drm, "%-25s %d\n",
-                     power_well->desc->name, power_well->count);
+                     intel_power_well_name(power_well),
 intel_power_well_refcount(power_well));
 
-             for_each_power_domain(domain, power_well->desc-
 >domains)
+             for_each_power_domain(domain,

intel_power_well_domains(power_well))

                      drm_dbg(&i915->drm, "  %-23s %d\n",
                              intel_display_power_domain_str(domain),
                              power_domains-
Quoted 1 line

domain_use_count[domain]);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
@@ -6143,23 +6140,25 @@ static void
 intel_power_domains_verify_state(struct drm_i915_private *i915)
              int domains_count;
              bool enabled;
 
-             enabled = power_well->desc->ops->is_enabled(i915,
 power_well);
-             if ((power_well->count || power_well->desc->always_on)

!=
+ enabled = intel_power_well_is_enabled(i915,
power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+             if ((intel_power_well_refcount(power_well) ||
+                  intel_power_well_is_always_on(power_well)) !=
                  enabled)
                      drm_err(&i915->drm,
                              "power well %s state mismatch (refcount

%d/enabled %d)",

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
-                             power_well->desc->name,
-                             power_well->count, enabled);
+                             intel_power_well_name(power_well),
+                             intel_power_well_refcount(power_well),

enabled);

              domains_count = 0;

- for_each_power_domain(domain, power_well->desc-

Quoted 1 line

domains)

+ for_each_power_domain(domain,
intel_power_well_domains(power_well))

                      domains_count += power_domains-
Quoted 1 line

domain_use_count[domain];

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-             if (power_well->count != domains_count) {
+             if (intel_power_well_refcount(power_well) !=

domains_count) {
drm_err(&i915->drm,
"power well %s refcount/domain refcount
mismatch "
"(refcount %d/domains refcount %d)\n",
- power_well->desc->name, power_well-

Quoted 1 line

count,

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+                             intel_power_well_name(power_well),
+                             intel_power_well_refcount(power_well),
                              domains_count);
                      dump_domain_info = true;
              }
@@ -6264,10 +6263,10 @@ void intel_display_power_debug(struct

drm_i915_private *i915, struct seq_file *m

              enum intel_display_power_domain power_domain;

              power_well = &power_domains->power_wells[i];
drivers/gpu/drm/i915/display/intel_display_power.c +1 -2
-             seq_printf(m, "%-25s %d\n", power_well->desc->name,
-                        power_well->count);
+             seq_printf(m, "%-25s %d\n",

intel_power_well_name(power_well),

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
+                        intel_power_well_refcount(power_well));
 
-             for_each_power_domain(power_domain, power_well->desc-
Quoted 1 line

domains)

+ for_each_power_domain(power_domain,
intel_power_well_domains(power_well))

                      seq_printf(m, "  %-23s %d\n",
                                 intel_display_power_domain_str(power

_domain),
power_domains-

Quoted 1 line

domain_use_count[power_domain]);

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0
index 63b97bcc64bc3..415ad193a8e83 100644
@@ -47,3 +47,34 @@ void intel_power_well_put(struct drm_i915_private
 *i915,
      if (!--power_well->count)
              intel_power_well_disable(i915, power_well);
 }
+
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+                              struct i915_power_well *power_well)
+{
+     return power_well->desc->ops->is_enabled(i915, power_well);
+}
+
+bool intel_power_well_is_enabled_cached(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     return power_well->hw_enabled;
+}
+
+bool intel_power_well_is_always_on(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     return power_well->desc->always_on;
+}
+
+const char *intel_power_well_name(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +13 -0
+{
+     return power_well->desc->name;
+}
+
+u64 intel_power_well_domains(struct i915_power_well *power_well)
+{
+     return power_well->desc->domains;
+}
+
+int intel_power_well_refcount(struct i915_power_well *power_well)
+{
+     return power_well->count;
+}
drivers/gpu/drm/i915/display/intel_display_power_well.h +4 -0
index ba5bbd36f7fc0..43affbdbc48c1 100644
@@ -113,5 +113,12 @@ void intel_power_well_get(struct
 drm_i915_private *i915,
                        struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,
                        struct i915_power_well *power_well);
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+                              struct i915_power_well *power_well);
+bool intel_power_well_is_enabled_cached(struct i915_power_well
 *power_well);
+bool intel_power_well_is_always_on(struct i915_power_well

*power_well);
+const char *intel_power_well_name(struct i915_power_well *power_well);

drivers/gpu/drm/i915/display/intel_display_power_well.h void intel_power_well_get(struct drm_i915_private *i915, · line 124

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display_power_well.h +2 -0
+u64 intel_power_well_domains(struct i915_power_well *power_well);
+int intel_power_well_refcount(struct i915_power_well *power_well);
 
 #endif

BR,

Jouni Högander

#10 lore raw

Re: [Intel-gfx] [PATCH v2 07/26] drm/i915: Add functions to get a power well's state/name/domains/mask/refcount

Quoted 25 lines · Imre Deak
Quoted 10 lines · Jouni
Quoted 5 lines · Imre Deak

Add functions to get a power well's actual- and cached-enabled state,
name, domain mask and refcount, as a step towards making the low- level
power well internals (i915_power_well_ops/desc structs) hidden.

It's not really in scope of this patch, but still: Why this cached- enabled state is needed on the first hand? Are we expecting seeing hw_state as enabled while count == 0 or vice versa?

It was added for VLV/CHV where PUNIT accesses to determine the actual HW
state had too much overhead (20ms per access). After the initial sync_hw() call for the given power well and the read-out of its enabled
HW state during driver loading and system resume, the cached value provides the state regardless of the refcount of the power well. During
the sanitization of pipes/encoders etc and during the verification of HW
vs. SW state after modesets, the driver gets (multiple) if_enabled() reference where the cached value should speed things up.

Quoted 3 lines

For debugging purposes (intel_power_domains_verify_state()) it still makes sense to check the actual HW state, hence the presence of functions to get both the cached and non-cached state.

Thank you for the explanation.

Quoted 422 lines
Quoted 422 lines
Quoted 416 lines

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 69 +++++++++--
----
----
 .../i915/display/intel_display_power_well.c   | 31 +++++++++
 .../i915/display/intel_display_power_well.h   |  7 ++
 3 files changed, 72 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
index 056965248a3b2..321b271c4b674 100644
@@ -191,10 +191,10 @@ bool

__intel_display_power_is_enabled(struct
drm_i915_private *dev_priv,

      is_enabled = true;

      for_each_power_domain_well_reverse(dev_priv, power_well,

BIT_ULL(domain)) {

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
-             if (power_well->desc->always_on)
+             if (intel_power_well_is_always_on(power_well))
                      continue;
 
-             if (!power_well->hw_enabled) {
+             if
(!intel_power_well_is_enabled_cached(power_well)) {
                      is_enabled = false;
                      break;
              }
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -330,7 +330,7 @@ static void

hsw_wait_for_power_well_enable(struct
drm_i915_private *dev_priv,

      if (intel_de_wait_for_set(dev_priv, regs->driver,
                                HSW_PWR_WELL_CTL_STATE(pw_idx),
1)) {
              drm_dbg_kms(&dev_priv->drm, "%s power well enable

timeout\n",

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-                         power_well->desc->name);
+                         intel_power_well_name(power_well));
 
              drm_WARN_ON(&dev_priv->drm, !timeout_expected);
@@ -378,7 +378,7 @@ static void

hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,

drm_dbg_kms(&dev_priv->drm,
"%s forced on (bios:%d driver:%d kvmr:%d
debug:%d)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-                 power_well->desc->name,
+                 intel_power_well_name(power_well),
                  !!(reqs & 1), !!(reqs & 2), !!(reqs & 4),

!!(reqs &
8));
}

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -967,8 +967,7 @@ void

intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,

      if (state == dev_priv->dmc.target_dc_state)
              goto unlock;

- dc_off_enabled = power_well->desc->ops-

Quoted 1 line

is_enabled(dev_priv,

- power_we
ll);
+ dc_off_enabled = intel_power_well_is_enabled(dev_priv,
power_well);
/*
* If DC off power well is disabled, need to enable and
disable
the
* DC off power well to effect target DC state.

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -1090,17 +1089,17 @@ static void
 bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
      struct i915_power_well *power_well;
 
      power_well = lookup_power_well(dev_priv,
 BXT_DISP_PW_DPIO_CMN_A);
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              bxt_ddi_phy_verify_state(dev_priv, power_well-
Quoted 2 lines

desc-
bxt.phy);

power_well = lookup_power_well(dev_priv,
VLV_DISP_PW_DPIO_CMN_BC);

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              bxt_ddi_phy_verify_state(dev_priv, power_well-
Quoted 2 lines

desc-
bxt.phy);

if (IS_GEMINILAKE(dev_priv)) {
power_well = lookup_power_well(dev_priv,
GLK_DISP_PW_DPIO_CMN
_C);

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-             if (power_well->count > 0)
+             if (intel_power_well_refcount(power_well) > 0)
                      bxt_ddi_phy_verify_state(dev_priv,
                                               power_well->desc-
Quoted 1 line

bxt.phy);

      }
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -1226,7 +1225,7 @@ static bool
 i830_pipes_power_well_enabled(struct drm_i915_private *dev_priv,
 static void i830_pipes_power_well_sync_hw(struct

drm_i915_private
*dev_priv,
struct i915_power_well
*power_well)
{

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              i830_pipes_power_well_enable(dev_priv, power_well);
      else
              i830_pipes_power_well_disable(dev_priv,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -1499,7 +1498,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
                                   PHY_STATUS_SPLINE_LDO(DPIO_PHY
 1,

DPIO_CH0, 0) |
PHY_STATUS_SPLINE_LDO(DPIO_PHY
1,
DPIO_CH0, 1));

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-     if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
              phy_status |= PHY_POWERGOOD(DPIO_PHY0);
 
              /* this assumes override is only used to enable

lanes
*/

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
@@ -1540,7 +1539,7 @@ static void assert_chv_phy_status(struct
 drm_i915_private *dev_priv)
                      phy_status |=
 PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
 DPIO_CH1, 1);
      }
 
-     if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
              phy_status |= PHY_POWERGOOD(DPIO_PHY1);

              /* this assumes override is only used to enable

lanes
*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -3334,12 +3333,10 @@ bool

intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,

                                       enum i915_power_well_id
power_well_id)
 {
      struct i915_power_well *power_well;
drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     bool ret;
 
      power_well = lookup_power_well(dev_priv, power_well_id);
-     ret = power_well->desc->ops->is_enabled(dev_priv,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
-     return ret;
+     return intel_power_well_is_enabled(dev_priv, power_well);
 }
 
 static const struct i915_power_well_desc skl_power_wells[] = {
@@ -3909,7 +3906,7 @@ static void
 tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private
 *i915,
                                 struct i915_power_well
 *power_well)
 {
-     if (power_well->count > 0)
+     if (intel_power_well_refcount(power_well) > 0)
              tgl_tc_cold_off_power_well_enable(i915,
power_well);
      else
              tgl_tc_cold_off_power_well_disable(i915,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -3923,7 +3920,7 @@

tgl_tc_cold_off_power_well_is_enabled(struct drm_i915_private *dev_priv,
* Not the correctly implementation but there is no way to
just
read it
* from PCODE, so returning count to avoid state mismatch
errors

       */
drivers/gpu/drm/i915/display/intel_display_power.c +3 -3
-     return power_well->count;
+     return intel_power_well_refcount(power_well);
 }
 
 static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
@@ -5729,7 +5726,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
       * override and set the lane powerdown bits accding to the
       * current lane status.
       */
-     if (cmn_bc->desc->ops->is_enabled(dev_priv, cmn_bc)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
              u32 status = intel_de_read(dev_priv, DPLL(PIPE_A));
              unsigned int mask;
@@ -5760,7 +5757,7 @@ static void chv_phy_control_init(struct
 drm_i915_private *dev_priv)
              dev_priv->chv_phy_assert[DPIO_PHY0] = true;
      }
 
-     if (cmn_d->desc->ops->is_enabled(dev_priv, cmn_d)) {
+     if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
              u32 status = intel_de_read(dev_priv,
 DPIO_PHY_STATUS);
              unsigned int mask;
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
@@ -5796,8 +5793,8 @@ static void vlv_cmnlane_wa(struct
 drm_i915_private *dev_priv)
              lookup_power_well(dev_priv, VLV_DISP_PW_DISP2D);
 
      /* If the display might be already active skip this */
-     if (cmn->desc->ops->is_enabled(dev_priv, cmn) &&
-         disp2d->desc->ops->is_enabled(dev_priv, disp2d) &&
+     if (intel_power_well_is_enabled(dev_priv, cmn) &&
+         intel_power_well_is_enabled(dev_priv, disp2d) &&
          intel_de_read(dev_priv, DPIO_CTL) & DPIO_CMNRST)
              return;
@@ -5964,12 +5961,12 @@ void
 intel_power_domains_sanitize_state(struct drm_i915_private *i915)
 
      for_each_power_well_reverse(i915, power_well) {
              if (power_well->desc->always_on || power_well-
Quoted 1 line

count ||

- !power_well->desc->ops->is_enabled(i915,
power_well))
+ !intel_power_well_is_enabled(i915, power_well))

                      continue;

              drm_dbg_kms(&i915->drm,
                          "BIOS left unused %s power well

enabled,
disabling it\n",

drivers/gpu/drm/i915/display/intel_display_power.c +3 -3
-                         power_well->desc->name);
+                         intel_power_well_name(power_well));
              intel_power_well_disable(i915, power_well);
      }
@@ -6108,9 +6105,9 @@ static void
 intel_power_domains_dump_info(struct drm_i915_private *i915)
              enum intel_display_power_domain domain;
 
              drm_dbg(&i915->drm, "%-25s %d\n",
-                     power_well->desc->name, power_well->count);
+                     intel_power_well_name(power_well),
 intel_power_well_refcount(power_well));
 
-             for_each_power_domain(domain, power_well->desc-
 > domains)
+             for_each_power_domain(domain,

intel_power_well_domains(power_well))

                      drm_dbg(&i915->drm, "  %-23s %d\n",
                              intel_display_power_domain_str(doma

in),
power_domains-

Quoted 1 line

domain_use_count[domain]);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
@@ -6143,23 +6140,25 @@ static void
 intel_power_domains_verify_state(struct drm_i915_private *i915)
              int domains_count;
              bool enabled;
 
-             enabled = power_well->desc->ops->is_enabled(i915,
 power_well);
-             if ((power_well->count || power_well->desc-
 >always_on)

!=
+ enabled = intel_power_well_is_enabled(i915,
power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+             if ((intel_power_well_refcount(power_well) ||
+                  intel_power_well_is_always_on(power_well)) !=
                  enabled)
                      drm_err(&i915->drm,
                              "power well %s state mismatch

(refcount
%d/enabled %d)",

drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
-                             power_well->desc->name,
-                             power_well->count, enabled);
+                             intel_power_well_name(power_well),
+                             intel_power_well_refcount(power_wel

l),
enabled);

              domains_count = 0;

- for_each_power_domain(domain, power_well->desc-

Quoted 1 line

domains)

+ for_each_power_domain(domain,
intel_power_well_domains(power_well))

                      domains_count += power_domains-
Quoted 1 line

domain_use_count[domain];

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
-             if (power_well->count != domains_count) {
+             if (intel_power_well_refcount(power_well) !=

domains_count) {
drm_err(&i915->drm,
"power well %s refcount/domain
refcount
mismatch "
"(refcount %d/domains refcount
%d)\n",
- power_well->desc->name, power_well-

Quoted 1 line

count,

drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+                             intel_power_well_name(power_well),
+                             intel_power_well_refcount(power_wel

l),

                              domains_count);
                      dump_domain_info = true;
              }
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -6264,10 +6263,10 @@ void intel_display_power_debug(struct

drm_i915_private *i915, struct seq_file *m

              enum intel_display_power_domain power_domain;

              power_well = &power_domains->power_wells[i];
drivers/gpu/drm/i915/display/intel_display_power.c +1 -2
-             seq_printf(m, "%-25s %d\n", power_well->desc->name,
-                        power_well->count);
+             seq_printf(m, "%-25s %d\n",

intel_power_well_name(power_well),

drivers/gpu/drm/i915/display/intel_display_power.c +1 -1
+                        intel_power_well_refcount(power_well));
 
-             for_each_power_domain(power_domain, power_well-
Quoted 2 lines

desc-
domains)

+ for_each_power_domain(power_domain,
intel_power_well_domains(power_well))

                      seq_printf(m, "  %-23s %d\n",
                                 intel_display_power_domain_str(p

ower
_domain),
power_domains-

Quoted 1 line

domain_use_count[power_domain]);

diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c index 63b97bcc64bc3..415ad193a8e83 100644

drivers/gpu/drm/i915/display/intel_display_power_well.c +0 -0
@@ -47,3 +47,34 @@ void intel_power_well_put(struct

drm_i915_private
*i915,

      if (!--power_well->count)
              intel_power_well_disable(i915, power_well);

}

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+                              struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     return power_well->desc->ops->is_enabled(i915, power_well);
+}
+
+bool intel_power_well_is_enabled_cached(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     return power_well->hw_enabled;
+}
+
+bool intel_power_well_is_always_on(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     return power_well->desc->always_on;
+}
+
+const char *intel_power_well_name(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0
+{
+     return power_well->desc->name;
+}
+
+u64 intel_power_well_domains(struct i915_power_well *power_well)
+{
+     return power_well->desc->domains;
+}
+
+int intel_power_well_refcount(struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+{
+     return power_well->count;
+}

diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.h b/drivers/gpu/drm/i915/display/intel_display_power_well.h index ba5bbd36f7fc0..43affbdbc48c1 100644

drivers/gpu/drm/i915/display/intel_display_power_well.h +3 -0
@@ -113,5 +113,12 @@ void intel_power_well_get(struct
 drm_i915_private *i915,
                        struct i915_power_well *power_well);
 void intel_power_well_put(struct drm_i915_private *i915,
                        struct i915_power_well *power_well);
+bool intel_power_well_is_enabled(struct drm_i915_private *i915,
+                              struct i915_power_well
 *power_well);
+bool intel_power_well_is_enabled_cached(struct i915_power_well

*power_well);
+bool intel_power_well_is_always_on(struct i915_power_well *power_well);
+const char *intel_power_well_name(struct i915_power_well *power_well);
+u64 intel_power_well_domains(struct i915_power_well *power_well);
+int intel_power_well_refcount(struct i915_power_well *power_well);

Quoted 1 line

#endif

BR,

Jouni Högander

author
#11 lore raw

PATCH v2 8/26 drm/i915: Move intel_display_power_well_is_enabled() to intel_display_power_well.c

In reply to Imre Deak

Move intel_display_power_well_is_enabled() to intel_power_well.c, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden.

Eventually the call to this function and in general accessing power wells directly from elsewhere in the driver should be replaced by the use of power domains.

No functional change.

---
 .../drm/i915/display/intel_display_debugfs.c  |  1 +
 .../drm/i915/display/intel_display_power.c    | 36 -------------------
 .../drm/i915/display/intel_display_power.h    | 26 --------------
 .../i915/display/intel_display_power_well.c   | 33 +++++++++++++++++
 .../i915/display/intel_display_power_well.h   | 31 +++++++++++++++-
 drivers/gpu/drm/i915/display/intel_hdcp.c     |  1 +
 6 files changed, 65 insertions(+), 63 deletions(-)
drivers/gpu/drm/i915/display/intel_display_debugfs.c +1 -0
index f4de004d470f0..bd8619428512f 100644
@@ -10,6 +10,7 @@
 #include "intel_de.h"
 #include "intel_display_debugfs.h"
 #include "intel_display_power.h"
+#include "intel_display_power_well.h"
 #include "intel_display_types.h"
 #include "intel_dmc.h"
 #include "intel_dp.h"
drivers/gpu/drm/i915/display/intel_display_power.c +0 -36
index 321b271c4b674..61eaacdac5af2 100644
@@ -26,9 +26,6 @@
 #include "intel_vga.h"
 #include "vlv_sideband.h"
 
-bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
-					 enum i915_power_well_id power_well_id);
-
 const char *
 intel_display_power_domain_str(enum intel_display_power_domain domain)
 {
@@ -917,29 +914,6 @@ static void assert_dmc_loaded(struct drm_i915_private *dev_priv)
 		      "DMC HTP Not fine\n");
 }
 
-static struct i915_power_well *
-lookup_power_well(struct drm_i915_private *dev_priv,
-		  enum i915_power_well_id power_well_id)
-{
-	struct i915_power_well *power_well;
-
-	for_each_power_well(dev_priv, power_well)
-		if (power_well->desc->id == power_well_id)
-			return power_well;
-
-	/*
-	 * It's not feasible to add error checking code to the callers since
-	 * this condition really shouldn't happen and it doesn't even make sense
-	 * to abort things like display initialization sequences. Just return
-	 * the first power well and hope the WARN gets reported so we can fix
-	 * our driver.
-	 */
-	drm_WARN(&dev_priv->drm, 1,
-		 "Power well %d not defined for this platform\n",
-		 power_well_id);
-	return &dev_priv->power_domains.power_wells[0];
-}
-
 /**
  * intel_display_power_set_target_dc_state - Set target dc state.
  * @dev_priv: i915 device
@@ -3329,16 +3303,6 @@ static const struct i915_power_well_desc chv_power_wells[] = {
 	},
 };
 
-bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
-					 enum i915_power_well_id power_well_id)
-{
-	struct i915_power_well *power_well;
-
-	power_well = lookup_power_well(dev_priv, power_well_id);
-
-	return intel_power_well_is_enabled(dev_priv, power_well);
-}
-
 static const struct i915_power_well_desc skl_power_wells[] = {
 	{
 		.name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.h +0 -26
index f28aa4b500c42..ced384b0a1658 100644
@@ -132,30 +132,6 @@ enum intel_display_power_domain {
 	POWER_DOMAIN_NUM,
 };
 
-/*
- * i915_power_well_id:
- *
- * IDs used to look up power wells. Power wells accessed directly bypassing
- * the power domains framework must be assigned a unique ID. The rest of power
- * wells must be assigned DISP_PW_ID_NONE.
- */
-enum i915_power_well_id {
-	DISP_PW_ID_NONE,
-
-	VLV_DISP_PW_DISP2D,
-	BXT_DISP_PW_DPIO_CMN_A,
-	VLV_DISP_PW_DPIO_CMN_BC,
-	GLK_DISP_PW_DPIO_CMN_C,
-	CHV_DISP_PW_DPIO_CMN_D,
-	HSW_DISP_PW_GLOBAL,
-	SKL_DISP_PW_MISC_IO,
-	SKL_DISP_PW_1,
-	SKL_DISP_PW_2,
-	ICL_DISP_PW_3,
-	SKL_DISP_DC_OFF,
-	TGL_DISP_PW_TC_COLD_OFF,
-};
-
 #define POWER_DOMAIN_PIPE(pipe) ((pipe) + POWER_DOMAIN_PIPE_A)
 #define POWER_DOMAIN_PIPE_PANEL_FITTER(pipe) \
 		((pipe) + POWER_DOMAIN_PIPE_A_PANEL_FITTER)
@@ -239,8 +215,6 @@ intel_display_power_domain_str(enum intel_display_power_domain domain);
 
 bool intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
 				    enum intel_display_power_domain domain);
-bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
-					 enum i915_power_well_id power_well_id);
 bool __intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
 				      enum intel_display_power_domain domain);
 intel_wakeref_t intel_display_power_get(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/display/intel_display_power_well.c +33 -0
index 415ad193a8e83..2a0fb9d9c60f2 100644
@@ -6,6 +6,29 @@
 #include "i915_drv.h"
 #include "intel_display_power_well.h"
 
+struct i915_power_well *
+lookup_power_well(struct drm_i915_private *i915,
+		  enum i915_power_well_id power_well_id)
+{
+	struct i915_power_well *power_well;
+
+	for_each_power_well(i915, power_well)
+		if (power_well->desc->id == power_well_id)
+			return power_well;
+
+	/*
+	 * It's not feasible to add error checking code to the callers since
+	 * this condition really shouldn't happen and it doesn't even make sense
+	 * to abort things like display initialization sequences. Just return
+	 * the first power well and hope the WARN gets reported so we can fix
+	 * our driver.
+	 */
+	drm_WARN(&i915->drm, 1,
+		 "Power well %d not defined for this platform\n",
+		 power_well_id);
+	return &i915->power_domains.power_wells[0];
+}
+
 void intel_power_well_enable(struct drm_i915_private *i915,
 			     struct i915_power_well *power_well)
 {
@@ -59,6 +82,16 @@ bool intel_power_well_is_enabled_cached(struct i915_power_well *power_well)
 	return power_well->hw_enabled;
 }
 
+bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
+					 enum i915_power_well_id power_well_id)
+{
+	struct i915_power_well *power_well;
+
+	power_well = lookup_power_well(dev_priv, power_well_id);
+
+	return intel_power_well_is_enabled(dev_priv, power_well);
+}
+
 bool intel_power_well_is_always_on(struct i915_power_well *power_well)
 {
 	return power_well->desc->always_on;
drivers/gpu/drm/i915/display/intel_display_power_well.h +30 -1
index 43affbdbc48c1..9a3756fdcf7fc 100644
@@ -8,9 +8,33 @@
 #include <linux/types.h>
 
 #include "intel_display.h"
-#include "intel_display_power.h"
 
 struct drm_i915_private;
+struct i915_power_well;
+
+/*
+ * i915_power_well_id:
+ *
+ * IDs used to look up power wells. Power wells accessed directly bypassing
+ * the power domains framework must be assigned a unique ID. The rest of power
+ * wells must be assigned DISP_PW_ID_NONE.
+ */
+enum i915_power_well_id {
+	DISP_PW_ID_NONE,
+
+	VLV_DISP_PW_DISP2D,
+	BXT_DISP_PW_DPIO_CMN_A,
+	VLV_DISP_PW_DPIO_CMN_BC,
+	GLK_DISP_PW_DPIO_CMN_C,
+	CHV_DISP_PW_DPIO_CMN_D,
+	HSW_DISP_PW_GLOBAL,
+	SKL_DISP_PW_MISC_IO,
+	SKL_DISP_PW_1,
+	SKL_DISP_PW_2,
+	ICL_DISP_PW_3,
+	SKL_DISP_DC_OFF,
+	TGL_DISP_PW_TC_COLD_OFF,
+};
 
 struct i915_power_well_regs {
 	i915_reg_t bios;
@@ -103,6 +127,9 @@ struct i915_power_well {
 	bool hw_enabled;
 };
 
+struct i915_power_well *lookup_power_well(struct drm_i915_private *i915,
+					  enum i915_power_well_id id);
+
 void intel_power_well_enable(struct drm_i915_private *i915,
 			     struct i915_power_well *power_well);
 void intel_power_well_disable(struct drm_i915_private *i915,
@@ -116,6 +143,8 @@ void intel_power_well_put(struct drm_i915_private *i915,
 bool intel_power_well_is_enabled(struct drm_i915_private *i915,
 				 struct i915_power_well *power_well);
 bool intel_power_well_is_enabled_cached(struct i915_power_well *power_well);
+bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
+					 enum i915_power_well_id power_well_id);
 bool intel_power_well_is_always_on(struct i915_power_well *power_well);
 const char *intel_power_well_name(struct i915_power_well *power_well);
 u64 intel_power_well_domains(struct i915_power_well *power_well);
drivers/gpu/drm/i915/display/intel_hdcp.c +1 -0
index e1ecf38db0ef8..4de4c174a987d 100644
@@ -20,6 +20,7 @@
 #include "intel_connector.h"
 #include "intel_de.h"
 #include "intel_display_power.h"
+#include "intel_display_power_well.h"
 #include "intel_display_types.h"
 #include "intel_hdcp.h"
 #include "intel_pcode.h"
Signature · 1 line
2.27.0
author
#12 lore raw

PATCH v2 9/26 drm/i915: Move per-platform power well hooks to intel_display_power_well.c

In reply to Imre Deak

Move the implementation of platform specific power well hooks to intel_display_power_well.c, to reduce the clutter in intel_display_power.c.

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 1759 ----------------
 .../i915/display/intel_display_power_well.c   | 1817 +++++++++++++++++
 .../i915/display/intel_display_power_well.h   |   57 +-
 3 files changed, 1839 insertions(+), 1794 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -1759
index 61eaacdac5af2..3414013e7f449 100644
@@ -7,23 +7,15 @@
 #include "i915_irq.h"
 #include "intel_cdclk.h"
 #include "intel_combo_phy.h"
-#include "intel_combo_phy_regs.h"
-#include "intel_crt.h"
 #include "intel_de.h"
 #include "intel_display_power.h"
 #include "intel_display_power_well.h"
 #include "intel_display_types.h"
 #include "intel_dmc.h"
-#include "intel_dpio_phy.h"
-#include "intel_dpll.h"
-#include "intel_hotplug.h"
 #include "intel_pch_refclk.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
-#include "intel_pps.h"
 #include "intel_snps_phy.h"
-#include "intel_tc.h"
-#include "intel_vga.h"
 #include "vlv_sideband.h"
 
 const char *
@@ -232,604 +224,6 @@ bool intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
 	return ret;
 }
 
-/*
- * Starting with Haswell, we have a "Power Down Well" that can be turned off
- * when not needed anymore. We have 4 registers that can request the power well
- * to be enabled, and it will only be disabled if none of the registers is
- * requesting it to be enabled.
- */
-static void hsw_power_well_post_enable(struct drm_i915_private *dev_priv,
-				       u8 irq_pipe_mask, bool has_vga)
-{
-	if (has_vga)
-		intel_vga_reset_io_mem(dev_priv);
-
-	if (irq_pipe_mask)
-		gen8_irq_power_well_post_enable(dev_priv, irq_pipe_mask);
-}
-
-static void hsw_power_well_pre_disable(struct drm_i915_private *dev_priv,
-				       u8 irq_pipe_mask)
-{
-	if (irq_pipe_mask)
-		gen8_irq_power_well_pre_disable(dev_priv, irq_pipe_mask);
-}
-
-#define ICL_AUX_PW_TO_CH(pw_idx)	\
-	((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
-
-#define ICL_TBT_AUX_PW_TO_CH(pw_idx)	\
-	((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
-
-static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well *power_well)
-{
-	int pw_idx = power_well->desc->hsw.idx;
-
-	return power_well->desc->hsw.is_tc_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
-						 ICL_AUX_PW_TO_CH(pw_idx);
-}
-
-static struct intel_digital_port *
-aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
-		       enum aux_ch aux_ch)
-{
-	struct intel_digital_port *dig_port = NULL;
-	struct intel_encoder *encoder;
-
-	for_each_intel_encoder(&dev_priv->drm, encoder) {
-		/* We'll check the MST primary port */
-		if (encoder->type == INTEL_OUTPUT_DP_MST)
-			continue;
-
-		dig_port = enc_to_dig_port(encoder);
-		if (!dig_port)
-			continue;
-
-		if (dig_port->aux_ch != aux_ch) {
-			dig_port = NULL;
-			continue;
-		}
-
-		break;
-	}
-
-	return dig_port;
-}
-
-static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
-				  const struct i915_power_well *power_well)
-{
-	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-	struct intel_digital_port *dig_port = aux_ch_to_digital_port(i915, aux_ch);
-
-	return intel_port_to_phy(i915, dig_port->base.port);
-}
-
-static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well,
-					   bool timeout_expected)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	int enable_delay = power_well->desc->hsw.fixed_enable_delay;
-
-	/*
-	 * For some power wells we're not supposed to watch the status bit for
-	 * an ack, but rather just wait a fixed amount of time and then
-	 * proceed.  This is only used on DG2.
-	 */
-	if (IS_DG2(dev_priv) && enable_delay) {
-		usleep_range(enable_delay, 2 * enable_delay);
-		return;
-	}
-
-	/* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us. */
-	if (intel_de_wait_for_set(dev_priv, regs->driver,
-				  HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
-		drm_dbg_kms(&dev_priv->drm, "%s power well enable timeout\n",
-			    intel_power_well_name(power_well));
-
-		drm_WARN_ON(&dev_priv->drm, !timeout_expected);
-
-	}
-}
-
-static u32 hsw_power_well_requesters(struct drm_i915_private *dev_priv,
-				     const struct i915_power_well_regs *regs,
-				     int pw_idx)
-{
-	u32 req_mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
-	u32 ret;
-
-	ret = intel_de_read(dev_priv, regs->bios) & req_mask ? 1 : 0;
-	ret |= intel_de_read(dev_priv, regs->driver) & req_mask ? 2 : 0;
-	if (regs->kvmr.reg)
-		ret |= intel_de_read(dev_priv, regs->kvmr) & req_mask ? 4 : 0;
-	ret |= intel_de_read(dev_priv, regs->debug) & req_mask ? 8 : 0;
-
-	return ret;
-}
-
-static void hsw_wait_for_power_well_disable(struct drm_i915_private *dev_priv,
-					    struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	bool disabled;
-	u32 reqs;
-
-	/*
-	 * Bspec doesn't require waiting for PWs to get disabled, but still do
-	 * this for paranoia. The known cases where a PW will be forced on:
-	 * - a KVMR request on any power well via the KVMR request register
-	 * - a DMC request on PW1 and MISC_IO power wells via the BIOS and
-	 *   DEBUG request registers
-	 * Skip the wait in case any of the request bits are set and print a
-	 * diagnostic message.
-	 */
-	wait_for((disabled = !(intel_de_read(dev_priv, regs->driver) &
-			       HSW_PWR_WELL_CTL_STATE(pw_idx))) ||
-		 (reqs = hsw_power_well_requesters(dev_priv, regs, pw_idx)), 1);
-	if (disabled)
-		return;
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "%s forced on (bios:%d driver:%d kvmr:%d debug:%d)\n",
-		    intel_power_well_name(power_well),
-		    !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs & 8));
-}
-
-static void gen9_wait_for_power_well_fuses(struct drm_i915_private *dev_priv,
-					   enum skl_power_gate pg)
-{
-	/* Timeout 5us for PG#0, for other PGs 1us */
-	drm_WARN_ON(&dev_priv->drm,
-		    intel_de_wait_for_set(dev_priv, SKL_FUSE_STATUS,
-					  SKL_FUSE_PG_DIST_STATUS(pg), 1));
-}
-
-static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
-				  struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 val;
-
-	if (power_well->desc->hsw.has_fuses) {
-		enum skl_power_gate pg;
-
-		pg = DISPLAY_VER(dev_priv) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
-						 SKL_PW_CTL_IDX_TO_PG(pw_idx);
-
-		/* Wa_16013190616:adlp */
-		if (IS_ALDERLAKE_P(dev_priv) && pg == SKL_PG1)
-			intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, 0, DISABLE_FLR_SRC);
-
-		/*
-		 * For PW1 we have to wait both for the PW0/PG0 fuse state
-		 * before enabling the power well and PW1/PG1's own fuse
-		 * state after the enabling. For all other power wells with
-		 * fuses we only have to wait for that PW/PG's fuse state
-		 * after the enabling.
-		 */
-		if (pg == SKL_PG1)
-			gen9_wait_for_power_well_fuses(dev_priv, SKL_PG0);
-	}
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-	if (power_well->desc->hsw.has_fuses) {
-		enum skl_power_gate pg;
-
-		pg = DISPLAY_VER(dev_priv) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
-						 SKL_PW_CTL_IDX_TO_PG(pw_idx);
-		gen9_wait_for_power_well_fuses(dev_priv, pg);
-	}
-
-	hsw_power_well_post_enable(dev_priv,
-				   power_well->desc->hsw.irq_pipe_mask,
-				   power_well->desc->hsw.has_vga);
-}
-
-static void hsw_power_well_disable(struct drm_i915_private *dev_priv,
-				   struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 val;
-
-	hsw_power_well_pre_disable(dev_priv,
-				   power_well->desc->hsw.irq_pipe_mask);
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-	hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-static void
-icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
-				    struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-	u32 val;
-
-	drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	if (DISPLAY_VER(dev_priv) < 12) {
-		val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-		intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-			       val | ICL_LANE_ENABLE_AUX);
-	}
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-	/* Display WA #1178: icl */
-	if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <= ICL_PW_CTL_IDX_AUX_B &&
-	    !intel_bios_is_port_edp(dev_priv, (enum port)phy)) {
-		val = intel_de_read(dev_priv, ICL_AUX_ANAOVRD1(pw_idx));
-		val |= ICL_AUX_ANAOVRD1_ENABLE | ICL_AUX_ANAOVRD1_LDO_BYPASS;
-		intel_de_write(dev_priv, ICL_AUX_ANAOVRD1(pw_idx), val);
-	}
-}
-
-static void
-icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
-				     struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-	u32 val;
-
-	drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-	val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-	intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-		       val & ~ICL_LANE_ENABLE_AUX);
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
-					struct i915_power_well *power_well,
-					struct intel_digital_port *dig_port)
-{
-	if (drm_WARN_ON(&dev_priv->drm, !dig_port))
-		return;
-
-	if (DISPLAY_VER(dev_priv) == 11 && intel_tc_cold_requires_aux_pw(dig_port))
-		return;
-
-	drm_WARN_ON(&dev_priv->drm, !intel_tc_port_ref_held(dig_port));
-}
-
-#else
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private *dev_priv,
-					struct i915_power_well *power_well,
-					struct intel_digital_port *dig_port)
-{
-}
-
-#endif
-
-#define TGL_AUX_PW_TO_TC_PORT(pw_idx)	((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1)
-
-static void icl_tc_cold_exit(struct drm_i915_private *i915)
-{
-	int ret, tries = 0;
-
-	while (1) {
-		ret = snb_pcode_write_timeout(i915, ICL_PCODE_EXIT_TCCOLD, 0,
-					      250, 1);
-		if (ret != -EAGAIN || ++tries == 3)
-			break;
-		msleep(1);
-	}
-
-	/* Spec states that TC cold exit can take up to 1ms to complete */
-	if (!ret)
-		msleep(1);
-
-	/* TODO: turn failure into a error as soon i915 CI updates ICL IFWI */
-	drm_dbg_kms(&i915->drm, "TC cold block %s\n", ret ? "failed" :
-		    "succeeded");
-}
-
-static void
-icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
-				 struct i915_power_well *power_well)
-{
-	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	bool is_tbt = power_well->desc->hsw.is_tc_tbt;
-	bool timeout_expected;
-	u32 val;
-
-	icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
-
-	val = intel_de_read(dev_priv, DP_AUX_CH_CTL(aux_ch));
-	val &= ~DP_AUX_CH_CTL_TBT_IO;
-	if (is_tbt)
-		val |= DP_AUX_CH_CTL_TBT_IO;
-	intel_de_write(dev_priv, DP_AUX_CH_CTL(aux_ch), val);
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(power_well->desc->hsw.idx));
-
-	/*
-	 * An AUX timeout is expected if the TBT DP tunnel is down,
-	 * or need to enable AUX on a legacy TypeC port as part of the TC-cold
-	 * exit sequence.
-	 */
-	timeout_expected = is_tbt || intel_tc_cold_requires_aux_pw(dig_port);
-	if (DISPLAY_VER(dev_priv) == 11 && intel_tc_cold_requires_aux_pw(dig_port))
-		icl_tc_cold_exit(dev_priv);
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well, timeout_expected);
-
-	if (DISPLAY_VER(dev_priv) >= 12 && !is_tbt) {
-		enum tc_port tc_port;
-
-		tc_port = TGL_AUX_PW_TO_TC_PORT(power_well->desc->hsw.idx);
-		intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
-			       HIP_INDEX_VAL(tc_port, 0x2));
-
-		if (intel_de_wait_for_set(dev_priv, DKL_CMN_UC_DW_27(tc_port),
-					  DKL_CMN_UC_DW27_UC_HEALTH, 1))
-			drm_warn(&dev_priv->drm,
-				 "Timeout waiting TC uC health\n");
-	}
-}
-
-static void
-icl_aux_power_well_enable(struct drm_i915_private *dev_priv,
-			  struct i915_power_well *power_well)
-{
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-	if (intel_phy_is_tc(dev_priv, phy))
-		return icl_tc_phy_aux_power_well_enable(dev_priv, power_well);
-	else if (IS_ICELAKE(dev_priv))
-		return icl_combo_phy_aux_power_well_enable(dev_priv,
-							   power_well);
-	else
-		return hsw_power_well_enable(dev_priv, power_well);
-}
-
-static void
-icl_aux_power_well_disable(struct drm_i915_private *dev_priv,
-			   struct i915_power_well *power_well)
-{
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-	if (intel_phy_is_tc(dev_priv, phy))
-		return hsw_power_well_disable(dev_priv, power_well);
-	else if (IS_ICELAKE(dev_priv))
-		return icl_combo_phy_aux_power_well_disable(dev_priv,
-							    power_well);
-	else
-		return hsw_power_well_disable(dev_priv, power_well);
-}
-
-/*
- * We should only use the power well if we explicitly asked the hardware to
- * enable it, so check if it's enabled and also check if we've requested it to
- * be enabled.
- */
-static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,
-				   struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	enum i915_power_well_id id = power_well->desc->id;
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
-		   HSW_PWR_WELL_CTL_STATE(pw_idx);
-	u32 val;
-
-	val = intel_de_read(dev_priv, regs->driver);
-
-	/*
-	 * On GEN9 big core due to a DMC bug the driver's request bits for PW1
-	 * and the MISC_IO PW will be not restored, so check instead for the
-	 * BIOS's own request bits, which are forced-on for these power wells
-	 * when exiting DC5/6.
-	 */
-	if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv) &&
-	    (id == SKL_DISP_PW_1 || id == SKL_DISP_PW_MISC_IO))
-		val |= intel_de_read(dev_priv, regs->bios);
-
-	return (val & mask) == mask;
-}
-
-static void assert_can_enable_dc9(struct drm_i915_private *dev_priv)
-{
-	drm_WARN_ONCE(&dev_priv->drm,
-		      (intel_de_read(dev_priv, DC_STATE_EN) & DC_STATE_EN_DC9),
-		      "DC9 already programmed to be enabled.\n");
-	drm_WARN_ONCE(&dev_priv->drm,
-		      intel_de_read(dev_priv, DC_STATE_EN) &
-		      DC_STATE_EN_UPTO_DC5,
-		      "DC5 still not disabled to enable DC9.\n");
-	drm_WARN_ONCE(&dev_priv->drm,
-		      intel_de_read(dev_priv, HSW_PWR_WELL_CTL2) &
-		      HSW_PWR_WELL_CTL_REQ(SKL_PW_CTL_IDX_PW_2),
-		      "Power well 2 on.\n");
-	drm_WARN_ONCE(&dev_priv->drm, intel_irqs_enabled(dev_priv),
-		      "Interrupts not disabled yet.\n");
-
-	 /*
-	  * TODO: check for the following to verify the conditions to enter DC9
-	  * state are satisfied:
-	  * 1] Check relevant display engine registers to verify if mode set
-	  * disable sequence was followed.
-	  * 2] Check if display uninitialize sequence is initialized.
-	  */
-}
-
-static void assert_can_disable_dc9(struct drm_i915_private *dev_priv)
-{
-	drm_WARN_ONCE(&dev_priv->drm, intel_irqs_enabled(dev_priv),
-		      "Interrupts not disabled yet.\n");
-	drm_WARN_ONCE(&dev_priv->drm,
-		      intel_de_read(dev_priv, DC_STATE_EN) &
-		      DC_STATE_EN_UPTO_DC5,
-		      "DC5 still not disabled.\n");
-
-	 /*
-	  * TODO: check for the following to verify DC9 state was indeed
-	  * entered before programming to disable it:
-	  * 1] Check relevant display engine registers to verify if mode
-	  *  set disable sequence was followed.
-	  * 2] Check if display uninitialize sequence is initialized.
-	  */
-}
-
-static void gen9_write_dc_state(struct drm_i915_private *dev_priv,
-				u32 state)
-{
-	int rewrites = 0;
-	int rereads = 0;
-	u32 v;
-
-	intel_de_write(dev_priv, DC_STATE_EN, state);
-
-	/* It has been observed that disabling the dc6 state sometimes
-	 * doesn't stick and dmc keeps returning old value. Make sure
-	 * the write really sticks enough times and also force rewrite until
-	 * we are confident that state is exactly what we want.
-	 */
-	do  {
-		v = intel_de_read(dev_priv, DC_STATE_EN);
-
-		if (v != state) {
-			intel_de_write(dev_priv, DC_STATE_EN, state);
-			rewrites++;
-			rereads = 0;
-		} else if (rereads++ > 5) {
-			break;
-		}
-
-	} while (rewrites < 100);
-
-	if (v != state)
-		drm_err(&dev_priv->drm,
-			"Writing dc state to 0x%x failed, now 0x%x\n",
-			state, v);
-
-	/* Most of the times we need one retry, avoid spam */
-	if (rewrites > 1)
-		drm_dbg_kms(&dev_priv->drm,
-			    "Rewrote dc state to 0x%x %d times\n",
-			    state, rewrites);
-}
-
-static u32 gen9_dc_mask(struct drm_i915_private *dev_priv)
-{
-	u32 mask;
-
-	mask = DC_STATE_EN_UPTO_DC5;
-
-	if (DISPLAY_VER(dev_priv) >= 12)
-		mask |= DC_STATE_EN_DC3CO | DC_STATE_EN_UPTO_DC6
-					  | DC_STATE_EN_DC9;
-	else if (DISPLAY_VER(dev_priv) == 11)
-		mask |= DC_STATE_EN_UPTO_DC6 | DC_STATE_EN_DC9;
-	else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
-		mask |= DC_STATE_EN_DC9;
-	else
-		mask |= DC_STATE_EN_UPTO_DC6;
-
-	return mask;
-}
-
-static void gen9_sanitize_dc_state(struct drm_i915_private *dev_priv)
-{
-	u32 val;
-
-	if (!HAS_DISPLAY(dev_priv))
-		return;
-
-	val = intel_de_read(dev_priv, DC_STATE_EN) & gen9_dc_mask(dev_priv);
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "Resetting DC state tracking from %02x to %02x\n",
-		    dev_priv->dmc.dc_state, val);
-	dev_priv->dmc.dc_state = val;
-}
-
-/**
- * gen9_set_dc_state - set target display C power state
- * @dev_priv: i915 device instance
- * @state: target DC power state
- * - DC_STATE_DISABLE
- * - DC_STATE_EN_UPTO_DC5
- * - DC_STATE_EN_UPTO_DC6
- * - DC_STATE_EN_DC9
- *
- * Signal to DMC firmware/HW the target DC power state passed in @state.
- * DMC/HW can turn off individual display clocks and power rails when entering
- * a deeper DC power state (higher in number) and turns these back when exiting
- * that state to a shallower power state (lower in number). The HW will decide
- * when to actually enter a given state on an on-demand basis, for instance
- * depending on the active state of display pipes. The state of display
- * registers backed by affected power rails are saved/restored as needed.
- *
- * Based on the above enabling a deeper DC power state is asynchronous wrt.
- * enabling it. Disabling a deeper power state is synchronous: for instance
- * setting %DC_STATE_DISABLE won't complete until all HW resources are turned
- * back on and register state is restored. This is guaranteed by the MMIO write
- * to DC_STATE_EN blocking until the state is restored.
- */
-static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state)
-{
-	u32 val;
-	u32 mask;
-
-	if (!HAS_DISPLAY(dev_priv))
-		return;
-
-	if (drm_WARN_ON_ONCE(&dev_priv->drm,
-			     state & ~dev_priv->dmc.allowed_dc_mask))
-		state &= dev_priv->dmc.allowed_dc_mask;
-
-	val = intel_de_read(dev_priv, DC_STATE_EN);
-	mask = gen9_dc_mask(dev_priv);
-	drm_dbg_kms(&dev_priv->drm, "Setting DC state from %02x to %02x\n",
-		    val & mask, state);
-
-	/* Check if DMC is ignoring our DC state requests */
-	if ((val & mask) != dev_priv->dmc.dc_state)
-		drm_err(&dev_priv->drm, "DC state mismatch (0x%x -> 0x%x)\n",
-			dev_priv->dmc.dc_state, val & mask);
-
-	val &= ~mask;
-	val |= state;
-
-	gen9_write_dc_state(dev_priv, val);
-
-	dev_priv->dmc.dc_state = val & mask;
-}
-
 static u32
 sanitize_target_dc_state(struct drm_i915_private *dev_priv,
 			 u32 target_dc_state)
@@ -855,65 +249,6 @@ sanitize_target_dc_state(struct drm_i915_private *dev_priv,
 	return target_dc_state;
 }
 
-static void tgl_enable_dc3co(struct drm_i915_private *dev_priv)
-{
-	drm_dbg_kms(&dev_priv->drm, "Enabling DC3CO\n");
-	gen9_set_dc_state(dev_priv, DC_STATE_EN_DC3CO);
-}
-
-static void tgl_disable_dc3co(struct drm_i915_private *dev_priv)
-{
-	u32 val;
-
-	drm_dbg_kms(&dev_priv->drm, "Disabling DC3CO\n");
-	val = intel_de_read(dev_priv, DC_STATE_EN);
-	val &= ~DC_STATE_DC3CO_STATUS;
-	intel_de_write(dev_priv, DC_STATE_EN, val);
-	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-	/*
-	 * Delay of 200us DC3CO Exit time B.Spec 49196
-	 */
-	usleep_range(200, 210);
-}
-
-static void bxt_enable_dc9(struct drm_i915_private *dev_priv)
-{
-	assert_can_enable_dc9(dev_priv);
-
-	drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
-	/*
-	 * Power sequencer reset is not needed on
-	 * platforms with South Display Engine on PCH,
-	 * because PPS registers are always on.
-	 */
-	if (!HAS_PCH_SPLIT(dev_priv))
-		intel_pps_reset_all(dev_priv);
-	gen9_set_dc_state(dev_priv, DC_STATE_EN_DC9);
-}
-
-static void bxt_disable_dc9(struct drm_i915_private *dev_priv)
-{
-	assert_can_disable_dc9(dev_priv);
-
-	drm_dbg_kms(&dev_priv->drm, "Disabling DC9\n");
-
-	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-
-	intel_pps_unlock_regs_wa(dev_priv);
-}
-
-static void assert_dmc_loaded(struct drm_i915_private *dev_priv)
-{
-	drm_WARN_ONCE(&dev_priv->drm,
-		      !intel_de_read(dev_priv,
-				     DMC_PROGRAM(dev_priv->dmc.dmc_info[DMC_FW_MAIN].start_mmioaddr, 0)),
-				     "DMC program storage start is NULL\n");
-	drm_WARN_ONCE(&dev_priv->drm, !intel_de_read(dev_priv, DMC_SSP_BASE),
-		      "DMC SSP Base Not fine\n");
-	drm_WARN_ONCE(&dev_priv->drm, !intel_de_read(dev_priv, DMC_HTP_SKL),
-		      "DMC HTP Not fine\n");
-}
-
 /**
  * intel_display_power_set_target_dc_state - Set target dc state.
  * @dev_priv: i915 device
@@ -958,912 +293,8 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,
 	mutex_unlock(&power_domains->lock);
 }
 
-static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
-{
-	enum i915_power_well_id high_pg;
-
-	/* Power wells at this level and above must be disabled for DC5 entry */
-	if (DISPLAY_VER(dev_priv) == 12)
-		high_pg = ICL_DISP_PW_3;
-	else
-		high_pg = SKL_DISP_PW_2;
-
-	drm_WARN_ONCE(&dev_priv->drm,
-		      intel_display_power_well_is_enabled(dev_priv, high_pg),
-		      "Power wells above platform's DC5 limit still enabled.\n");
-
-	drm_WARN_ONCE(&dev_priv->drm,
-		      (intel_de_read(dev_priv, DC_STATE_EN) &
-		       DC_STATE_EN_UPTO_DC5),
-		      "DC5 already programmed to be enabled.\n");
-	assert_rpm_wakelock_held(&dev_priv->runtime_pm);
-
-	assert_dmc_loaded(dev_priv);
-}
-
-static void gen9_enable_dc5(struct drm_i915_private *dev_priv)
-{
-	assert_can_enable_dc5(dev_priv);
-
-	drm_dbg_kms(&dev_priv->drm, "Enabling DC5\n");
-
-	/* Wa Display #1183: skl,kbl,cfl */
-	if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv))
-		intel_de_write(dev_priv, GEN8_CHICKEN_DCPR_1,
-			       intel_de_read(dev_priv, GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);
-
-	gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
-}
-
-static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
-{
-	drm_WARN_ONCE(&dev_priv->drm,
-		      intel_de_read(dev_priv, UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
-		      "Backlight is not disabled.\n");
-	drm_WARN_ONCE(&dev_priv->drm,
-		      (intel_de_read(dev_priv, DC_STATE_EN) &
-		       DC_STATE_EN_UPTO_DC6),
-		      "DC6 already programmed to be enabled.\n");
-
-	assert_dmc_loaded(dev_priv);
-}
-
-static void skl_enable_dc6(struct drm_i915_private *dev_priv)
-{
-	assert_can_enable_dc6(dev_priv);
-
-	drm_dbg_kms(&dev_priv->drm, "Enabling DC6\n");
-
-	/* Wa Display #1183: skl,kbl,cfl */
-	if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv))
-		intel_de_write(dev_priv, GEN8_CHICKEN_DCPR_1,
-			       intel_de_read(dev_priv, GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);
-
-	gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
-}
-
-static void hsw_power_well_sync_hw(struct drm_i915_private *dev_priv,
-				   struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
-	u32 bios_req = intel_de_read(dev_priv, regs->bios);
-
-	/* Take over the request bit if set by BIOS. */
-	if (bios_req & mask) {
-		u32 drv_req = intel_de_read(dev_priv, regs->driver);
-
-		if (!(drv_req & mask))
-			intel_de_write(dev_priv, regs->driver, drv_req | mask);
-		intel_de_write(dev_priv, regs->bios, bios_req & ~mask);
-	}
-}
-
-static void bxt_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	bxt_ddi_phy_init(dev_priv, power_well->desc->bxt.phy);
-}
-
-static void bxt_dpio_cmn_power_well_disable(struct drm_i915_private *dev_priv,
-					    struct i915_power_well *power_well)
-{
-	bxt_ddi_phy_uninit(dev_priv, power_well->desc->bxt.phy);
-}
-
-static bool bxt_dpio_cmn_power_well_enabled(struct drm_i915_private *dev_priv,
-					    struct i915_power_well *power_well)
-{
-	return bxt_ddi_phy_is_enabled(dev_priv, power_well->desc->bxt.phy);
-}
-
-static void bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
-{
-	struct i915_power_well *power_well;
-
-	power_well = lookup_power_well(dev_priv, BXT_DISP_PW_DPIO_CMN_A);
-	if (intel_power_well_refcount(power_well) > 0)
-		bxt_ddi_phy_verify_state(dev_priv, power_well->desc->bxt.phy);
-
-	power_well = lookup_power_well(dev_priv, VLV_DISP_PW_DPIO_CMN_BC);
-	if (intel_power_well_refcount(power_well) > 0)
-		bxt_ddi_phy_verify_state(dev_priv, power_well->desc->bxt.phy);
-
-	if (IS_GEMINILAKE(dev_priv)) {
-		power_well = lookup_power_well(dev_priv,
-					       GLK_DISP_PW_DPIO_CMN_C);
-		if (intel_power_well_refcount(power_well) > 0)
-			bxt_ddi_phy_verify_state(dev_priv,
-						 power_well->desc->bxt.phy);
-	}
-}
-
-static bool gen9_dc_off_power_well_enabled(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	return ((intel_de_read(dev_priv, DC_STATE_EN) & DC_STATE_EN_DC3CO) == 0 &&
-		(intel_de_read(dev_priv, DC_STATE_EN) & DC_STATE_EN_UPTO_DC5_DC6_MASK) == 0);
-}
-
-static void gen9_assert_dbuf_enabled(struct drm_i915_private *dev_priv)
-{
-	u8 hw_enabled_dbuf_slices = intel_enabled_dbuf_slices_mask(dev_priv);
-	u8 enabled_dbuf_slices = dev_priv->dbuf.enabled_slices;
-
-	drm_WARN(&dev_priv->drm,
-		 hw_enabled_dbuf_slices != enabled_dbuf_slices,
-		 "Unexpected DBuf power power state (0x%08x, expected 0x%08x)\n",
-		 hw_enabled_dbuf_slices,
-		 enabled_dbuf_slices);
-}
-
-static void gen9_disable_dc_states(struct drm_i915_private *dev_priv)
-{
-	struct intel_cdclk_config cdclk_config = {};
-
-	if (dev_priv->dmc.target_dc_state == DC_STATE_EN_DC3CO) {
-		tgl_disable_dc3co(dev_priv);
-		return;
-	}
-
-	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-
-	if (!HAS_DISPLAY(dev_priv))
-		return;
-
-	intel_cdclk_get_cdclk(dev_priv, &cdclk_config);
-	/* Can't read out voltage_level so can't use intel_cdclk_changed() */
-	drm_WARN_ON(&dev_priv->drm,
-		    intel_cdclk_needs_modeset(&dev_priv->cdclk.hw,
-					      &cdclk_config));
-
-	gen9_assert_dbuf_enabled(dev_priv);
-
-	if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
-		bxt_verify_ddi_phy_power_wells(dev_priv);
-
-	if (DISPLAY_VER(dev_priv) >= 11)
-		/*
-		 * DMC retains HW context only for port A, the other combo
-		 * PHY's HW context for port B is lost after DC transitions,
-		 * so we need to restore it manually.
-		 */
-		intel_combo_phy_init(dev_priv);
-}
-
-static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
-					  struct i915_power_well *power_well)
-{
-	gen9_disable_dc_states(dev_priv);
-}
-
-static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	if (!intel_dmc_has_payload(dev_priv))
-		return;
-
-	switch (dev_priv->dmc.target_dc_state) {
-	case DC_STATE_EN_DC3CO:
-		tgl_enable_dc3co(dev_priv);
-		break;
-	case DC_STATE_EN_UPTO_DC6:
-		skl_enable_dc6(dev_priv);
-		break;
-	case DC_STATE_EN_UPTO_DC5:
-		gen9_enable_dc5(dev_priv);
-		break;
-	}
-}
-
-static void i9xx_power_well_sync_hw_noop(struct drm_i915_private *dev_priv,
-					 struct i915_power_well *power_well)
-{
-}
-
-static void i9xx_always_on_power_well_noop(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-}
-
-static bool i9xx_always_on_power_well_enabled(struct drm_i915_private *dev_priv,
-					     struct i915_power_well *power_well)
-{
-	return true;
-}
-
-static void i830_pipes_power_well_enable(struct drm_i915_private *dev_priv,
-					 struct i915_power_well *power_well)
-{
-	if ((intel_de_read(dev_priv, PIPECONF(PIPE_A)) & PIPECONF_ENABLE) == 0)
-		i830_enable_pipe(dev_priv, PIPE_A);
-	if ((intel_de_read(dev_priv, PIPECONF(PIPE_B)) & PIPECONF_ENABLE) == 0)
-		i830_enable_pipe(dev_priv, PIPE_B);
-}
-
-static void i830_pipes_power_well_disable(struct drm_i915_private *dev_priv,
-					  struct i915_power_well *power_well)
-{
-	i830_disable_pipe(dev_priv, PIPE_B);
-	i830_disable_pipe(dev_priv, PIPE_A);
-}
-
-static bool i830_pipes_power_well_enabled(struct drm_i915_private *dev_priv,
-					  struct i915_power_well *power_well)
-{
-	return intel_de_read(dev_priv, PIPECONF(PIPE_A)) & PIPECONF_ENABLE &&
-		intel_de_read(dev_priv, PIPECONF(PIPE_B)) & PIPECONF_ENABLE;
-}
-
-static void i830_pipes_power_well_sync_hw(struct drm_i915_private *dev_priv,
-					  struct i915_power_well *power_well)
-{
-	if (intel_power_well_refcount(power_well) > 0)
-		i830_pipes_power_well_enable(dev_priv, power_well);
-	else
-		i830_pipes_power_well_disable(dev_priv, power_well);
-}
-
-static void vlv_set_power_well(struct drm_i915_private *dev_priv,
-			       struct i915_power_well *power_well, bool enable)
-{
-	int pw_idx = power_well->desc->vlv.idx;
-	u32 mask;
-	u32 state;
-	u32 ctrl;
-
-	mask = PUNIT_PWRGT_MASK(pw_idx);
-	state = enable ? PUNIT_PWRGT_PWR_ON(pw_idx) :
-			 PUNIT_PWRGT_PWR_GATE(pw_idx);
-
-	vlv_punit_get(dev_priv);
-
-#define COND \
-	((vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) & mask) == state)
-
-	if (COND)
-		goto out;
-
-	ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL);
-	ctrl &= ~mask;
-	ctrl |= state;
-	vlv_punit_write(dev_priv, PUNIT_REG_PWRGT_CTRL, ctrl);
-
-	if (wait_for(COND, 100))
-		drm_err(&dev_priv->drm,
-			"timeout setting power well state %08x (%08x)\n",
-			state,
-			vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL));
-
-#undef COND
-
-out:
-	vlv_punit_put(dev_priv);
-}
-
-static void vlv_power_well_enable(struct drm_i915_private *dev_priv,
-				  struct i915_power_well *power_well)
-{
-	vlv_set_power_well(dev_priv, power_well, true);
-}
-
-static void vlv_power_well_disable(struct drm_i915_private *dev_priv,
-				   struct i915_power_well *power_well)
-{
-	vlv_set_power_well(dev_priv, power_well, false);
-}
-
-static bool vlv_power_well_enabled(struct drm_i915_private *dev_priv,
-				   struct i915_power_well *power_well)
-{
-	int pw_idx = power_well->desc->vlv.idx;
-	bool enabled = false;
-	u32 mask;
-	u32 state;
-	u32 ctrl;
-
-	mask = PUNIT_PWRGT_MASK(pw_idx);
-	ctrl = PUNIT_PWRGT_PWR_ON(pw_idx);
-
-	vlv_punit_get(dev_priv);
-
-	state = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) & mask;
-	/*
-	 * We only ever set the power-on and power-gate states, anything
-	 * else is unexpected.
-	 */
-	drm_WARN_ON(&dev_priv->drm, state != PUNIT_PWRGT_PWR_ON(pw_idx) &&
-		    state != PUNIT_PWRGT_PWR_GATE(pw_idx));
-	if (state == ctrl)
-		enabled = true;
-
-	/*
-	 * A transient state at this point would mean some unexpected party
-	 * is poking at the power controls too.
-	 */
-	ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL) & mask;
-	drm_WARN_ON(&dev_priv->drm, ctrl != state);
-
-	vlv_punit_put(dev_priv);
-
-	return enabled;
-}
-
-static void vlv_init_display_clock_gating(struct drm_i915_private *dev_priv)
-{
-	u32 val;
-
-	/*
-	 * On driver load, a pipe may be active and driving a DSI display.
-	 * Preserve DPOUNIT_CLOCK_GATE_DISABLE to avoid the pipe getting stuck
-	 * (and never recovering) in this case. intel_dsi_post_disable() will
-	 * clear it when we turn off the display.
-	 */
-	val = intel_de_read(dev_priv, DSPCLK_GATE_D);
-	val &= DPOUNIT_CLOCK_GATE_DISABLE;
-	val |= VRHUNIT_CLOCK_GATE_DISABLE;
-	intel_de_write(dev_priv, DSPCLK_GATE_D, val);
-
-	/*
-	 * Disable trickle feed and enable pnd deadline calculation
-	 */
-	intel_de_write(dev_priv, MI_ARB_VLV,
-		       MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
-	intel_de_write(dev_priv, CBR1_VLV, 0);
-
-	drm_WARN_ON(&dev_priv->drm, RUNTIME_INFO(dev_priv)->rawclk_freq == 0);
-	intel_de_write(dev_priv, RAWCLK_FREQ_VLV,
-		       DIV_ROUND_CLOSEST(RUNTIME_INFO(dev_priv)->rawclk_freq,
-					 1000));
-}
-
-static void vlv_display_power_well_init(struct drm_i915_private *dev_priv)
-{
-	struct intel_encoder *encoder;
-	enum pipe pipe;
-
-	/*
-	 * Enable the CRI clock source so we can get at the
-	 * display and the reference clock for VGA
-	 * hotplug / manual detection. Supposedly DSI also
-	 * needs the ref clock up and running.
-	 *
-	 * CHV DPLL B/C have some issues if VGA mode is enabled.
-	 */
-	for_each_pipe(dev_priv, pipe) {
-		u32 val = intel_de_read(dev_priv, DPLL(pipe));
-
-		val |= DPLL_REF_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS;
-		if (pipe != PIPE_A)
-			val |= DPLL_INTEGRATED_CRI_CLK_VLV;
-
-		intel_de_write(dev_priv, DPLL(pipe), val);
-	}
-
-	vlv_init_display_clock_gating(dev_priv);
-
-	spin_lock_irq(&dev_priv->irq_lock);
-	valleyview_enable_display_irqs(dev_priv);
-	spin_unlock_irq(&dev_priv->irq_lock);
-
-	/*
-	 * During driver initialization/resume we can avoid restoring the
-	 * part of the HW/SW state that will be inited anyway explicitly.
-	 */
-	if (dev_priv->power_domains.initializing)
-		return;
-
-	intel_hpd_init(dev_priv);
-	intel_hpd_poll_disable(dev_priv);
-
-	/* Re-enable the ADPA, if we have one */
-	for_each_intel_encoder(&dev_priv->drm, encoder) {
-		if (encoder->type == INTEL_OUTPUT_ANALOG)
-			intel_crt_reset(&encoder->base);
-	}
-
-	intel_vga_redisable_power_on(dev_priv);
-
-	intel_pps_unlock_regs_wa(dev_priv);
-}
-
-static void vlv_display_power_well_deinit(struct drm_i915_private *dev_priv)
-{
-	spin_lock_irq(&dev_priv->irq_lock);
-	valleyview_disable_display_irqs(dev_priv);
-	spin_unlock_irq(&dev_priv->irq_lock);
-
-	/* make sure we're done processing display irqs */
-	intel_synchronize_irq(dev_priv);
-
-	intel_pps_reset_all(dev_priv);
-
-	/* Prevent us from re-enabling polling on accident in late suspend */
-	if (!dev_priv->drm.dev->power.is_suspended)
-		intel_hpd_poll_enable(dev_priv);
-}
-
-static void vlv_display_power_well_enable(struct drm_i915_private *dev_priv,
-					  struct i915_power_well *power_well)
-{
-	vlv_set_power_well(dev_priv, power_well, true);
-
-	vlv_display_power_well_init(dev_priv);
-}
-
-static void vlv_display_power_well_disable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	vlv_display_power_well_deinit(dev_priv);
-
-	vlv_set_power_well(dev_priv, power_well, false);
-}
-
-static void vlv_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	/* since ref/cri clock was enabled */
-	udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
-
-	vlv_set_power_well(dev_priv, power_well, true);
-
-	/*
-	 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx -
-	 *  6.	De-assert cmn_reset/side_reset. Same as VLV X0.
-	 *   a.	GUnit 0x2110 bit[0] set to 1 (def 0)
-	 *   b.	The other bits such as sfr settings / modesel may all
-	 *	be set to 0.
-	 *
-	 * This should only be done on init and resume from S3 with
-	 * both PLLs disabled, or we risk losing DPIO and PLL
-	 * synchronization.
-	 */
-	intel_de_write(dev_priv, DPIO_CTL,
-		       intel_de_read(dev_priv, DPIO_CTL) | DPIO_CMNRST);
-}
-
-static void vlv_dpio_cmn_power_well_disable(struct drm_i915_private *dev_priv,
-					    struct i915_power_well *power_well)
-{
-	enum pipe pipe;
-
-	for_each_pipe(dev_priv, pipe)
-		assert_pll_disabled(dev_priv, pipe);
-
-	/* Assert common reset */
-	intel_de_write(dev_priv, DPIO_CTL,
-		       intel_de_read(dev_priv, DPIO_CTL) & ~DPIO_CMNRST);
-
-	vlv_set_power_well(dev_priv, power_well, false);
-}
-
 #define POWER_DOMAIN_MASK (GENMASK_ULL(POWER_DOMAIN_NUM - 1, 0))
 
-#define BITS_SET(val, bits) (((val) & (bits)) == (bits))
-
-static void assert_chv_phy_status(struct drm_i915_private *dev_priv)
-{
-	struct i915_power_well *cmn_bc =
-		lookup_power_well(dev_priv, VLV_DISP_PW_DPIO_CMN_BC);
-	struct i915_power_well *cmn_d =
-		lookup_power_well(dev_priv, CHV_DISP_PW_DPIO_CMN_D);
-	u32 phy_control = dev_priv->chv_phy_control;
-	u32 phy_status = 0;
-	u32 phy_status_mask = 0xffffffff;
-
-	/*
-	 * The BIOS can leave the PHY is some weird state
-	 * where it doesn't fully power down some parts.
-	 * Disable the asserts until the PHY has been fully
-	 * reset (ie. the power well has been disabled at
-	 * least once).
-	 */
-	if (!dev_priv->chv_phy_assert[DPIO_PHY0])
-		phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH0) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 0) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 1) |
-				     PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH1) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 0) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 1));
-
-	if (!dev_priv->chv_phy_assert[DPIO_PHY1])
-		phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY1, DPIO_CH0) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 0) |
-				     PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 1));
-
-	if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
-		phy_status |= PHY_POWERGOOD(DPIO_PHY0);
-
-		/* this assumes override is only used to enable lanes */
-		if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0, DPIO_CH0)) == 0)
-			phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH0);
-
-		if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0, DPIO_CH1)) == 0)
-			phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1);
-
-		/* CL1 is on whenever anything is on in either channel */
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH0) |
-			     PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1)))
-			phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH0);
-
-		/*
-		 * The DPLLB check accounts for the pipe B + port A usage
-		 * with CL2 powered up but all the lanes in the second channel
-		 * powered down.
-		 */
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1)) &&
-		    (intel_de_read(dev_priv, DPLL(PIPE_B)) & DPLL_VCO_ENABLE) == 0)
-			phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH1);
-
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0, DPIO_CH0)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 0);
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0, DPIO_CH0)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 1);
-
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0, DPIO_CH1)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 0);
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0, DPIO_CH1)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 1);
-	}
-
-	if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
-		phy_status |= PHY_POWERGOOD(DPIO_PHY1);
-
-		/* this assumes override is only used to enable lanes */
-		if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY1, DPIO_CH0)) == 0)
-			phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY1, DPIO_CH0);
-
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY1, DPIO_CH0)))
-			phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY1, DPIO_CH0);
-
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY1, DPIO_CH0)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 0);
-		if (BITS_SET(phy_control,
-			     PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY1, DPIO_CH0)))
-			phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 1);
-	}
-
-	phy_status &= phy_status_mask;
-
-	/*
-	 * The PHY may be busy with some initial calibration and whatnot,
-	 * so the power state can take a while to actually change.
-	 */
-	if (intel_de_wait_for_register(dev_priv, DISPLAY_PHY_STATUS,
-				       phy_status_mask, phy_status, 10))
-		drm_err(&dev_priv->drm,
-			"Unexpected PHY_STATUS 0x%08x, expected 0x%08x (PHY_CONTROL=0x%08x)\n",
-			intel_de_read(dev_priv, DISPLAY_PHY_STATUS) & phy_status_mask,
-			phy_status, dev_priv->chv_phy_control);
-}
-
-#undef BITS_SET
-
-static void chv_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
-					   struct i915_power_well *power_well)
-{
-	enum dpio_phy phy;
-	enum pipe pipe;
-	u32 tmp;
-
-	drm_WARN_ON_ONCE(&dev_priv->drm,
-			 power_well->desc->id != VLV_DISP_PW_DPIO_CMN_BC &&
-			 power_well->desc->id != CHV_DISP_PW_DPIO_CMN_D);
-
-	if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-		pipe = PIPE_A;
-		phy = DPIO_PHY0;
-	} else {
-		pipe = PIPE_C;
-		phy = DPIO_PHY1;
-	}
-
-	/* since ref/cri clock was enabled */
-	udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
-	vlv_set_power_well(dev_priv, power_well, true);
-
-	/* Poll for phypwrgood signal */
-	if (intel_de_wait_for_set(dev_priv, DISPLAY_PHY_STATUS,
-				  PHY_POWERGOOD(phy), 1))
-		drm_err(&dev_priv->drm, "Display PHY %d is not power up\n",
-			phy);
-
-	vlv_dpio_get(dev_priv);
-
-	/* Enable dynamic power down */
-	tmp = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW28);
-	tmp |= DPIO_DYNPWRDOWNEN_CH0 | DPIO_CL1POWERDOWNEN |
-		DPIO_SUS_CLK_CONFIG_GATE_CLKREQ;
-	vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW28, tmp);
-
-	if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-		tmp = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW6_CH1);
-		tmp |= DPIO_DYNPWRDOWNEN_CH1;
-		vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW6_CH1, tmp);
-	} else {
-		/*
-		 * Force the non-existing CL2 off. BXT does this
-		 * too, so maybe it saves some power even though
-		 * CL2 doesn't exist?
-		 */
-		tmp = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW30);
-		tmp |= DPIO_CL2_LDOFUSE_PWRENB;
-		vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW30, tmp);
-	}
-
-	vlv_dpio_put(dev_priv);
-
-	dev_priv->chv_phy_control |= PHY_COM_LANE_RESET_DEASSERT(phy);
-	intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-		       dev_priv->chv_phy_control);
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "Enabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
-		    phy, dev_priv->chv_phy_control);
-
-	assert_chv_phy_status(dev_priv);
-}
-
-static void chv_dpio_cmn_power_well_disable(struct drm_i915_private *dev_priv,
-					    struct i915_power_well *power_well)
-{
-	enum dpio_phy phy;
-
-	drm_WARN_ON_ONCE(&dev_priv->drm,
-			 power_well->desc->id != VLV_DISP_PW_DPIO_CMN_BC &&
-			 power_well->desc->id != CHV_DISP_PW_DPIO_CMN_D);
-
-	if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-		phy = DPIO_PHY0;
-		assert_pll_disabled(dev_priv, PIPE_A);
-		assert_pll_disabled(dev_priv, PIPE_B);
-	} else {
-		phy = DPIO_PHY1;
-		assert_pll_disabled(dev_priv, PIPE_C);
-	}
-
-	dev_priv->chv_phy_control &= ~PHY_COM_LANE_RESET_DEASSERT(phy);
-	intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-		       dev_priv->chv_phy_control);
-
-	vlv_set_power_well(dev_priv, power_well, false);
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "Disabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
-		    phy, dev_priv->chv_phy_control);
-
-	/* PHY is fully reset now, so we can enable the PHY state asserts */
-	dev_priv->chv_phy_assert[phy] = true;
-
-	assert_chv_phy_status(dev_priv);
-}
-
-static void assert_chv_phy_powergate(struct drm_i915_private *dev_priv, enum dpio_phy phy,
-				     enum dpio_channel ch, bool override, unsigned int mask)
-{
-	enum pipe pipe = phy == DPIO_PHY0 ? PIPE_A : PIPE_C;
-	u32 reg, val, expected, actual;
-
-	/*
-	 * The BIOS can leave the PHY is some weird state
-	 * where it doesn't fully power down some parts.
-	 * Disable the asserts until the PHY has been fully
-	 * reset (ie. the power well has been disabled at
-	 * least once).
-	 */
-	if (!dev_priv->chv_phy_assert[phy])
-		return;
-
-	if (ch == DPIO_CH0)
-		reg = _CHV_CMN_DW0_CH0;
-	else
-		reg = _CHV_CMN_DW6_CH1;
-
-	vlv_dpio_get(dev_priv);
-	val = vlv_dpio_read(dev_priv, pipe, reg);
-	vlv_dpio_put(dev_priv);
-
-	/*
-	 * This assumes !override is only used when the port is disabled.
-	 * All lanes should power down even without the override when
-	 * the port is disabled.
-	 */
-	if (!override || mask == 0xf) {
-		expected = DPIO_ALLDL_POWERDOWN | DPIO_ANYDL_POWERDOWN;
-		/*
-		 * If CH1 common lane is not active anymore
-		 * (eg. for pipe B DPLL) the entire channel will
-		 * shut down, which causes the common lane registers
-		 * to read as 0. That means we can't actually check
-		 * the lane power down status bits, but as the entire
-		 * register reads as 0 it's a good indication that the
-		 * channel is indeed entirely powered down.
-		 */
-		if (ch == DPIO_CH1 && val == 0)
-			expected = 0;
-	} else if (mask != 0x0) {
-		expected = DPIO_ANYDL_POWERDOWN;
-	} else {
-		expected = 0;
-	}
-
-	if (ch == DPIO_CH0)
-		actual = val >> DPIO_ANYDL_POWERDOWN_SHIFT_CH0;
-	else
-		actual = val >> DPIO_ANYDL_POWERDOWN_SHIFT_CH1;
-	actual &= DPIO_ALLDL_POWERDOWN | DPIO_ANYDL_POWERDOWN;
-
-	drm_WARN(&dev_priv->drm, actual != expected,
-		 "Unexpected DPIO lane power down: all %d, any %d. Expected: all %d, any %d. (0x%x = 0x%08x)\n",
-		 !!(actual & DPIO_ALLDL_POWERDOWN),
-		 !!(actual & DPIO_ANYDL_POWERDOWN),
-		 !!(expected & DPIO_ALLDL_POWERDOWN),
-		 !!(expected & DPIO_ANYDL_POWERDOWN),
-		 reg, val);
-}
-
-bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,
-			  enum dpio_channel ch, bool override)
-{
-	struct i915_power_domains *power_domains = &dev_priv->power_domains;
-	bool was_override;
-
-	mutex_lock(&power_domains->lock);
-
-	was_override = dev_priv->chv_phy_control & PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-
-	if (override == was_override)
-		goto out;
-
-	if (override)
-		dev_priv->chv_phy_control |= PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-	else
-		dev_priv->chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-
-	intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-		       dev_priv->chv_phy_control);
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "Power gating DPIO PHY%d CH%d (DPIO_PHY_CONTROL=0x%08x)\n",
-		    phy, ch, dev_priv->chv_phy_control);
-
-	assert_chv_phy_status(dev_priv);
-
-out:
-	mutex_unlock(&power_domains->lock);
-
-	return was_override;
-}
-
-void chv_phy_powergate_lanes(struct intel_encoder *encoder,
-			     bool override, unsigned int mask)
-{
-	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-	struct i915_power_domains *power_domains = &dev_priv->power_domains;
-	enum dpio_phy phy = vlv_dig_port_to_phy(enc_to_dig_port(encoder));
-	enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder));
-
-	mutex_lock(&power_domains->lock);
-
-	dev_priv->chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD(0xf, phy, ch);
-	dev_priv->chv_phy_control |= PHY_CH_POWER_DOWN_OVRD(mask, phy, ch);
-
-	if (override)
-		dev_priv->chv_phy_control |= PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-	else
-		dev_priv->chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-
-	intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-		       dev_priv->chv_phy_control);
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "Power gating DPIO PHY%d CH%d lanes 0x%x (PHY_CONTROL=0x%08x)\n",
-		    phy, ch, mask, dev_priv->chv_phy_control);
-
-	assert_chv_phy_status(dev_priv);
-
-	assert_chv_phy_powergate(dev_priv, phy, ch, override, mask);
-
-	mutex_unlock(&power_domains->lock);
-}
-
-static bool chv_pipe_power_well_enabled(struct drm_i915_private *dev_priv,
-					struct i915_power_well *power_well)
-{
-	enum pipe pipe = PIPE_A;
-	bool enabled;
-	u32 state, ctrl;
-
-	vlv_punit_get(dev_priv);
-
-	state = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSS_MASK(pipe);
-	/*
-	 * We only ever set the power-on and power-gate states, anything
-	 * else is unexpected.
-	 */
-	drm_WARN_ON(&dev_priv->drm, state != DP_SSS_PWR_ON(pipe) &&
-		    state != DP_SSS_PWR_GATE(pipe));
-	enabled = state == DP_SSS_PWR_ON(pipe);
-
-	/*
-	 * A transient state at this point would mean some unexpected party
-	 * is poking at the power controls too.
-	 */
-	ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSC_MASK(pipe);
-	drm_WARN_ON(&dev_priv->drm, ctrl << 16 != state);
-
-	vlv_punit_put(dev_priv);
-
-	return enabled;
-}
-
-static void chv_set_pipe_power_well(struct drm_i915_private *dev_priv,
-				    struct i915_power_well *power_well,
-				    bool enable)
-{
-	enum pipe pipe = PIPE_A;
-	u32 state;
-	u32 ctrl;
-
-	state = enable ? DP_SSS_PWR_ON(pipe) : DP_SSS_PWR_GATE(pipe);
-
-	vlv_punit_get(dev_priv);
-
-#define COND \
-	((vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSS_MASK(pipe)) == state)
-
-	if (COND)
-		goto out;
-
-	ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM);
-	ctrl &= ~DP_SSC_MASK(pipe);
-	ctrl |= enable ? DP_SSC_PWR_ON(pipe) : DP_SSC_PWR_GATE(pipe);
-	vlv_punit_write(dev_priv, PUNIT_REG_DSPSSPM, ctrl);
-
-	if (wait_for(COND, 100))
-		drm_err(&dev_priv->drm,
-			"timeout setting power well state %08x (%08x)\n",
-			state,
-			vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM));
-
-#undef COND
-
-out:
-	vlv_punit_put(dev_priv);
-}
-
-static void chv_pipe_power_well_sync_hw(struct drm_i915_private *dev_priv,
-					struct i915_power_well *power_well)
-{
-	intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-		       dev_priv->chv_phy_control);
-}
-
-static void chv_pipe_power_well_enable(struct drm_i915_private *dev_priv,
-				       struct i915_power_well *power_well)
-{
-	chv_set_pipe_power_well(dev_priv, power_well, true);
-
-	vlv_display_power_well_init(dev_priv);
-}
-
-static void chv_pipe_power_well_disable(struct drm_i915_private *dev_priv,
-					struct i915_power_well *power_well)
-{
-	vlv_display_power_well_deinit(dev_priv);
-
-	chv_set_pipe_power_well(dev_priv, power_well, false);
-}
-
 static u64 __async_put_domains_mask(struct i915_power_domains *power_domains)
 {
 	return power_domains->async_put_domains[0] |
@@ -3043,27 +1474,6 @@ intel_display_power_put_mask_in_set(struct drm_i915_private *i915,
 #define XELPD_DDI_IO_TC3_POWER_DOMAINS		BIT_ULL(POWER_DOMAIN_PORT_DDI_IO_TC3)
 #define XELPD_DDI_IO_TC4_POWER_DOMAINS		BIT_ULL(POWER_DOMAIN_PORT_DDI_IO_TC4)
 
-static const struct i915_power_well_ops i9xx_always_on_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = i9xx_always_on_power_well_noop,
-	.disable = i9xx_always_on_power_well_noop,
-	.is_enabled = i9xx_always_on_power_well_enabled,
-};
-
-static const struct i915_power_well_ops chv_pipe_power_well_ops = {
-	.sync_hw = chv_pipe_power_well_sync_hw,
-	.enable = chv_pipe_power_well_enable,
-	.disable = chv_pipe_power_well_disable,
-	.is_enabled = chv_pipe_power_well_enabled,
-};
-
-static const struct i915_power_well_ops chv_dpio_cmn_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = chv_dpio_cmn_power_well_enable,
-	.disable = chv_dpio_cmn_power_well_disable,
-	.is_enabled = vlv_power_well_enabled,
-};
-
 static const struct i915_power_well_desc i9xx_always_on_power_well[] = {
 	{
 		.name = "always-on",
@@ -3074,13 +1484,6 @@ static const struct i915_power_well_desc i9xx_always_on_power_well[] = {
 	},
 };
 
-static const struct i915_power_well_ops i830_pipes_power_well_ops = {
-	.sync_hw = i830_pipes_power_well_sync_hw,
-	.enable = i830_pipes_power_well_enable,
-	.disable = i830_pipes_power_well_disable,
-	.is_enabled = i830_pipes_power_well_enabled,
-};
-
 static const struct i915_power_well_desc i830_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3097,35 +1500,6 @@ static const struct i915_power_well_desc i830_power_wells[] = {
 	},
 };
 
-static const struct i915_power_well_regs hsw_power_well_regs = {
-	.bios	= HSW_PWR_WELL_CTL1,
-	.driver	= HSW_PWR_WELL_CTL2,
-	.kvmr	= HSW_PWR_WELL_CTL3,
-	.debug	= HSW_PWR_WELL_CTL4,
-};
-
-static const struct i915_power_well_ops hsw_power_well_ops = {
-	.regs = &hsw_power_well_regs,
-	.sync_hw = hsw_power_well_sync_hw,
-	.enable = hsw_power_well_enable,
-	.disable = hsw_power_well_disable,
-	.is_enabled = hsw_power_well_enabled,
-};
-
-static const struct i915_power_well_ops gen9_dc_off_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = gen9_dc_off_power_well_enable,
-	.disable = gen9_dc_off_power_well_disable,
-	.is_enabled = gen9_dc_off_power_well_enabled,
-};
-
-static const struct i915_power_well_ops bxt_dpio_cmn_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = bxt_dpio_cmn_power_well_enable,
-	.disable = bxt_dpio_cmn_power_well_disable,
-	.is_enabled = bxt_dpio_cmn_power_well_enabled,
-};
-
 static const struct i915_power_well_desc hsw_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3167,27 +1541,6 @@ static const struct i915_power_well_desc bdw_power_wells[] = {
 	},
 };
 
-static const struct i915_power_well_ops vlv_display_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = vlv_display_power_well_enable,
-	.disable = vlv_display_power_well_disable,
-	.is_enabled = vlv_power_well_enabled,
-};
-
-static const struct i915_power_well_ops vlv_dpio_cmn_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = vlv_dpio_cmn_power_well_enable,
-	.disable = vlv_dpio_cmn_power_well_disable,
-	.is_enabled = vlv_power_well_enabled,
-};
-
-static const struct i915_power_well_ops vlv_dpio_power_well_ops = {
-	.sync_hw = i9xx_power_well_sync_hw_noop,
-	.enable = vlv_power_well_enable,
-	.disable = vlv_power_well_disable,
-	.is_enabled = vlv_power_well_enabled,
-};
-
 static const struct i915_power_well_desc vlv_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3569,34 +1922,6 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 	},
 };
 
-static const struct i915_power_well_regs icl_aux_power_well_regs = {
-	.bios	= ICL_PWR_WELL_CTL_AUX1,
-	.driver	= ICL_PWR_WELL_CTL_AUX2,
-	.debug	= ICL_PWR_WELL_CTL_AUX4,
-};
-
-static const struct i915_power_well_ops icl_aux_power_well_ops = {
-	.regs = &icl_aux_power_well_regs,
-	.sync_hw = hsw_power_well_sync_hw,
-	.enable = icl_aux_power_well_enable,
-	.disable = icl_aux_power_well_disable,
-	.is_enabled = hsw_power_well_enabled,
-};
-
-static const struct i915_power_well_regs icl_ddi_power_well_regs = {
-	.bios	= ICL_PWR_WELL_CTL_DDI1,
-	.driver	= ICL_PWR_WELL_CTL_DDI2,
-	.debug	= ICL_PWR_WELL_CTL_DDI4,
-};
-
-static const struct i915_power_well_ops icl_ddi_power_well_ops = {
-	.regs = &icl_ddi_power_well_regs,
-	.sync_hw = hsw_power_well_sync_hw,
-	.enable = hsw_power_well_enable,
-	.disable = hsw_power_well_disable,
-	.is_enabled = hsw_power_well_enabled,
-};
-
 static const struct i915_power_well_desc icl_power_wells[] = {
 	{
 		.name = "always-on",
@@ -3810,90 +2135,6 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 	},
 };
 
-static void
-tgl_tc_cold_request(struct drm_i915_private *i915, bool block)
-{
-	u8 tries = 0;
-	int ret;
-
-	while (1) {
-		u32 low_val;
-		u32 high_val = 0;
-
-		if (block)
-			low_val = TGL_PCODE_EXIT_TCCOLD_DATA_L_BLOCK_REQ;
-		else
-			low_val = TGL_PCODE_EXIT_TCCOLD_DATA_L_UNBLOCK_REQ;
-
-		/*
-		 * Spec states that we should timeout the request after 200us
-		 * but the function below will timeout after 500us
-		 */
-		ret = snb_pcode_read(i915, TGL_PCODE_TCCOLD, &low_val, &high_val);
-		if (ret == 0) {
-			if (block &&
-			    (low_val & TGL_PCODE_EXIT_TCCOLD_DATA_L_EXIT_FAILED))
-				ret = -EIO;
-			else
-				break;
-		}
-
-		if (++tries == 3)
-			break;
-
-		msleep(1);
-	}
-
-	if (ret)
-		drm_err(&i915->drm, "TC cold %sblock failed\n",
-			block ? "" : "un");
-	else
-		drm_dbg_kms(&i915->drm, "TC cold %sblock succeeded\n",
-			    block ? "" : "un");
-}
-
-static void
-tgl_tc_cold_off_power_well_enable(struct drm_i915_private *i915,
-				  struct i915_power_well *power_well)
-{
-	tgl_tc_cold_request(i915, true);
-}
-
-static void
-tgl_tc_cold_off_power_well_disable(struct drm_i915_private *i915,
-				   struct i915_power_well *power_well)
-{
-	tgl_tc_cold_request(i915, false);
-}
-
-static void
-tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private *i915,
-				   struct i915_power_well *power_well)
-{
-	if (intel_power_well_refcount(power_well) > 0)
-		tgl_tc_cold_off_power_well_enable(i915, power_well);
-	else
-		tgl_tc_cold_off_power_well_disable(i915, power_well);
-}
-
-static bool
-tgl_tc_cold_off_power_well_is_enabled(struct drm_i915_private *dev_priv,
-				      struct i915_power_well *power_well)
-{
-	/*
-	 * Not the correctly implementation but there is no way to just read it
-	 * from PCODE, so returning count to avoid state mismatch errors
-	 */
-	return intel_power_well_refcount(power_well);
-}
-
-static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
-	.sync_hw = tgl_tc_cold_off_power_well_sync_hw,
-	.enable = tgl_tc_cold_off_power_well_enable,
-	.disable = tgl_tc_cold_off_power_well_disable,
-	.is_enabled = tgl_tc_cold_off_power_well_is_enabled,
-};
-
 static const struct i915_power_well_desc tgl_power_wells[] = {
 	{
 		.name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power_well.c +1817 -0

1,170 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.h +22 -35

57 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.27.0

Part of the diff is not shown here. View the raw message.

#13 lore raw

Re: [Intel-gfx] [PATCH v2 09/26] drm/i915: Move per-platform power well hooks to intel_display_power_well.c

Quoted 3 lines · Imre Deak

Move the implementation of platform specific power well hooks to intel_display_power_well.c, to reduce the clutter in intel_display_power.c.

In these hooks you are also moving some of the mutex_locking/unlocking into intel_display_power_well.c. Maybe some mention here which functions are expected being called with powerdomain mutex held?

One inline comment below.

drivers/gpu/drm/i915/display/intel_display_power_well.c

Quoted 3,939 lines

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 1759 -------------
---
 .../i915/display/intel_display_power_well.c   | 1817
+++++++++++++++++
 .../i915/display/intel_display_power_well.h   |   57 +-
 3 files changed, 1839 insertions(+), 1794 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
index 61eaacdac5af2..3414013e7f449 100644
@@ -7,23 +7,15 @@
 #include "i915_irq.h"
 #include "intel_cdclk.h"
 #include "intel_combo_phy.h"
-#include "intel_combo_phy_regs.h"
-#include "intel_crt.h"
 #include "intel_de.h"
 #include "intel_display_power.h"
 #include "intel_display_power_well.h"
 #include "intel_display_types.h"
 #include "intel_dmc.h"
-#include "intel_dpio_phy.h"
-#include "intel_dpll.h"
-#include "intel_hotplug.h"
 #include "intel_pch_refclk.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
-#include "intel_pps.h"
 #include "intel_snps_phy.h"
-#include "intel_tc.h"
-#include "intel_vga.h"
 #include "vlv_sideband.h"
 
 const char *
@@ -232,604 +224,6 @@ bool intel_display_power_is_enabled(struct
 drm_i915_private *dev_priv,
 	return ret;
 }
 
-/*
- * Starting with Haswell, we have a "Power Down Well" that can be

turned off
- * when not needed anymore. We have 4 registers that can request the power well
- * to be enabled, and it will only be disabled if none of the registers is
- * requesting it to be enabled.
- */
-static void hsw_power_well_post_enable(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-				       u8 irq_pipe_mask, bool has_vga)
-{
-	if (has_vga)
-		intel_vga_reset_io_mem(dev_priv);
-
-	if (irq_pipe_mask)
-		gen8_irq_power_well_post_enable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void hsw_power_well_pre_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-				       u8 irq_pipe_mask)
-{
-	if (irq_pipe_mask)
-		gen8_irq_power_well_pre_disable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-}
-
-#define ICL_AUX_PW_TO_CH(pw_idx)	\
-	((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
-
-#define ICL_TBT_AUX_PW_TO_CH(pw_idx)	\
-	((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
-
-static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-{
-	int pw_idx = power_well->desc->hsw.idx;
-
-	return power_well->desc->hsw.is_tc_tbt ?

ICL_TBT_AUX_PW_TO_CH(pw_idx) :

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-						 ICL_AUX_PW_TO_CH(pw_id

x);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -31
-}
-
-static struct intel_digital_port *
-aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
-		       enum aux_ch aux_ch)
-{
-	struct intel_digital_port *dig_port = NULL;
-	struct intel_encoder *encoder;
-
-	for_each_intel_encoder(&dev_priv->drm, encoder) {
-		/* We'll check the MST primary port */
-		if (encoder->type == INTEL_OUTPUT_DP_MST)
-			continue;
-
-		dig_port = enc_to_dig_port(encoder);
-		if (!dig_port)
-			continue;
-
-		if (dig_port->aux_ch != aux_ch) {
-			dig_port = NULL;
-			continue;
-		}
-
-		break;
-	}
-
-	return dig_port;
-}
-
-static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
-				  const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-{
-	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-	struct intel_digital_port *dig_port =

aux_ch_to_digital_port(i915, aux_ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-	return intel_port_to_phy(i915, dig_port->base.port);
-}
-
-static void hsw_wait_for_power_well_enable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					   struct i915_power_well

*power_well,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-					   bool timeout_expected)
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-	int pw_idx = power_well->desc->hsw.idx;
-	int enable_delay = power_well->desc->hsw.fixed_enable_delay;
-
-	/*
-	 * For some power wells we're not supposed to watch the status

bit for

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-	 * an ack, but rather just wait a fixed amount of time and then
-	 * proceed.  This is only used on DG2.
-	 */
-	if (IS_DG2(dev_priv) && enable_delay) {
-		usleep_range(enable_delay, 2 * enable_delay);
-		return;
-	}
-
-	/* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us.

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-	if (intel_de_wait_for_set(dev_priv, regs->driver,
-				  HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
-		drm_dbg_kms(&dev_priv->drm, "%s power well enable

timeout\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-			    intel_power_well_name(power_well));
-
-		drm_WARN_ON(&dev_priv->drm, !timeout_expected);
-
-	}
-}
-
-static u32 hsw_power_well_requesters(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-				     const struct i915_power_well_regs

*regs,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-				     int pw_idx)
-{
-	u32 req_mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
-	u32 ret;
-
-	ret = intel_de_read(dev_priv, regs->bios) & req_mask ? 1 : 0;
-	ret |= intel_de_read(dev_priv, regs->driver) & req_mask ? 2 :

0;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-	if (regs->kvmr.reg)
-		ret |= intel_de_read(dev_priv, regs->kvmr) & req_mask ?

4 : 0;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-	ret |= intel_de_read(dev_priv, regs->debug) & req_mask ? 8 : 0;
-
-	return ret;
-}
-
-static void hsw_wait_for_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					    struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-	int pw_idx = power_well->desc->hsw.idx;
-	bool disabled;
-	u32 reqs;
-
-	/*
-	 * Bspec doesn't require waiting for PWs to get disabled, but

still do

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-	 * this for paranoia. The known cases where a PW will be forced

on:

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-	 * - a KVMR request on any power well via the KVMR request

register

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-	 * - a DMC request on PW1 and MISC_IO power wells via the BIOS

and

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-	 *   DEBUG request registers
-	 * Skip the wait in case any of the request bits are set and

print a

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-	 * diagnostic message.
-	 */
-	wait_for((disabled = !(intel_de_read(dev_priv, regs->driver) &
-			       HSW_PWR_WELL_CTL_STATE(pw_idx))) ||
-		 (reqs = hsw_power_well_requesters(dev_priv, regs,

pw_idx)), 1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-	if (disabled)
-		return;
-
-	drm_dbg_kms(&dev_priv->drm,
-		    "%s forced on (bios:%d driver:%d kvmr:%d

debug:%d)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-		    intel_power_well_name(power_well),
-		    !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs &

8));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void gen9_wait_for_power_well_fuses(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-					   enum skl_power_gate pg)
-{
-	/* Timeout 5us for PG#0, for other PGs 1us */
-	drm_WARN_ON(&dev_priv->drm,
-		    intel_de_wait_for_set(dev_priv, SKL_FUSE_STATUS,
-					  SKL_FUSE_PG_DIST_STATUS(pg),

1));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-}
-
-static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
-				  struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 val;
-
-	if (power_well->desc->hsw.has_fuses) {
-		enum skl_power_gate pg;
-
-		pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-						 SKL_PW_CTL_IDX_TO_PG(p

w_idx);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-
-		/* Wa_16013190616:adlp */
-		if (IS_ALDERLAKE_P(dev_priv) && pg == SKL_PG1)
-			intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, 0,

DISABLE_FLR_SRC);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-		/*
-		 * For PW1 we have to wait both for the PW0/PG0 fuse

state

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-		 * before enabling the power well and PW1/PG1's own

fuse

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-		 * state after the enabling. For all other power wells

with

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-		 * fuses we only have to wait for that PW/PG's fuse

state

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-		 * after the enabling.
-		 */
-		if (pg == SKL_PG1)
-			gen9_wait_for_power_well_fuses(dev_priv,

SKL_PG0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12
-	}
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-	if (power_well->desc->hsw.has_fuses) {
-		enum skl_power_gate pg;
-
-		pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-						 SKL_PW_CTL_IDX_TO_PG(p

w_idx);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-		gen9_wait_for_power_well_fuses(dev_priv, pg);
-	}
-
-	hsw_power_well_post_enable(dev_priv,
-				   power_well->desc->hsw.irq_pipe_mask,
-				   power_well->desc->hsw.has_vga);
-}
-
-static void hsw_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-				   struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 val;
-
-	hsw_power_well_pre_disable(dev_priv,
-				   power_well->desc-
Quoted 1 line

hsw.irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-	hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-static void
-icl_combo_phy_aux_power_well_enable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-				    struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20
-	int pw_idx = power_well->desc->hsw.idx;
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-	u32 val;
-
-	drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	if (DISPLAY_VER(dev_priv) < 12) {
-		val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-		intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-			       val | ICL_LANE_ENABLE_AUX);
-	}
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-	/* Display WA #1178: icl */
-	if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <=

ICL_PW_CTL_IDX_AUX_B &&

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-	    !intel_bios_is_port_edp(dev_priv, (enum port)phy)) {
-		val = intel_de_read(dev_priv,

ICL_AUX_ANAOVRD1(pw_idx));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-		val |= ICL_AUX_ANAOVRD1_ENABLE |

ICL_AUX_ANAOVRD1_LDO_BYPASS;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-		intel_de_write(dev_priv, ICL_AUX_ANAOVRD1(pw_idx),

val);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-	}
-}
-
-static void
-icl_combo_phy_aux_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-				     struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20
-	int pw_idx = power_well->desc->hsw.idx;
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-	u32 val;
-
-	drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-	val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-	intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-		       val & ~ICL_LANE_ENABLE_AUX);
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-	hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					struct i915_power_well

*power_well,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					struct intel_digital_port

*dig_port)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-	if (drm_WARN_ON(&dev_priv->drm, !dig_port))
-		return;
-
-	if (DISPLAY_VER(dev_priv) == 11 &&

intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-		return;
-
-	drm_WARN_ON(&dev_priv->drm, !intel_tc_port_ref_held(dig_port));
-}
-
-#else
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					struct i915_power_well

*power_well,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					struct intel_digital_port

*dig_port)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-{
-}
-
-#endif
-
-#define TGL_AUX_PW_TO_TC_PORT(pw_idx)	((pw_idx) -

TGL_PW_CTL_IDX_AUX_TC1)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-
-static void icl_tc_cold_exit(struct drm_i915_private *i915)
-{
-	int ret, tries = 0;
-
-	while (1) {
-		ret = snb_pcode_write_timeout(i915,

ICL_PCODE_EXIT_TCCOLD, 0,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-					      250, 1);
-		if (ret != -EAGAIN || ++tries == 3)
-			break;
-		msleep(1);
-	}
-
-	/* Spec states that TC cold exit can take up to 1ms to complete

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-	if (!ret)
-		msleep(1);
-
-	/* TODO: turn failure into a error as soon i915 CI updates ICL

IFWI */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-	drm_dbg_kms(&i915->drm, "TC cold block %s\n", ret ? "failed" :
-		    "succeeded");
-}
-
-static void
-icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
-				 struct i915_power_well *power_well)
-{
-	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-	struct intel_digital_port *dig_port =

aux_ch_to_digital_port(dev_priv, aux_ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-	const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15
-	bool is_tbt = power_well->desc->hsw.is_tc_tbt;
-	bool timeout_expected;
-	u32 val;
-
-	icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
-
-	val = intel_de_read(dev_priv, DP_AUX_CH_CTL(aux_ch));
-	val &= ~DP_AUX_CH_CTL_TBT_IO;
-	if (is_tbt)
-		val |= DP_AUX_CH_CTL_TBT_IO;
-	intel_de_write(dev_priv, DP_AUX_CH_CTL(aux_ch), val);
-
-	val = intel_de_read(dev_priv, regs->driver);
-	intel_de_write(dev_priv, regs->driver,
-		       val | HSW_PWR_WELL_CTL_REQ(power_well->desc-
Quoted 1 line

hsw.idx));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-
-	/*
-	 * An AUX timeout is expected if the TBT DP tunnel is down,
-	 * or need to enable AUX on a legacy TypeC port as part of the

TC-cold

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-	 * exit sequence.
-	 */
-	timeout_expected = is_tbt ||

intel_tc_cold_requires_aux_pw(dig_port);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-	if (DISPLAY_VER(dev_priv) == 11 &&

intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-		icl_tc_cold_exit(dev_priv);
-
-	hsw_wait_for_power_well_enable(dev_priv, power_well,

timeout_expected);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-	if (DISPLAY_VER(dev_priv) >= 12 && !is_tbt) {
-		enum tc_port tc_port;
-
-		tc_port = TGL_AUX_PW_TO_TC_PORT(power_well->desc-

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-		intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
-			       HIP_INDEX_VAL(tc_port, 0x2));
-
-		if (intel_de_wait_for_set(dev_priv,

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
-					  DKL_CMN_UC_DW27_UC_HEALTH,

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13
-			drm_warn(&dev_priv->drm,
-				 "Timeout waiting TC uC health\n");
-	}
-}
-
-static void
-icl_aux_power_well_enable(struct drm_i915_private *dev_priv,
-			  struct i915_power_well *power_well)
-{
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-	if (intel_phy_is_tc(dev_priv, phy))
-		return icl_tc_phy_aux_power_well_enable(dev_priv,

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -18
-	else if (IS_ICELAKE(dev_priv))
-		return icl_combo_phy_aux_power_well_enable(dev_priv,
-							   power_well);
-	else
-		return hsw_power_well_enable(dev_priv, power_well);
-}
-
-static void
-icl_aux_power_well_disable(struct drm_i915_private *dev_priv,
-			   struct i915_power_well *power_well)
-{
-	enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-	if (intel_phy_is_tc(dev_priv, phy))
-		return hsw_power_well_disable(dev_priv, power_well);
-	else if (IS_ICELAKE(dev_priv))
-		return icl_combo_phy_aux_power_well_disable(dev_priv,
-							    power_well)

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-	else
-		return hsw_power_well_disable(dev_priv, power_well);
-}
-
-/*
- * We should only use the power well if we explicitly asked the

7 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-				   struct i915_power_well *power_well)
-{
-	const struct i915_power_well_regs *regs = power_well->desc-

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-	enum i915_power_well_id id = power_well->desc->id;
-	int pw_idx = power_well->desc->hsw.idx;
-	u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
-		   HSW_PWR_WELL_CTL_STATE(pw_idx);
-	u32 val;
-
-	val = intel_de_read(dev_priv, regs->driver);
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -47

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

26 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -64

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
@@ -958,912 +293,8 @@ void

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -18

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -30

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -25

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -39

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -21

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -25

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -30

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

2 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

drivers/gpu/drm/i915/display/intel_display_power.c +0 -29

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -21

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -28

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -45

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -1

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/i915/display/intel_display_power_well.c +28 -0
index 2a0fb9d9c60f2..a92bb807f1972 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

9 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

7 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +54 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

24 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +36 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +18 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +30 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +27 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +21 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +30 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

459 lines not shown · raw message

Parts of this message are not shown here. View the raw message.

author
#14 lore raw

Re: [Intel-gfx] [PATCH v2 09/26] drm/i915: Move per-platform power well hooks to intel_display_power_well.c

Quoted 8 lines · Jouni
Quoted 3 lines · Imre Deak

Move the implementation of platform specific power well hooks to intel_display_power_well.c, to reduce the clutter in intel_display_power.c.

In these hooks you are also moving some of the mutex_locking/unlocking into intel_display_power_well.c. Maybe some mention here which functions are expected being called with powerdomain mutex held?

Yes, chv_phy_powergate_ch/lanes() which need to access a PHY register, used both for toggling power wells and for power gating unused PHY lanes. Will add a comment about this.

Also forgot to move the the declaration for these to intel_display_power_well.h, will fix that up.

Quoted 3,932 lines

One inline comment below.

Quoted 3,930 lines

No functional change.

---
 .../drm/i915/display/intel_display_power.c    | 1759 -------------
---
 .../i915/display/intel_display_power_well.c   | 1817
+++++++++++++++++
 .../i915/display/intel_display_power_well.h   |   57 +-
 3 files changed, 1839 insertions(+), 1794 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
index 61eaacdac5af2..3414013e7f449 100644
@@ -7,23 +7,15 @@
 #include "i915_irq.h"
 #include "intel_cdclk.h"
 #include "intel_combo_phy.h"
-#include "intel_combo_phy_regs.h"
-#include "intel_crt.h"
 #include "intel_de.h"
 #include "intel_display_power.h"
 #include "intel_display_power_well.h"
 #include "intel_display_types.h"
 #include "intel_dmc.h"
-#include "intel_dpio_phy.h"
-#include "intel_dpll.h"
-#include "intel_hotplug.h"
 #include "intel_pch_refclk.h"
 #include "intel_pcode.h"
 #include "intel_pm.h"
-#include "intel_pps.h"
 #include "intel_snps_phy.h"
-#include "intel_tc.h"
-#include "intel_vga.h"
 #include "vlv_sideband.h"
 
 const char *
@@ -232,604 +224,6 @@ bool intel_display_power_is_enabled(struct
 drm_i915_private *dev_priv,
      return ret;
 }
 
-/*
- * Starting with Haswell, we have a "Power Down Well" that can be

turned off
- * when not needed anymore. We have 4 registers that can request the power well
- * to be enabled, and it will only be disabled if none of the registers is
- * requesting it to be enabled.
- */
-static void hsw_power_well_post_enable(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-                                    u8 irq_pipe_mask, bool has_vga)
-{
-     if (has_vga)
-             intel_vga_reset_io_mem(dev_priv);
-
-     if (irq_pipe_mask)
-             gen8_irq_power_well_post_enable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void hsw_power_well_pre_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-                                    u8 irq_pipe_mask)
-{
-     if (irq_pipe_mask)
-             gen8_irq_power_well_pre_disable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-}
-
-#define ICL_AUX_PW_TO_CH(pw_idx)     \
-     ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
-
-#define ICL_TBT_AUX_PW_TO_CH(pw_idx) \
-     ((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
-
-static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-{
-     int pw_idx = power_well->desc->hsw.idx;
-
-     return power_well->desc->hsw.is_tc_tbt ?

ICL_TBT_AUX_PW_TO_CH(pw_idx) :
- ICL_AUX_PW_TO_CH(pw_id
x);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -31
-}
-
-static struct intel_digital_port *
-aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
-                    enum aux_ch aux_ch)
-{
-     struct intel_digital_port *dig_port = NULL;
-     struct intel_encoder *encoder;
-
-     for_each_intel_encoder(&dev_priv->drm, encoder) {
-             /* We'll check the MST primary port */
-             if (encoder->type == INTEL_OUTPUT_DP_MST)
-                     continue;
-
-             dig_port = enc_to_dig_port(encoder);
-             if (!dig_port)
-                     continue;
-
-             if (dig_port->aux_ch != aux_ch) {
-                     dig_port = NULL;
-                     continue;
-             }
-
-             break;
-     }
-
-     return dig_port;
-}
-
-static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
-                               const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-{
-     enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-     struct intel_digital_port *dig_port =

aux_ch_to_digital_port(i915, aux_ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-     return intel_port_to_phy(i915, dig_port->base.port);
-}
-
-static void hsw_wait_for_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                                        bool timeout_expected)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     int pw_idx = power_well->desc->hsw.idx;
-     int enable_delay = power_well->desc->hsw.fixed_enable_delay;
-
-     /*
-      * For some power wells we're not supposed to watch the status

bit for

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-      * an ack, but rather just wait a fixed amount of time and then
-      * proceed.  This is only used on DG2.
-      */
-     if (IS_DG2(dev_priv) && enable_delay) {
-             usleep_range(enable_delay, 2 * enable_delay);
-             return;
-     }
-
-     /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us.

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-     if (intel_de_wait_for_set(dev_priv, regs->driver,
-                               HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
-             drm_dbg_kms(&dev_priv->drm, "%s power well enable

timeout\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-                         intel_power_well_name(power_well));
-
-             drm_WARN_ON(&dev_priv->drm, !timeout_expected);
-
-     }
-}
-
-static u32 hsw_power_well_requesters(struct drm_i915_private

*dev_priv,
- const struct i915_power_well_regs
*regs,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-                                  int pw_idx)
-{
-     u32 req_mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
-     u32 ret;
-
-     ret = intel_de_read(dev_priv, regs->bios) & req_mask ? 1 : 0;
-     ret |= intel_de_read(dev_priv, regs->driver) & req_mask ? 2 :

0;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     if (regs->kvmr.reg)
-             ret |= intel_de_read(dev_priv, regs->kvmr) & req_mask ?

4 : 0;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     ret |= intel_de_read(dev_priv, regs->debug) & req_mask ? 8 : 0;
-
-     return ret;
-}
-
-static void hsw_wait_for_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     int pw_idx = power_well->desc->hsw.idx;
-     bool disabled;
-     u32 reqs;
-
-     /*
-      * Bspec doesn't require waiting for PWs to get disabled, but

still do
- * this for paranoia. The known cases where a PW will be forced
on:
- * - a KVMR request on any power well via the KVMR request
register
- * - a DMC request on PW1 and MISC_IO power wells via the BIOS
and

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-      *   DEBUG request registers
-      * Skip the wait in case any of the request bits are set and

print a

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-      * diagnostic message.
-      */
-     wait_for((disabled = !(intel_de_read(dev_priv, regs->driver) &
-                            HSW_PWR_WELL_CTL_STATE(pw_idx))) ||
-              (reqs = hsw_power_well_requesters(dev_priv, regs,

pw_idx)), 1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     if (disabled)
-             return;
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "%s forced on (bios:%d driver:%d kvmr:%d

debug:%d)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-                 intel_power_well_name(power_well),
-                 !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs &

8));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void gen9_wait_for_power_well_fuses(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-                                        enum skl_power_gate pg)
-{
-     /* Timeout 5us for PG#0, for other PGs 1us */
-     drm_WARN_ON(&dev_priv->drm,
-                 intel_de_wait_for_set(dev_priv, SKL_FUSE_STATUS,
-                                       SKL_FUSE_PG_DIST_STATUS(pg),

1));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-}
-
-static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
-                               struct i915_power_well *power_well)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-     int pw_idx = power_well->desc->hsw.idx;
-     u32 val;
-
-     if (power_well->desc->hsw.has_fuses) {
-             enum skl_power_gate pg;
-
-             pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :
- SKL_PW_CTL_IDX_TO_PG(p
w_idx);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-
-             /* Wa_16013190616:adlp */
-             if (IS_ALDERLAKE_P(dev_priv) && pg == SKL_PG1)
-                     intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, 0,

DISABLE_FLR_SRC);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             /*
-              * For PW1 we have to wait both for the PW0/PG0 fuse

state
- * before enabling the power well and PW1/PG1's own
fuse
- * state after the enabling. For all other power wells
with
- * fuses we only have to wait for that PW/PG's fuse
state

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-              * after the enabling.
-              */
-             if (pg == SKL_PG1)
-                     gen9_wait_for_power_well_fuses(dev_priv,

SKL_PG0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12
-     }
-
-     val = intel_de_read(dev_priv, regs->driver);
-     intel_de_write(dev_priv, regs->driver,
-                    val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-     hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-     if (power_well->desc->hsw.has_fuses) {
-             enum skl_power_gate pg;
-
-             pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :
- SKL_PW_CTL_IDX_TO_PG(p
w_idx);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-             gen9_wait_for_power_well_fuses(dev_priv, pg);
-     }
-
-     hsw_power_well_post_enable(dev_priv,
-                                power_well->desc->hsw.irq_pipe_mask,
-                                power_well->desc->hsw.has_vga);
-}
-
-static void hsw_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                                struct i915_power_well *power_well)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     int pw_idx = power_well->desc->hsw.idx;
-     u32 val;
-
-     hsw_power_well_pre_disable(dev_priv,
-                                power_well->desc-
Quoted 1 line

hsw.irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-
-     val = intel_de_read(dev_priv, regs->driver);
-     intel_de_write(dev_priv, regs->driver,
-                    val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-     hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-static void
-icl_combo_phy_aux_power_well_enable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                                 struct i915_power_well *power_well)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20
-     int pw_idx = power_well->desc->hsw.idx;
-     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-     u32 val;
-
-     drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-     val = intel_de_read(dev_priv, regs->driver);
-     intel_de_write(dev_priv, regs->driver,
-                    val | HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-     if (DISPLAY_VER(dev_priv) < 12) {
-             val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-             intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-                            val | ICL_LANE_ENABLE_AUX);
-     }
-
-     hsw_wait_for_power_well_enable(dev_priv, power_well, false);
-
-     /* Display WA #1178: icl */
-     if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <=

ICL_PW_CTL_IDX_AUX_B &&

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-         !intel_bios_is_port_edp(dev_priv, (enum port)phy)) {
-             val = intel_de_read(dev_priv,

ICL_AUX_ANAOVRD1(pw_idx));
- val |= ICL_AUX_ANAOVRD1_ENABLE |
ICL_AUX_ANAOVRD1_LDO_BYPASS;
- intel_de_write(dev_priv, ICL_AUX_ANAOVRD1(pw_idx),
val);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     }
-}
-
-static void
-icl_combo_phy_aux_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20
-     int pw_idx = power_well->desc->hsw.idx;
-     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-     u32 val;
-
-     drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
-
-     val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
-     intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
-                    val & ~ICL_LANE_ENABLE_AUX);
-
-     val = intel_de_read(dev_priv, regs->driver);
-     intel_de_write(dev_priv, regs->driver,
-                    val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
-
-     hsw_wait_for_power_well_disable(dev_priv, power_well);
-}
-
-#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well,
- struct intel_digital_port
*dig_port)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     if (drm_WARN_ON(&dev_priv->drm, !dig_port))
-             return;
-
-     if (DISPLAY_VER(dev_priv) == 11 &&

intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-             return;
-
-     drm_WARN_ON(&dev_priv->drm, !intel_tc_port_ref_held(dig_port));
-}
-
-#else
-
-static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well,
- struct intel_digital_port
*dig_port)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-{
-}
-
-#endif
-
-#define TGL_AUX_PW_TO_TC_PORT(pw_idx)        ((pw_idx) -

TGL_PW_CTL_IDX_AUX_TC1)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-
-static void icl_tc_cold_exit(struct drm_i915_private *i915)
-{
-     int ret, tries = 0;
-
-     while (1) {
-             ret = snb_pcode_write_timeout(i915,

ICL_PCODE_EXIT_TCCOLD, 0,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-                                           250, 1);
-             if (ret != -EAGAIN || ++tries == 3)
-                     break;
-             msleep(1);
-     }
-
-     /* Spec states that TC cold exit can take up to 1ms to complete

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-     if (!ret)
-             msleep(1);
-
-     /* TODO: turn failure into a error as soon i915 CI updates ICL

IFWI */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-     drm_dbg_kms(&i915->drm, "TC cold block %s\n", ret ? "failed" :
-                 "succeeded");
-}
-
-static void
-icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
-                              struct i915_power_well *power_well)
-{
-     enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
-     struct intel_digital_port *dig_port =

aux_ch_to_digital_port(dev_priv, aux_ch);
- const struct i915_power_well_regs *regs = power_well->desc-

Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15
-     bool is_tbt = power_well->desc->hsw.is_tc_tbt;
-     bool timeout_expected;
-     u32 val;
-
-     icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
-
-     val = intel_de_read(dev_priv, DP_AUX_CH_CTL(aux_ch));
-     val &= ~DP_AUX_CH_CTL_TBT_IO;
-     if (is_tbt)
-             val |= DP_AUX_CH_CTL_TBT_IO;
-     intel_de_write(dev_priv, DP_AUX_CH_CTL(aux_ch), val);
-
-     val = intel_de_read(dev_priv, regs->driver);
-     intel_de_write(dev_priv, regs->driver,
-                    val | HSW_PWR_WELL_CTL_REQ(power_well->desc-
Quoted 1 line

hsw.idx));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-
-     /*
-      * An AUX timeout is expected if the TBT DP tunnel is down,
-      * or need to enable AUX on a legacy TypeC port as part of the

TC-cold

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-      * exit sequence.
-      */
-     timeout_expected = is_tbt ||

intel_tc_cold_requires_aux_pw(dig_port);
- if (DISPLAY_VER(dev_priv) == 11 &&
intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-             icl_tc_cold_exit(dev_priv);
-
-     hsw_wait_for_power_well_enable(dev_priv, power_well,

timeout_expected);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-     if (DISPLAY_VER(dev_priv) >= 12 && !is_tbt) {
-             enum tc_port tc_port;
-
-             tc_port = TGL_AUX_PW_TO_TC_PORT(power_well->desc-
Quoted 1 line

hsw.idx);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-             intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
-                            HIP_INDEX_VAL(tc_port, 0x2));
-
-             if (intel_de_wait_for_set(dev_priv,

DKL_CMN_UC_DW_27(tc_port),
- DKL_CMN_UC_DW27_UC_HEALTH,
1))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13
-                     drm_warn(&dev_priv->drm,
-                              "Timeout waiting TC uC health\n");
-     }
-}
-
-static void
-icl_aux_power_well_enable(struct drm_i915_private *dev_priv,
-                       struct i915_power_well *power_well)
-{
-     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-     if (intel_phy_is_tc(dev_priv, phy))
-             return icl_tc_phy_aux_power_well_enable(dev_priv,

power_well);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -18
-     else if (IS_ICELAKE(dev_priv))
-             return icl_combo_phy_aux_power_well_enable(dev_priv,
-                                                        power_well);
-     else
-             return hsw_power_well_enable(dev_priv, power_well);
-}
-
-static void
-icl_aux_power_well_disable(struct drm_i915_private *dev_priv,
-                        struct i915_power_well *power_well)
-{
-     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
-
-     if (intel_phy_is_tc(dev_priv, phy))
-             return hsw_power_well_disable(dev_priv, power_well);
-     else if (IS_ICELAKE(dev_priv))
-             return icl_combo_phy_aux_power_well_disable(dev_priv,
-                                                         power_well)

;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     else
-             return hsw_power_well_disable(dev_priv, power_well);
-}
-
-/*
- * We should only use the power well if we explicitly asked the

hardware to
- * enable it, so check if it's enabled and also check if we've requested it to
- * be enabled.
- */
-static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                                struct i915_power_well *power_well)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-     enum i915_power_well_id id = power_well->desc->id;
-     int pw_idx = power_well->desc->hsw.idx;
-     u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
-                HSW_PWR_WELL_CTL_STATE(pw_idx);
-     u32 val;
-
-     val = intel_de_read(dev_priv, regs->driver);
-
-     /*
-      * On GEN9 big core due to a DMC bug the driver's request bits

for PW1
- * and the MISC_IO PW will be not restored, so check instead
for the
- * BIOS's own request bits, which are forced-on for these power
wells

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13
-      * when exiting DC5/6.
-      */
-     if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv) &&
-         (id == SKL_DISP_PW_1 || id == SKL_DISP_PW_MISC_IO))
-             val |= intel_de_read(dev_priv, regs->bios);
-
-     return (val & mask) == mask;
-}
-
-static void assert_can_enable_dc9(struct drm_i915_private *dev_priv)
-{
-     drm_WARN_ONCE(&dev_priv->drm,
-                   (intel_de_read(dev_priv, DC_STATE_EN) &

DC_STATE_EN_DC9),

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-                   "DC9 already programmed to be enabled.\n");
-     drm_WARN_ONCE(&dev_priv->drm,
-                   intel_de_read(dev_priv, DC_STATE_EN) &
-                   DC_STATE_EN_UPTO_DC5,
-                   "DC5 still not disabled to enable DC9.\n");
-     drm_WARN_ONCE(&dev_priv->drm,
-                   intel_de_read(dev_priv, HSW_PWR_WELL_CTL2) &
-                   HSW_PWR_WELL_CTL_REQ(SKL_PW_CTL_IDX_PW_2),
-                   "Power well 2 on.\n");
-     drm_WARN_ONCE(&dev_priv->drm, intel_irqs_enabled(dev_priv),
-                   "Interrupts not disabled yet.\n");
-
-      /*
-       * TODO: check for the following to verify the conditions to

enter DC9

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-       * state are satisfied:
-       * 1] Check relevant display engine registers to verify if

mode set

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-       * disable sequence was followed.
-       * 2] Check if display uninitialize sequence is initialized.
-       */
-}
-
-static void assert_can_disable_dc9(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-{
-     drm_WARN_ONCE(&dev_priv->drm, intel_irqs_enabled(dev_priv),
-                   "Interrupts not disabled yet.\n");
-     drm_WARN_ONCE(&dev_priv->drm,
-                   intel_de_read(dev_priv, DC_STATE_EN) &
-                   DC_STATE_EN_UPTO_DC5,
-                   "DC5 still not disabled.\n");
-
-      /*
-       * TODO: check for the following to verify DC9 state was

indeed

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-       * entered before programming to disable it:
-       * 1] Check relevant display engine registers to verify if

mode

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17
-       *  set disable sequence was followed.
-       * 2] Check if display uninitialize sequence is initialized.
-       */
-}
-
-static void gen9_write_dc_state(struct drm_i915_private *dev_priv,
-                             u32 state)
-{
-     int rewrites = 0;
-     int rereads = 0;
-     u32 v;
-
-     intel_de_write(dev_priv, DC_STATE_EN, state);
-
-     /* It has been observed that disabling the dc6 state sometimes
-      * doesn't stick and dmc keeps returning old value. Make sure
-      * the write really sticks enough times and also force rewrite

until

drivers/gpu/drm/i915/display/intel_display_power.c +0 -47
-      * we are confident that state is exactly what we want.
-      */
-     do  {
-             v = intel_de_read(dev_priv, DC_STATE_EN);
-
-             if (v != state) {
-                     intel_de_write(dev_priv, DC_STATE_EN, state);
-                     rewrites++;
-                     rereads = 0;
-             } else if (rereads++ > 5) {
-                     break;
-             }
-
-     } while (rewrites < 100);
-
-     if (v != state)
-             drm_err(&dev_priv->drm,
-                     "Writing dc state to 0x%x failed, now 0x%x\n",
-                     state, v);
-
-     /* Most of the times we need one retry, avoid spam */
-     if (rewrites > 1)
-             drm_dbg_kms(&dev_priv->drm,
-                         "Rewrote dc state to 0x%x %d times\n",
-                         state, rewrites);
-}
-
-static u32 gen9_dc_mask(struct drm_i915_private *dev_priv)
-{
-     u32 mask;
-
-     mask = DC_STATE_EN_UPTO_DC5;
-
-     if (DISPLAY_VER(dev_priv) >= 12)
-             mask |= DC_STATE_EN_DC3CO | DC_STATE_EN_UPTO_DC6
-                                       | DC_STATE_EN_DC9;
-     else if (DISPLAY_VER(dev_priv) == 11)
-             mask |= DC_STATE_EN_UPTO_DC6 | DC_STATE_EN_DC9;
-     else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
-             mask |= DC_STATE_EN_DC9;
-     else
-             mask |= DC_STATE_EN_UPTO_DC6;
-
-     return mask;
-}
-
-static void gen9_sanitize_dc_state(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-{
-     u32 val;
-
-     if (!HAS_DISPLAY(dev_priv))
-             return;
-
-     val = intel_de_read(dev_priv, DC_STATE_EN) &

gen9_dc_mask(dev_priv);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "Resetting DC state tracking from %02x to %02x\n",
-                 dev_priv->dmc.dc_state, val);
-     dev_priv->dmc.dc_state = val;
-}
-
-/**
- * gen9_set_dc_state - set target display C power state
- * @dev_priv: i915 device instance
- * @state: target DC power state
- * - DC_STATE_DISABLE
- * - DC_STATE_EN_UPTO_DC5
- * - DC_STATE_EN_UPTO_DC6
- * - DC_STATE_EN_DC9
- *
- * Signal to DMC firmware/HW the target DC power state passed in

@state.
- * DMC/HW can turn off individual display clocks and power rails when entering
- * a deeper DC power state (higher in number) and turns these back when exiting
- * that state to a shallower power state (lower in number). The HW will decide
- * when to actually enter a given state on an on-demand basis, for instance
- * depending on the active state of display pipes. The state of display
- * registers backed by affected power rails are saved/restored as needed.
- *
- * Based on the above enabling a deeper DC power state is asynchronous wrt.
- * enabling it. Disabling a deeper power state is synchronous: for instance
- * setting %DC_STATE_DISABLE won't complete until all HW resources are turned
- * back on and register state is restored. This is guaranteed by the MMIO write
- * to DC_STATE_EN blocking until the state is restored.
- */
-static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-{
-     u32 val;
-     u32 mask;
-
-     if (!HAS_DISPLAY(dev_priv))
-             return;
-
-     if (drm_WARN_ON_ONCE(&dev_priv->drm,
-                          state & ~dev_priv->dmc.allowed_dc_mask))
-             state &= dev_priv->dmc.allowed_dc_mask;
-
-     val = intel_de_read(dev_priv, DC_STATE_EN);
-     mask = gen9_dc_mask(dev_priv);
-     drm_dbg_kms(&dev_priv->drm, "Setting DC state from %02x to

%02x\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-                 val & mask, state);
-
-     /* Check if DMC is ignoring our DC state requests */
-     if ((val & mask) != dev_priv->dmc.dc_state)
-             drm_err(&dev_priv->drm, "DC state mismatch (0x%x ->

0x%x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -64
-                     dev_priv->dmc.dc_state, val & mask);
-
-     val &= ~mask;
-     val |= state;
-
-     gen9_write_dc_state(dev_priv, val);
-
-     dev_priv->dmc.dc_state = val & mask;
-}
-
 static u32
 sanitize_target_dc_state(struct drm_i915_private *dev_priv,
                       u32 target_dc_state)
@@ -855,65 +249,6 @@ sanitize_target_dc_state(struct drm_i915_private
 *dev_priv,
      return target_dc_state;
 }
 
-static void tgl_enable_dc3co(struct drm_i915_private *dev_priv)
-{
-     drm_dbg_kms(&dev_priv->drm, "Enabling DC3CO\n");
-     gen9_set_dc_state(dev_priv, DC_STATE_EN_DC3CO);
-}
-
-static void tgl_disable_dc3co(struct drm_i915_private *dev_priv)
-{
-     u32 val;
-
-     drm_dbg_kms(&dev_priv->drm, "Disabling DC3CO\n");
-     val = intel_de_read(dev_priv, DC_STATE_EN);
-     val &= ~DC_STATE_DC3CO_STATUS;
-     intel_de_write(dev_priv, DC_STATE_EN, val);
-     gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-     /*
-      * Delay of 200us DC3CO Exit time B.Spec 49196
-      */
-     usleep_range(200, 210);
-}
-
-static void bxt_enable_dc9(struct drm_i915_private *dev_priv)
-{
-     assert_can_enable_dc9(dev_priv);
-
-     drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
-     /*
-      * Power sequencer reset is not needed on
-      * platforms with South Display Engine on PCH,
-      * because PPS registers are always on.
-      */
-     if (!HAS_PCH_SPLIT(dev_priv))
-             intel_pps_reset_all(dev_priv);
-     gen9_set_dc_state(dev_priv, DC_STATE_EN_DC9);
-}
-
-static void bxt_disable_dc9(struct drm_i915_private *dev_priv)
-{
-     assert_can_disable_dc9(dev_priv);
-
-     drm_dbg_kms(&dev_priv->drm, "Disabling DC9\n");
-
-     gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-
-     intel_pps_unlock_regs_wa(dev_priv);
-}
-
-static void assert_dmc_loaded(struct drm_i915_private *dev_priv)
-{
-     drm_WARN_ONCE(&dev_priv->drm,
-                   !intel_de_read(dev_priv,
-                                  DMC_PROGRAM(dev_priv-
 >dmc.dmc_info[DMC_FW_MAIN].start_mmioaddr, 0)),
-                                  "DMC program storage start is
 NULL\n");
-     drm_WARN_ONCE(&dev_priv->drm, !intel_de_read(dev_priv,

DMC_SSP_BASE),

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-                   "DMC SSP Base Not fine\n");
-     drm_WARN_ONCE(&dev_priv->drm, !intel_de_read(dev_priv,

DMC_HTP_SKL),

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                   "DMC HTP Not fine\n");
-}
-
 /**
  * intel_display_power_set_target_dc_state - Set target dc state.
  * @dev_priv: i915 device
@@ -958,912 +293,8 @@ void

intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,

      mutex_unlock(&power_domains->lock);

}

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
-{
-     enum i915_power_well_id high_pg;
-
-     /* Power wells at this level and above must be disabled for DC5

entry */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-     if (DISPLAY_VER(dev_priv) == 12)
-             high_pg = ICL_DISP_PW_3;
-     else
-             high_pg = SKL_DISP_PW_2;
-
-     drm_WARN_ONCE(&dev_priv->drm,
-                   intel_display_power_well_is_enabled(dev_priv,

high_pg),
- "Power wells above platform's DC5 limit still
enabled.\n");

drivers/gpu/drm/i915/display/intel_display_power.c +0 -20
-
-     drm_WARN_ONCE(&dev_priv->drm,
-                   (intel_de_read(dev_priv, DC_STATE_EN) &
-                    DC_STATE_EN_UPTO_DC5),
-                   "DC5 already programmed to be enabled.\n");
-     assert_rpm_wakelock_held(&dev_priv->runtime_pm);
-
-     assert_dmc_loaded(dev_priv);
-}
-
-static void gen9_enable_dc5(struct drm_i915_private *dev_priv)
-{
-     assert_can_enable_dc5(dev_priv);
-
-     drm_dbg_kms(&dev_priv->drm, "Enabling DC5\n");
-
-     /* Wa Display #1183: skl,kbl,cfl */
-     if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv))
-             intel_de_write(dev_priv, GEN8_CHICKEN_DCPR_1,
-                            intel_de_read(dev_priv,

GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-
-     gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
-}
-
-static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
-{
-     drm_WARN_ONCE(&dev_priv->drm,
-                   intel_de_read(dev_priv, UTIL_PIN_CTL) &

UTIL_PIN_ENABLE,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19
-                   "Backlight is not disabled.\n");
-     drm_WARN_ONCE(&dev_priv->drm,
-                   (intel_de_read(dev_priv, DC_STATE_EN) &
-                    DC_STATE_EN_UPTO_DC6),
-                   "DC6 already programmed to be enabled.\n");
-
-     assert_dmc_loaded(dev_priv);
-}
-
-static void skl_enable_dc6(struct drm_i915_private *dev_priv)
-{
-     assert_can_enable_dc6(dev_priv);
-
-     drm_dbg_kms(&dev_priv->drm, "Enabling DC6\n");
-
-     /* Wa Display #1183: skl,kbl,cfl */
-     if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv))
-             intel_de_write(dev_priv, GEN8_CHICKEN_DCPR_1,
-                            intel_de_read(dev_priv,

GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-     gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
-}
-
-static void hsw_power_well_sync_hw(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-                                struct i915_power_well *power_well)
-{
-     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-     int pw_idx = power_well->desc->hsw.idx;
-     u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
-     u32 bios_req = intel_de_read(dev_priv, regs->bios);
-
-     /* Take over the request bit if set by BIOS. */
-     if (bios_req & mask) {
-             u32 drv_req = intel_de_read(dev_priv, regs->driver);
-
-             if (!(drv_req & mask))
-                     intel_de_write(dev_priv, regs->driver, drv_req

| mask);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-             intel_de_write(dev_priv, regs->bios, bios_req & ~mask);
-     }
-}
-
-static void bxt_dpio_cmn_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     bxt_ddi_phy_init(dev_priv, power_well->desc->bxt.phy);
-}
-
-static void bxt_dpio_cmn_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     bxt_ddi_phy_uninit(dev_priv, power_well->desc->bxt.phy);
-}
-
-static bool bxt_dpio_cmn_power_well_enabled(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     return bxt_ddi_phy_is_enabled(dev_priv, power_well->desc-
Quoted 1 line

bxt.phy);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void bxt_verify_ddi_phy_power_wells(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-{
-     struct i915_power_well *power_well;
-
-     power_well = lookup_power_well(dev_priv,

BXT_DISP_PW_DPIO_CMN_A);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     if (intel_power_well_refcount(power_well) > 0)
-             bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
Quoted 1 line

bxt.phy);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-
-     power_well = lookup_power_well(dev_priv,

VLV_DISP_PW_DPIO_CMN_BC);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     if (intel_power_well_refcount(power_well) > 0)
-             bxt_ddi_phy_verify_state(dev_priv, power_well->desc-
Quoted 1 line

bxt.phy);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-
-     if (IS_GEMINILAKE(dev_priv)) {
-             power_well = lookup_power_well(dev_priv,
-                                            GLK_DISP_PW_DPIO_CMN_C);
-             if (intel_power_well_refcount(power_well) > 0)
-                     bxt_ddi_phy_verify_state(dev_priv,
-                                              power_well->desc-
Quoted 1 line

bxt.phy);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-     }
-}
-
-static bool gen9_dc_off_power_well_enabled(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     return ((intel_de_read(dev_priv, DC_STATE_EN) &

DC_STATE_EN_DC3CO) == 0 &&
- (intel_de_read(dev_priv, DC_STATE_EN) &
DC_STATE_EN_UPTO_DC5_DC6_MASK) == 0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void gen9_assert_dbuf_enabled(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     u8 hw_enabled_dbuf_slices =

intel_enabled_dbuf_slices_mask(dev_priv);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     u8 enabled_dbuf_slices = dev_priv->dbuf.enabled_slices;
-
-     drm_WARN(&dev_priv->drm,
-              hw_enabled_dbuf_slices != enabled_dbuf_slices,
-              "Unexpected DBuf power power state (0x%08x, expected

0x%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-              hw_enabled_dbuf_slices,
-              enabled_dbuf_slices);
-}
-
-static void gen9_disable_dc_states(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15
-{
-     struct intel_cdclk_config cdclk_config = {};
-
-     if (dev_priv->dmc.target_dc_state == DC_STATE_EN_DC3CO) {
-             tgl_disable_dc3co(dev_priv);
-             return;
-     }
-
-     gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
-
-     if (!HAS_DISPLAY(dev_priv))
-             return;
-
-     intel_cdclk_get_cdclk(dev_priv, &cdclk_config);
-     /* Can't read out voltage_level so can't use

intel_cdclk_changed() */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12
-     drm_WARN_ON(&dev_priv->drm,
-                 intel_cdclk_needs_modeset(&dev_priv->cdclk.hw,
-                                           &cdclk_config));
-
-     gen9_assert_dbuf_enabled(dev_priv);
-
-     if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
-             bxt_verify_ddi_phy_power_wells(dev_priv);
-
-     if (DISPLAY_VER(dev_priv) >= 11)
-             /*
-              * DMC retains HW context only for port A, the other

combo
- * PHY's HW context for port B is lost after DC
transitions,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-              * so we need to restore it manually.
-              */
-             intel_combo_phy_init(dev_priv);
-}
-
-static void gen9_dc_off_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     gen9_disable_dc_states(dev_priv);
-}
-
-static void gen9_dc_off_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -18
-{
-     if (!intel_dmc_has_payload(dev_priv))
-             return;
-
-     switch (dev_priv->dmc.target_dc_state) {
-     case DC_STATE_EN_DC3CO:
-             tgl_enable_dc3co(dev_priv);
-             break;
-     case DC_STATE_EN_UPTO_DC6:
-             skl_enable_dc6(dev_priv);
-             break;
-     case DC_STATE_EN_UPTO_DC5:
-             gen9_enable_dc5(dev_priv);
-             break;
-     }
-}
-
-static void i9xx_power_well_sync_hw_noop(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-{
-}
-
-static void i9xx_always_on_power_well_noop(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-{
-}
-
-static bool i9xx_always_on_power_well_enabled(struct

drm_i915_private *dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     return true;
-}
-
-static void i830_pipes_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     if ((intel_de_read(dev_priv, PIPECONF(PIPE_A)) &

PIPECONF_ENABLE) == 0)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             i830_enable_pipe(dev_priv, PIPE_A);
-     if ((intel_de_read(dev_priv, PIPECONF(PIPE_B)) &

PIPECONF_ENABLE) == 0)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-             i830_enable_pipe(dev_priv, PIPE_B);
-}
-
-static void i830_pipes_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-{
-     i830_disable_pipe(dev_priv, PIPE_B);
-     i830_disable_pipe(dev_priv, PIPE_A);
-}
-
-static bool i830_pipes_power_well_enabled(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-{
-     return intel_de_read(dev_priv, PIPECONF(PIPE_A)) &

PIPECONF_ENABLE &&
- intel_de_read(dev_priv, PIPECONF(PIPE_B)) &
PIPECONF_ENABLE;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void i830_pipes_power_well_sync_hw(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-{
-     if (intel_power_well_refcount(power_well) > 0)
-             i830_pipes_power_well_enable(dev_priv, power_well);
-     else
-             i830_pipes_power_well_disable(dev_priv, power_well);
-}
-
-static void vlv_set_power_well(struct drm_i915_private *dev_priv,
-                            struct i915_power_well *power_well, bool

enable)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-{
-     int pw_idx = power_well->desc->vlv.idx;
-     u32 mask;
-     u32 state;
-     u32 ctrl;
-
-     mask = PUNIT_PWRGT_MASK(pw_idx);
-     state = enable ? PUNIT_PWRGT_PWR_ON(pw_idx) :
-                      PUNIT_PWRGT_PWR_GATE(pw_idx);
-
-     vlv_punit_get(dev_priv);
-
-#define COND \
-     ((vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) & mask) ==

state)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12
-
-     if (COND)
-             goto out;
-
-     ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL);
-     ctrl &= ~mask;
-     ctrl |= state;
-     vlv_punit_write(dev_priv, PUNIT_REG_PWRGT_CTRL, ctrl);
-
-     if (wait_for(COND, 100))
-             drm_err(&dev_priv->drm,
-                     "timeout setting power well state %08x

(%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-                     state,
-                     vlv_punit_read(dev_priv,

PUNIT_REG_PWRGT_CTRL));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-
-#undef COND
-
-out:
-     vlv_punit_put(dev_priv);
-}
-
-static void vlv_power_well_enable(struct drm_i915_private *dev_priv,
-                               struct i915_power_well *power_well)
-{
-     vlv_set_power_well(dev_priv, power_well, true);
-}
-
-static void vlv_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-                                struct i915_power_well *power_well)
-{
-     vlv_set_power_well(dev_priv, power_well, false);
-}
-
-static bool vlv_power_well_enabled(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-                                struct i915_power_well *power_well)
-{
-     int pw_idx = power_well->desc->vlv.idx;
-     bool enabled = false;
-     u32 mask;
-     u32 state;
-     u32 ctrl;
-
-     mask = PUNIT_PWRGT_MASK(pw_idx);
-     ctrl = PUNIT_PWRGT_PWR_ON(pw_idx);
-
-     vlv_punit_get(dev_priv);
-
-     state = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) &

mask;

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     /*
-      * We only ever set the power-on and power-gate states,

anything

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-      * else is unexpected.
-      */
-     drm_WARN_ON(&dev_priv->drm, state != PUNIT_PWRGT_PWR_ON(pw_idx)

&&

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-                 state != PUNIT_PWRGT_PWR_GATE(pw_idx));
-     if (state == ctrl)
-             enabled = true;
-
-     /*
-      * A transient state at this point would mean some unexpected

party

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11
-      * is poking at the power controls too.
-      */
-     ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL) & mask;
-     drm_WARN_ON(&dev_priv->drm, ctrl != state);
-
-     vlv_punit_put(dev_priv);
-
-     return enabled;
-}
-
-static void vlv_init_display_clock_gating(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     u32 val;
-
-     /*
-      * On driver load, a pipe may be active and driving a DSI

display.
- * Preserve DPOUNIT_CLOCK_GATE_DISABLE to avoid the pipe
getting stuck
- * (and never recovering) in this case.
intel_dsi_post_disable() will

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15
-      * clear it when we turn off the display.
-      */
-     val = intel_de_read(dev_priv, DSPCLK_GATE_D);
-     val &= DPOUNIT_CLOCK_GATE_DISABLE;
-     val |= VRHUNIT_CLOCK_GATE_DISABLE;
-     intel_de_write(dev_priv, DSPCLK_GATE_D, val);
-
-     /*
-      * Disable trickle feed and enable pnd deadline calculation
-      */
-     intel_de_write(dev_priv, MI_ARB_VLV,
-                    MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
-     intel_de_write(dev_priv, CBR1_VLV, 0);
-
-     drm_WARN_ON(&dev_priv->drm, RUNTIME_INFO(dev_priv)->rawclk_freq

== 0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     intel_de_write(dev_priv, RAWCLK_FREQ_VLV,
-                    DIV_ROUND_CLOSEST(RUNTIME_INFO(dev_priv)-
Quoted 1 line

rawclk_freq,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-                                      1000));
-}
-
-static void vlv_display_power_well_init(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -30
-{
-     struct intel_encoder *encoder;
-     enum pipe pipe;
-
-     /*
-      * Enable the CRI clock source so we can get at the
-      * display and the reference clock for VGA
-      * hotplug / manual detection. Supposedly DSI also
-      * needs the ref clock up and running.
-      *
-      * CHV DPLL B/C have some issues if VGA mode is enabled.
-      */
-     for_each_pipe(dev_priv, pipe) {
-             u32 val = intel_de_read(dev_priv, DPLL(pipe));
-
-             val |= DPLL_REF_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS;
-             if (pipe != PIPE_A)
-                     val |= DPLL_INTEGRATED_CRI_CLK_VLV;
-
-             intel_de_write(dev_priv, DPLL(pipe), val);
-     }
-
-     vlv_init_display_clock_gating(dev_priv);
-
-     spin_lock_irq(&dev_priv->irq_lock);
-     valleyview_enable_display_irqs(dev_priv);
-     spin_unlock_irq(&dev_priv->irq_lock);
-
-     /*
-      * During driver initialization/resume we can avoid restoring

the
- * part of the HW/SW state that will be inited anyway
explicitly.

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19
-      */
-     if (dev_priv->power_domains.initializing)
-             return;
-
-     intel_hpd_init(dev_priv);
-     intel_hpd_poll_disable(dev_priv);
-
-     /* Re-enable the ADPA, if we have one */
-     for_each_intel_encoder(&dev_priv->drm, encoder) {
-             if (encoder->type == INTEL_OUTPUT_ANALOG)
-                     intel_crt_reset(&encoder->base);
-     }
-
-     intel_vga_redisable_power_on(dev_priv);
-
-     intel_pps_unlock_regs_wa(dev_priv);
-}
-
-static void vlv_display_power_well_deinit(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11
-{
-     spin_lock_irq(&dev_priv->irq_lock);
-     valleyview_disable_display_irqs(dev_priv);
-     spin_unlock_irq(&dev_priv->irq_lock);
-
-     /* make sure we're done processing display irqs */
-     intel_synchronize_irq(dev_priv);
-
-     intel_pps_reset_all(dev_priv);
-
-     /* Prevent us from re-enabling polling on accident in late

suspend */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-     if (!dev_priv->drm.dev->power.is_suspended)
-             intel_hpd_poll_enable(dev_priv);
-}
-
-static void vlv_display_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-{
-     vlv_set_power_well(dev_priv, power_well, true);
-
-     vlv_display_power_well_init(dev_priv);
-}
-
-static void vlv_display_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-{
-     vlv_display_power_well_deinit(dev_priv);
-
-     vlv_set_power_well(dev_priv, power_well, false);
-}
-
-static void vlv_dpio_cmn_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -19
-{
-     /* since ref/cri clock was enabled */
-     udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
-
-     vlv_set_power_well(dev_priv, power_well, true);
-
-     /*
-      * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx -
-      *  6.  De-assert cmn_reset/side_reset. Same as VLV X0.
-      *   a. GUnit 0x2110 bit[0] set to 1 (def 0)
-      *   b. The other bits such as sfr settings / modesel may all
-      *      be set to 0.
-      *
-      * This should only be done on init and resume from S3 with
-      * both PLLs disabled, or we risk losing DPIO and PLL
-      * synchronization.
-      */
-     intel_de_write(dev_priv, DPIO_CTL,
-                    intel_de_read(dev_priv, DPIO_CTL) |

DPIO_CMNRST);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-}
-
-static void vlv_dpio_cmn_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -9
-{
-     enum pipe pipe;
-
-     for_each_pipe(dev_priv, pipe)
-             assert_pll_disabled(dev_priv, pipe);
-
-     /* Assert common reset */
-     intel_de_write(dev_priv, DPIO_CTL,
-                    intel_de_read(dev_priv, DPIO_CTL) &

~DPIO_CMNRST);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -25
-
-     vlv_set_power_well(dev_priv, power_well, false);
-}
-
 #define POWER_DOMAIN_MASK (GENMASK_ULL(POWER_DOMAIN_NUM - 1, 0))
 
-#define BITS_SET(val, bits) (((val) & (bits)) == (bits))
-
-static void assert_chv_phy_status(struct drm_i915_private *dev_priv)
-{
-     struct i915_power_well *cmn_bc =
-             lookup_power_well(dev_priv, VLV_DISP_PW_DPIO_CMN_BC);
-     struct i915_power_well *cmn_d =
-             lookup_power_well(dev_priv, CHV_DISP_PW_DPIO_CMN_D);
-     u32 phy_control = dev_priv->chv_phy_control;
-     u32 phy_status = 0;
-     u32 phy_status_mask = 0xffffffff;
-
-     /*
-      * The BIOS can leave the PHY is some weird state
-      * where it doesn't fully power down some parts.
-      * Disable the asserts until the PHY has been fully
-      * reset (ie. the power well has been disabled at
-      * least once).
-      */
-     if (!dev_priv->chv_phy_assert[DPIO_PHY0])
-             phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY0,

DPIO_CH0) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH0, 0) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH0, 1) |
- PHY_STATUS_CMN_LDO(DPIO_PHY0,
DPIO_CH1) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH1, 0) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH1, 1));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-     if (!dev_priv->chv_phy_assert[DPIO_PHY1])
-             phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY1,

DPIO_CH0) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 0) |
- PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 1));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-
-     if (intel_power_well_is_enabled(dev_priv, cmn_bc)) {
-             phy_status |= PHY_POWERGOOD(DPIO_PHY0);
-
-             /* this assumes override is only used to enable lanes

*/
- if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0,
DPIO_CH0)) == 0)
- phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf,
DPIO_PHY0, DPIO_CH0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-
-             if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0,

DPIO_CH1)) == 0)
- phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf,
DPIO_PHY0, DPIO_CH1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-
-             /* CL1 is on whenever anything is on in either channel

*/

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0,

DPIO_CH0) |
- PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0,
DPIO_CH1)))
- phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0,
DPIO_CH0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             /*
-              * The DPLLB check accounts for the pipe B + port A

usage
- * with CL2 powered up but all the lanes in the second
channel

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-              * powered down.
-              */
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0,

DPIO_CH1)) &&
- (intel_de_read(dev_priv, DPLL(PIPE_B)) &
DPLL_VCO_ENABLE) == 0)
- phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0,
DPIO_CH1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0,

DPIO_CH0)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH0, 0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0,

DPIO_CH0)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH0, 1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0,

DPIO_CH1)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH1, 0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0,

DPIO_CH1)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0,
DPIO_CH1, 1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     }
-
-     if (intel_power_well_is_enabled(dev_priv, cmn_d)) {
-             phy_status |= PHY_POWERGOOD(DPIO_PHY1);
-
-             /* this assumes override is only used to enable lanes

*/
- if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY1,
DPIO_CH0)) == 0)
- phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf,
DPIO_PHY1, DPIO_CH0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY1,

DPIO_CH0)))
- phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY1,
DPIO_CH0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY1,

DPIO_CH0)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 0);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             if (BITS_SET(phy_control,
-                          PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY1,

DPIO_CH0)))
- phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1,
DPIO_CH0, 1);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     }
-
-     phy_status &= phy_status_mask;
-
-     /*
-      * The PHY may be busy with some initial calibration and

whatnot,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-      * so the power state can take a while to actually change.
-      */
-     if (intel_de_wait_for_register(dev_priv, DISPLAY_PHY_STATUS,
-                                    phy_status_mask, phy_status,

10))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-             drm_err(&dev_priv->drm,
-                     "Unexpected PHY_STATUS 0x%08x, expected 0x%08x

(PHY_CONTROL=0x%08x)\n",
- intel_de_read(dev_priv, DISPLAY_PHY_STATUS) &
phy_status_mask,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-                     phy_status, dev_priv->chv_phy_control);
-}
-
-#undef BITS_SET
-
-static void chv_dpio_cmn_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-{
-     enum dpio_phy phy;
-     enum pipe pipe;
-     u32 tmp;
-
-     drm_WARN_ON_ONCE(&dev_priv->drm,
-                      power_well->desc->id !=

VLV_DISP_PW_DPIO_CMN_BC &&
- power_well->desc->id !=
CHV_DISP_PW_DPIO_CMN_D);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -17
-
-     if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-             pipe = PIPE_A;
-             phy = DPIO_PHY0;
-     } else {
-             pipe = PIPE_C;
-             phy = DPIO_PHY1;
-     }
-
-     /* since ref/cri clock was enabled */
-     udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
-     vlv_set_power_well(dev_priv, power_well, true);
-
-     /* Poll for phypwrgood signal */
-     if (intel_de_wait_for_set(dev_priv, DISPLAY_PHY_STATUS,
-                               PHY_POWERGOOD(phy), 1))
-             drm_err(&dev_priv->drm, "Display PHY %d is not power

up\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -39
-                     phy);
-
-     vlv_dpio_get(dev_priv);
-
-     /* Enable dynamic power down */
-     tmp = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW28);
-     tmp |= DPIO_DYNPWRDOWNEN_CH0 | DPIO_CL1POWERDOWNEN |
-             DPIO_SUS_CLK_CONFIG_GATE_CLKREQ;
-     vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW28, tmp);
-
-     if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-             tmp = vlv_dpio_read(dev_priv, pipe, _CHV_CMN_DW6_CH1);
-             tmp |= DPIO_DYNPWRDOWNEN_CH1;
-             vlv_dpio_write(dev_priv, pipe, _CHV_CMN_DW6_CH1, tmp);
-     } else {
-             /*
-              * Force the non-existing CL2 off. BXT does this
-              * too, so maybe it saves some power even though
-              * CL2 doesn't exist?
-              */
-             tmp = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW30);
-             tmp |= DPIO_CL2_LDOFUSE_PWRENB;
-             vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW30, tmp);
-     }
-
-     vlv_dpio_put(dev_priv);
-
-     dev_priv->chv_phy_control |= PHY_COM_LANE_RESET_DEASSERT(phy);
-     intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-                    dev_priv->chv_phy_control);
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "Enabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
-                 phy, dev_priv->chv_phy_control);
-
-     assert_chv_phy_status(dev_priv);
-}
-
-static void chv_dpio_cmn_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -5
-{
-     enum dpio_phy phy;
-
-     drm_WARN_ON_ONCE(&dev_priv->drm,
-                      power_well->desc->id !=

VLV_DISP_PW_DPIO_CMN_BC &&
- power_well->desc->id !=
CHV_DISP_PW_DPIO_CMN_D);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -21
-
-     if (power_well->desc->id == VLV_DISP_PW_DPIO_CMN_BC) {
-             phy = DPIO_PHY0;
-             assert_pll_disabled(dev_priv, PIPE_A);
-             assert_pll_disabled(dev_priv, PIPE_B);
-     } else {
-             phy = DPIO_PHY1;
-             assert_pll_disabled(dev_priv, PIPE_C);
-     }
-
-     dev_priv->chv_phy_control &= ~PHY_COM_LANE_RESET_DEASSERT(phy);
-     intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-                    dev_priv->chv_phy_control);
-
-     vlv_set_power_well(dev_priv, power_well, false);
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "Disabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
-                 phy, dev_priv->chv_phy_control);
-
-     /* PHY is fully reset now, so we can enable the PHY state

asserts */

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     dev_priv->chv_phy_assert[phy] = true;
-
-     assert_chv_phy_status(dev_priv);
-}
-
-static void assert_chv_phy_powergate(struct drm_i915_private

*dev_priv, enum dpio_phy phy,
- enum dpio_channel ch, bool
override, unsigned int mask)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -25
-{
-     enum pipe pipe = phy == DPIO_PHY0 ? PIPE_A : PIPE_C;
-     u32 reg, val, expected, actual;
-
-     /*
-      * The BIOS can leave the PHY is some weird state
-      * where it doesn't fully power down some parts.
-      * Disable the asserts until the PHY has been fully
-      * reset (ie. the power well has been disabled at
-      * least once).
-      */
-     if (!dev_priv->chv_phy_assert[phy])
-             return;
-
-     if (ch == DPIO_CH0)
-             reg = _CHV_CMN_DW0_CH0;
-     else
-             reg = _CHV_CMN_DW6_CH1;
-
-     vlv_dpio_get(dev_priv);
-     val = vlv_dpio_read(dev_priv, pipe, reg);
-     vlv_dpio_put(dev_priv);
-
-     /*
-      * This assumes !override is only used when the port is

disabled.

drivers/gpu/drm/i915/display/intel_display_power.c +0 -30
-      * All lanes should power down even without the override when
-      * the port is disabled.
-      */
-     if (!override || mask == 0xf) {
-             expected = DPIO_ALLDL_POWERDOWN | DPIO_ANYDL_POWERDOWN;
-             /*
-              * If CH1 common lane is not active anymore
-              * (eg. for pipe B DPLL) the entire channel will
-              * shut down, which causes the common lane registers
-              * to read as 0. That means we can't actually check
-              * the lane power down status bits, but as the entire
-              * register reads as 0 it's a good indication that the
-              * channel is indeed entirely powered down.
-              */
-             if (ch == DPIO_CH1 && val == 0)
-                     expected = 0;
-     } else if (mask != 0x0) {
-             expected = DPIO_ANYDL_POWERDOWN;
-     } else {
-             expected = 0;
-     }
-
-     if (ch == DPIO_CH0)
-             actual = val >> DPIO_ANYDL_POWERDOWN_SHIFT_CH0;
-     else
-             actual = val >> DPIO_ANYDL_POWERDOWN_SHIFT_CH1;
-     actual &= DPIO_ALLDL_POWERDOWN | DPIO_ANYDL_POWERDOWN;
-
-     drm_WARN(&dev_priv->drm, actual != expected,
-              "Unexpected DPIO lane power down: all %d, any %d.

Expected: all %d, any %d. (0x%x = 0x%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -30
-              !!(actual & DPIO_ALLDL_POWERDOWN),
-              !!(actual & DPIO_ANYDL_POWERDOWN),
-              !!(expected & DPIO_ALLDL_POWERDOWN),
-              !!(expected & DPIO_ANYDL_POWERDOWN),
-              reg, val);
-}
-
-bool chv_phy_powergate_ch(struct drm_i915_private *dev_priv, enum dpio_phy phy,
-                       enum dpio_channel ch, bool override)
-{
-     struct i915_power_domains *power_domains = &dev_priv->power_domains;
-     bool was_override;
-
-     mutex_lock(&power_domains->lock);
-
-     was_override = dev_priv->chv_phy_control & PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-
-     if (override == was_override)
-             goto out;
-
-     if (override)
-             dev_priv->chv_phy_control |= PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-     else
-             dev_priv->chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
-
-     intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-                    dev_priv->chv_phy_control);
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "Power gating DPIO PHY%d CH%d

(DPIO_PHY_CONTROL=0x%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -15
-                 phy, ch, dev_priv->chv_phy_control);
-
-     assert_chv_phy_status(dev_priv);
-
-out:
-     mutex_unlock(&power_domains->lock);
-
-     return was_override;
-}
-
-void chv_phy_powergate_lanes(struct intel_encoder *encoder,
-                          bool override, unsigned int mask)
-{
-     struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
-     struct i915_power_domains *power_domains = &dev_priv-
Quoted 1 line

power_domains;

- enum dpio_phy phy =
vlv_dig_port_to_phy(enc_to_dig_port(encoder));
- enum dpio_channel ch =
vlv_dig_port_to_channel(enc_to_dig_port(encoder));

drivers/gpu/drm/i915/display/intel_display_power.c +0 -4
-
-     mutex_lock(&power_domains->lock);
-
-     dev_priv->chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD(0xf, phy,

ch);
- dev_priv->chv_phy_control |= PHY_CH_POWER_DOWN_OVRD(mask, phy,
ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-
-     if (override)
-             dev_priv->chv_phy_control |=

PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     else
-             dev_priv->chv_phy_control &=

~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-
-     intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-                    dev_priv->chv_phy_control);
-
-     drm_dbg_kms(&dev_priv->drm,
-                 "Power gating DPIO PHY%d CH%d lanes 0x%x

(PHY_CONTROL=0x%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-                 phy, ch, mask, dev_priv->chv_phy_control);
-
-     assert_chv_phy_status(dev_priv);
-
-     assert_chv_phy_powergate(dev_priv, phy, ch, override, mask);
-
-     mutex_unlock(&power_domains->lock);
-}
-
-static bool chv_pipe_power_well_enabled(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-{
-     enum pipe pipe = PIPE_A;
-     bool enabled;
-     u32 state, ctrl;
-
-     vlv_punit_get(dev_priv);
-
-     state = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) &

DP_SSS_MASK(pipe);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -2
-     /*
-      * We only ever set the power-on and power-gate states,

anything

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-      * else is unexpected.
-      */
-     drm_WARN_ON(&dev_priv->drm, state != DP_SSS_PWR_ON(pipe) &&
-                 state != DP_SSS_PWR_GATE(pipe));
-     enabled = state == DP_SSS_PWR_ON(pipe);
-
-     /*
-      * A transient state at this point would mean some unexpected

party

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-      * is poking at the power controls too.
-      */
-     ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) &

DP_SSC_MASK(pipe);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -8
-     drm_WARN_ON(&dev_priv->drm, ctrl << 16 != state);
-
-     vlv_punit_put(dev_priv);
-
-     return enabled;
-}
-
-static void chv_set_pipe_power_well(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power.c +0 -13
-                                 struct i915_power_well *power_well,
-                                 bool enable)
-{
-     enum pipe pipe = PIPE_A;
-     u32 state;
-     u32 ctrl;
-
-     state = enable ? DP_SSS_PWR_ON(pipe) : DP_SSS_PWR_GATE(pipe);
-
-     vlv_punit_get(dev_priv);
-
-#define COND \
-     ((vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) &

DP_SSS_MASK(pipe)) == state)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -12
-
-     if (COND)
-             goto out;
-
-     ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM);
-     ctrl &= ~DP_SSC_MASK(pipe);
-     ctrl |= enable ? DP_SSC_PWR_ON(pipe) : DP_SSC_PWR_GATE(pipe);
-     vlv_punit_write(dev_priv, PUNIT_REG_DSPSSPM, ctrl);
-
-     if (wait_for(COND, 100))
-             drm_err(&dev_priv->drm,
-                     "timeout setting power well state %08x

(%08x)\n",

drivers/gpu/drm/i915/display/intel_display_power.c +0 -10
-                     state,
-                     vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM));
-
-#undef COND
-
-out:
-     vlv_punit_put(dev_priv);
-}
-
-static void chv_pipe_power_well_sync_hw(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-{
-     intel_de_write(dev_priv, DISPLAY_PHY_CONTROL,
-                    dev_priv->chv_phy_control);
-}
-
-static void chv_pipe_power_well_enable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
-{
-     chv_set_pipe_power_well(dev_priv, power_well, true);
-
-     vlv_display_power_well_init(dev_priv);
-}
-
-static void chv_pipe_power_well_disable(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-{
-     vlv_display_power_well_deinit(dev_priv);
-
-     chv_set_pipe_power_well(dev_priv, power_well, false);
-}
-
 static u64 __async_put_domains_mask(struct i915_power_domains

*power_domains)

 {
      return power_domains->async_put_domains[0] |
drivers/gpu/drm/i915/display/intel_display_power.c +0 -1
@@ -3043,27 +1474,6 @@ intel_display_power_put_mask_in_set(struct
 drm_i915_private *i915,
 #define XELPD_DDI_IO_TC3_POWER_DOMAINS               BIT_ULL(POWER_D
 OMAIN_PORT_DDI_IO_TC3)
 #define XELPD_DDI_IO_TC4_POWER_DOMAINS               BIT_ULL(POWER_D
 OMAIN_PORT_DDI_IO_TC4)
 
-static const struct i915_power_well_ops

i9xx_always_on_power_well_ops = {

drivers/gpu/drm/i915/display/intel_display_power.c +0 -14
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = i9xx_always_on_power_well_noop,
-     .disable = i9xx_always_on_power_well_noop,
-     .is_enabled = i9xx_always_on_power_well_enabled,
-};
-
-static const struct i915_power_well_ops chv_pipe_power_well_ops = {
-     .sync_hw = chv_pipe_power_well_sync_hw,
-     .enable = chv_pipe_power_well_enable,
-     .disable = chv_pipe_power_well_disable,
-     .is_enabled = chv_pipe_power_well_enabled,
-};
-
-static const struct i915_power_well_ops chv_dpio_cmn_power_well_ops

= {

drivers/gpu/drm/i915/display/intel_display_power.c +0 -6
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = chv_dpio_cmn_power_well_enable,
-     .disable = chv_dpio_cmn_power_well_disable,
-     .is_enabled = vlv_power_well_enabled,
-};
-
 static const struct i915_power_well_desc i9xx_always_on_power_well[]
= {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.c +0 -7
@@ -3074,13 +1484,6 @@ static const struct i915_power_well_desc
 i9xx_always_on_power_well[] = {
      },
 };
 
-static const struct i915_power_well_ops i830_pipes_power_well_ops =
 {
-     .sync_hw = i830_pipes_power_well_sync_hw,
-     .enable = i830_pipes_power_well_enable,
-     .disable = i830_pipes_power_well_disable,
-     .is_enabled = i830_pipes_power_well_enabled,
-};
-
 static const struct i915_power_well_desc i830_power_wells[] = {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.c +0 -29
@@ -3097,35 +1500,6 @@ static const struct i915_power_well_desc
 i830_power_wells[] = {
      },
 };
 
-static const struct i915_power_well_regs hsw_power_well_regs = {
-     .bios   = HSW_PWR_WELL_CTL1,
-     .driver = HSW_PWR_WELL_CTL2,
-     .kvmr   = HSW_PWR_WELL_CTL3,
-     .debug  = HSW_PWR_WELL_CTL4,
-};
-
-static const struct i915_power_well_ops hsw_power_well_ops = {
-     .regs = &hsw_power_well_regs,
-     .sync_hw = hsw_power_well_sync_hw,
-     .enable = hsw_power_well_enable,
-     .disable = hsw_power_well_disable,
-     .is_enabled = hsw_power_well_enabled,
-};
-
-static const struct i915_power_well_ops gen9_dc_off_power_well_ops =
 {
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = gen9_dc_off_power_well_enable,
-     .disable = gen9_dc_off_power_well_disable,
-     .is_enabled = gen9_dc_off_power_well_enabled,
-};
-
-static const struct i915_power_well_ops bxt_dpio_cmn_power_well_ops
 = {
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = bxt_dpio_cmn_power_well_enable,
-     .disable = bxt_dpio_cmn_power_well_disable,
-     .is_enabled = bxt_dpio_cmn_power_well_enabled,
-};
-
 static const struct i915_power_well_desc hsw_power_wells[] = {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.c +0 -21
@@ -3167,27 +1541,6 @@ static const struct i915_power_well_desc
 bdw_power_wells[] = {
      },
 };
 
-static const struct i915_power_well_ops vlv_display_power_well_ops =
 {
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = vlv_display_power_well_enable,
-     .disable = vlv_display_power_well_disable,
-     .is_enabled = vlv_power_well_enabled,
-};
-
-static const struct i915_power_well_ops vlv_dpio_cmn_power_well_ops
 = {
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = vlv_dpio_cmn_power_well_enable,
-     .disable = vlv_dpio_cmn_power_well_disable,
-     .is_enabled = vlv_power_well_enabled,
-};
-
-static const struct i915_power_well_ops vlv_dpio_power_well_ops = {
-     .sync_hw = i9xx_power_well_sync_hw_noop,
-     .enable = vlv_power_well_enable,
-     .disable = vlv_power_well_disable,
-     .is_enabled = vlv_power_well_enabled,
-};
-
 static const struct i915_power_well_desc vlv_power_wells[] = {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.c +0 -28
@@ -3569,34 +1922,6 @@ static const struct i915_power_well_desc
 glk_power_wells[] = {
      },
 };
 
-static const struct i915_power_well_regs icl_aux_power_well_regs = {
-     .bios   = ICL_PWR_WELL_CTL_AUX1,
-     .driver = ICL_PWR_WELL_CTL_AUX2,
-     .debug  = ICL_PWR_WELL_CTL_AUX4,
-};
-
-static const struct i915_power_well_ops icl_aux_power_well_ops = {
-     .regs = &icl_aux_power_well_regs,
-     .sync_hw = hsw_power_well_sync_hw,
-     .enable = icl_aux_power_well_enable,
-     .disable = icl_aux_power_well_disable,
-     .is_enabled = hsw_power_well_enabled,
-};
-
-static const struct i915_power_well_regs icl_ddi_power_well_regs = {
-     .bios   = ICL_PWR_WELL_CTL_DDI1,
-     .driver = ICL_PWR_WELL_CTL_DDI2,
-     .debug  = ICL_PWR_WELL_CTL_DDI4,
-};
-
-static const struct i915_power_well_ops icl_ddi_power_well_ops = {
-     .regs = &icl_ddi_power_well_regs,
-     .sync_hw = hsw_power_well_sync_hw,
-     .enable = hsw_power_well_enable,
-     .disable = hsw_power_well_disable,
-     .is_enabled = hsw_power_well_enabled,
-};
-
 static const struct i915_power_well_desc icl_power_wells[] = {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power.c +0 -17
@@ -3810,90 +2135,6 @@ static const struct i915_power_well_desc
 icl_power_wells[] = {
      },
 };
 
-static void
-tgl_tc_cold_request(struct drm_i915_private *i915, bool block)
-{
-     u8 tries = 0;
-     int ret;
-
-     while (1) {
-             u32 low_val;
-             u32 high_val = 0;
-
-             if (block)
-                     low_val =
 TGL_PCODE_EXIT_TCCOLD_DATA_L_BLOCK_REQ;
-             else
-                     low_val =
 TGL_PCODE_EXIT_TCCOLD_DATA_L_UNBLOCK_REQ;
-
-             /*
-              * Spec states that we should timeout the request after

200us

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-              * but the function below will timeout after 500us
-              */
-             ret = snb_pcode_read(i915, TGL_PCODE_TCCOLD, &low_val,

&high_val);

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-             if (ret == 0) {
-                     if (block &&
-                         (low_val &

TGL_PCODE_EXIT_TCCOLD_DATA_L_EXIT_FAILED))

drivers/gpu/drm/i915/display/intel_display_power.c +0 -45
-                             ret = -EIO;
-                     else
-                             break;
-             }
-
-             if (++tries == 3)
-                     break;
-
-             msleep(1);
-     }
-
-     if (ret)
-             drm_err(&i915->drm, "TC cold %sblock failed\n",
-                     block ? "" : "un");
-     else
-             drm_dbg_kms(&i915->drm, "TC cold %sblock succeeded\n",
-                         block ? "" : "un");
-}
-
-static void
-tgl_tc_cold_off_power_well_enable(struct drm_i915_private *i915,
-                               struct i915_power_well *power_well)
-{
-     tgl_tc_cold_request(i915, true);
-}
-
-static void
-tgl_tc_cold_off_power_well_disable(struct drm_i915_private *i915,
-                                struct i915_power_well *power_well)
-{
-     tgl_tc_cold_request(i915, false);
-}
-
-static void
-tgl_tc_cold_off_power_well_sync_hw(struct drm_i915_private *i915,
-                                struct i915_power_well *power_well)
-{
-     if (intel_power_well_refcount(power_well) > 0)
-             tgl_tc_cold_off_power_well_enable(i915, power_well);
-     else
-             tgl_tc_cold_off_power_well_disable(i915, power_well);
-}
-
-static bool
-tgl_tc_cold_off_power_well_is_enabled(struct drm_i915_private

*dev_priv,
- struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power.c +0 -3
-{
-     /*
-      * Not the correctly implementation but there is no way to just

read it
- * from PCODE, so returning count to avoid state mismatch
errors

drivers/gpu/drm/i915/display/intel_display_power.c +0 -11
-      */
-     return intel_power_well_refcount(power_well);
-}
-
-static const struct i915_power_well_ops tgl_tc_cold_off_ops = {
-     .sync_hw = tgl_tc_cold_off_power_well_sync_hw,
-     .enable = tgl_tc_cold_off_power_well_enable,
-     .disable = tgl_tc_cold_off_power_well_disable,
-     .is_enabled = tgl_tc_cold_off_power_well_is_enabled,
-};
-
 static const struct i915_power_well_desc tgl_power_wells[] = {
      {
              .name = "always-on",
drivers/gpu/drm/i915/display/intel_display_power_well.c +28 -0
index 2a0fb9d9c60f2..a92bb807f1972 100644
@@ -4,7 +4,58 @@
  */
 
 #include "i915_drv.h"
+#include "i915_irq.h"
+#include "intel_combo_phy.h"
+#include "intel_combo_phy_regs.h"
+#include "intel_crt.h"
+#include "intel_de.h"
 #include "intel_display_power_well.h"
+#include "intel_display_types.h"
+#include "intel_dpio_phy.h"
+#include "intel_dpll.h"
+#include "intel_hotplug.h"
+#include "intel_pcode.h"
+#include "intel_pm.h"
+#include "intel_pps.h"
+#include "intel_vga.h"
+#include "intel_tc.h"
+#include "vlv_sideband.h"
+#include "vlv_sideband_reg.h"
+
+struct i915_power_well_regs {
+     i915_reg_t bios;
+     i915_reg_t driver;
+     i915_reg_t kvmr;
+     i915_reg_t debug;
+};
+
+struct i915_power_well_ops {
+     const struct i915_power_well_regs *regs;
+     /*
+      * Synchronize the well's hw state to match the current sw

state, for
+ * example enable/disable it based on the current refcount.
Called
+ * during driver init and resume time, possibly after first
calling

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+      * the enable/disable handlers.
+      */
+     void (*sync_hw)(struct drm_i915_private *i915,
+                     struct i915_power_well *power_well);
+     /*
+      * Enable the well and resources that depend on it (for example
+      * interrupts located on the well). Called after the 0->1

refcount

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+      * transition.
+      */
+     void (*enable)(struct drm_i915_private *i915,
+                    struct i915_power_well *power_well);
+     /*
+      * Disable the well and resources that depend on it. Called

after

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0
+      * the 1->0 refcount transition.
+      */
+     void (*disable)(struct drm_i915_private *i915,
+                     struct i915_power_well *power_well);
+     /* Returns the hw enabled state. */
+     bool (*is_enabled)(struct drm_i915_private *i915,
+                        struct i915_power_well *power_well);
+};
 
 struct i915_power_well *
 lookup_power_well(struct drm_i915_private *i915,
@@ -111,3 +162,1769 @@ int intel_power_well_refcount(struct
 i915_power_well *power_well)
 {
      return power_well->count;
 }
+
+/*
+ * Starting with Haswell, we have a "Power Down Well" that can be

turned off
+ * when not needed anymore. We have 4 registers that can request the power well
+ * to be enabled, and it will only be disabled if none of the registers is
+ * requesting it to be enabled.
+ */
+static void hsw_power_well_post_enable(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+                                    u8 irq_pipe_mask, bool has_vga)
+{
+     if (has_vga)
+             intel_vga_reset_io_mem(dev_priv);
+
+     if (irq_pipe_mask)
+             gen8_irq_power_well_post_enable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+}
+
+static void hsw_power_well_pre_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+                                    u8 irq_pipe_mask)
+{
+     if (irq_pipe_mask)
+             gen8_irq_power_well_pre_disable(dev_priv,

irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0
+}
+
+#define ICL_AUX_PW_TO_CH(pw_idx)     \
+     ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
+
+#define ICL_TBT_AUX_PW_TO_CH(pw_idx) \
+     ((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
+
+static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+{
+     int pw_idx = power_well->desc->hsw.idx;
+
+     return power_well->desc->hsw.is_tc_tbt ?

ICL_TBT_AUX_PW_TO_CH(pw_idx) :
+ ICL_AUX_PW_TO_CH(pw_id
x);

drivers/gpu/drm/i915/display/intel_display_power_well.c +31 -0
+}
+
+static struct intel_digital_port *
+aux_ch_to_digital_port(struct drm_i915_private *dev_priv,
+                    enum aux_ch aux_ch)
+{
+     struct intel_digital_port *dig_port = NULL;
+     struct intel_encoder *encoder;
+
+     for_each_intel_encoder(&dev_priv->drm, encoder) {
+             /* We'll check the MST primary port */
+             if (encoder->type == INTEL_OUTPUT_DP_MST)
+                     continue;
+
+             dig_port = enc_to_dig_port(encoder);
+             if (!dig_port)
+                     continue;
+
+             if (dig_port->aux_ch != aux_ch) {
+                     dig_port = NULL;
+                     continue;
+             }
+
+             break;
+     }
+
+     return dig_port;
+}
+
+static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
+                               const struct i915_power_well

*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+{
+     enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
+     struct intel_digital_port *dig_port =

aux_ch_to_digital_port(i915, aux_ch);

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+
+     return intel_port_to_phy(i915, dig_port->base.port);
+}
+
+static void hsw_wait_for_power_well_enable(struct drm_i915_private

*dev_priv,
+ struct i915_power_well
*power_well,

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+                                        bool timeout_expected)
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     int enable_delay = power_well->desc->hsw.fixed_enable_delay;
+
+     /*
+      * For some power wells we're not supposed to watch the status

bit for

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0
+      * an ack, but rather just wait a fixed amount of time and then
+      * proceed.  This is only used on DG2.
+      */
+     if (IS_DG2(dev_priv) && enable_delay) {
+             usleep_range(enable_delay, 2 * enable_delay);
+             return;
+     }
+
+     /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us.

*/

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+     if (intel_de_wait_for_set(dev_priv, regs->driver,
+                               HSW_PWR_WELL_CTL_STATE(pw_idx), 1)) {
+             drm_dbg_kms(&dev_priv->drm, "%s power well enable

timeout\n",

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0
+                         intel_power_well_name(power_well));
+
+             drm_WARN_ON(&dev_priv->drm, !timeout_expected);
+
+     }
+}
+
+static u32 hsw_power_well_requesters(struct drm_i915_private

*dev_priv,
+ const struct i915_power_well_regs
*regs,

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+                                  int pw_idx)
+{
+     u32 req_mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
+     u32 ret;
+
+     ret = intel_de_read(dev_priv, regs->bios) & req_mask ? 1 : 0;
+     ret |= intel_de_read(dev_priv, regs->driver) & req_mask ? 2 :

0;

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+     if (regs->kvmr.reg)
+             ret |= intel_de_read(dev_priv, regs->kvmr) & req_mask ?

4 : 0;

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+     ret |= intel_de_read(dev_priv, regs->debug) & req_mask ? 8 : 0;
+
+     return ret;
+}
+
+static void hsw_wait_for_power_well_disable(struct drm_i915_private

*dev_priv,
+ struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     bool disabled;
+     u32 reqs;
+
+     /*
+      * Bspec doesn't require waiting for PWs to get disabled, but

still do
+ * this for paranoia. The known cases where a PW will be forced
on:
+ * - a KVMR request on any power well via the KVMR request
register
+ * - a DMC request on PW1 and MISC_IO power wells via the BIOS
and

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+      *   DEBUG request registers
+      * Skip the wait in case any of the request bits are set and

print a

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+      * diagnostic message.
+      */
+     wait_for((disabled = !(intel_de_read(dev_priv, regs->driver) &
+                            HSW_PWR_WELL_CTL_STATE(pw_idx))) ||
+              (reqs = hsw_power_well_requesters(dev_priv, regs,

pw_idx)), 1);

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+     if (disabled)
+             return;
+
+     drm_dbg_kms(&dev_priv->drm,
+                 "%s forced on (bios:%d driver:%d kvmr:%d

debug:%d)\n",

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+                 intel_power_well_name(power_well),
+                 !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs &

8));

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+}
+
+static void gen9_wait_for_power_well_fuses(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+                                        enum skl_power_gate pg)
+{
+     /* Timeout 5us for PG#0, for other PGs 1us */
+     drm_WARN_ON(&dev_priv->drm,
+                 intel_de_wait_for_set(dev_priv, SKL_FUSE_STATUS,
+                                       SKL_FUSE_PG_DIST_STATUS(pg),

1));

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+}
+
+static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
+                               struct i915_power_well *power_well)
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     u32 val;
+
+     if (power_well->desc->hsw.has_fuses) {
+             enum skl_power_gate pg;
+
+             pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :
+ SKL_PW_CTL_IDX_TO_PG(p
w_idx);

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+
+             /* Wa_16013190616:adlp */
+             if (IS_ALDERLAKE_P(dev_priv) && pg == SKL_PG1)
+                     intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, 0,

DISABLE_FLR_SRC);

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+
+             /*
+              * For PW1 we have to wait both for the PW0/PG0 fuse

state
+ * before enabling the power well and PW1/PG1's own
fuse
+ * state after the enabling. For all other power wells
with
+ * fuses we only have to wait for that PW/PG's fuse
state

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+              * after the enabling.
+              */
+             if (pg == SKL_PG1)
+                     gen9_wait_for_power_well_fuses(dev_priv,

SKL_PG0);

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0
+     }
+
+     val = intel_de_read(dev_priv, regs->driver);
+     intel_de_write(dev_priv, regs->driver,
+                    val | HSW_PWR_WELL_CTL_REQ(pw_idx));
+
+     hsw_wait_for_power_well_enable(dev_priv, power_well, false);
+
+     if (power_well->desc->hsw.has_fuses) {
+             enum skl_power_gate pg;
+
+             pg = DISPLAY_VER(dev_priv) >= 11 ?

ICL_PW_CTL_IDX_TO_PG(pw_idx) :
+ SKL_PW_CTL_IDX_TO_PG(p
w_idx);

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0
+             gen9_wait_for_power_well_fuses(dev_priv, pg);
+     }
+
+     hsw_power_well_post_enable(dev_priv,
+                                power_well->desc->hsw.irq_pipe_mask,
+                                power_well->desc->hsw.has_vga);
+}
+
+static void hsw_power_well_disable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+                                struct i915_power_well *power_well)
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     u32 val;
+
+     hsw_power_well_pre_disable(dev_priv,
+                                power_well->desc-
Quoted 1 line

hsw.irq_pipe_mask);

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0
+
+     val = intel_de_read(dev_priv, regs->driver);
+     intel_de_write(dev_priv, regs->driver,
+                    val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
+     hsw_wait_for_power_well_disable(dev_priv, power_well);
+}
+
+static void
+icl_combo_phy_aux_power_well_enable(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+                                 struct i915_power_well *power_well)
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
+     u32 val;
+
+     drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
+
+     val = intel_de_read(dev_priv, regs->driver);
+     intel_de_write(dev_priv, regs->driver,
+                    val | HSW_PWR_WELL_CTL_REQ(pw_idx));
+
+     if (DISPLAY_VER(dev_priv) < 12) {
+             val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
+             intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
+                            val | ICL_LANE_ENABLE_AUX);
+     }
+
+     hsw_wait_for_power_well_enable(dev_priv, power_well, false);
+
+     /* Display WA #1178: icl */
+     if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <=

ICL_PW_CTL_IDX_AUX_B &&

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+         !intel_bios_is_port_edp(dev_priv, (enum port)phy)) {
+             val = intel_de_read(dev_priv,

ICL_AUX_ANAOVRD1(pw_idx));
+ val |= ICL_AUX_ANAOVRD1_ENABLE |
ICL_AUX_ANAOVRD1_LDO_BYPASS;
+ intel_de_write(dev_priv, ICL_AUX_ANAOVRD1(pw_idx),
val);

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+     }
+}
+
+static void
+icl_combo_phy_aux_power_well_disable(struct drm_i915_private

*dev_priv,
+ struct i915_power_well
*power_well)

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0
+{
+     const struct i915_power_well_regs *regs = power_well->desc-
Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0
+     int pw_idx = power_well->desc->hsw.idx;
+     enum phy phy = icl_aux_pw_to_phy(dev_priv, power_well);
+     u32 val;
+
+     drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
+
+     val = intel_de_read(dev_priv, ICL_PORT_CL_DW12(phy));
+     intel_de_write(dev_priv, ICL_PORT_CL_DW12(phy),
+                    val & ~ICL_LANE_ENABLE_AUX);
+
+     val = intel_de_read(dev_priv, regs->driver);
+     intel_de_write(dev_priv, regs->driver,
+                    val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));
+
+     hsw_wait_for_power_well_disable(dev_priv, power_well);
+}
+
+#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
+
+static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,
+ struct i915_power_well
*power_well,
+ struct intel_digital_port
*dig_port)

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+{
+     if (drm_WARN_ON(&dev_priv->drm, !dig_port))
+             return;
+
+     if (DISPLAY_VER(dev_priv) == 11 &&

intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0
+             return;
+
+     drm_WARN_ON(&dev_priv->drm, !intel_tc_port_ref_held(dig_port));
+}
+
+#else
+
+static void icl_tc_port_assert_ref_held(struct drm_i915_private

*dev_priv,
+ struct i915_power_well
*power_well,
+ struct intel_digital_port
*dig_port)

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0
+{
+}
+
+#endif
+
+#define TGL_AUX_PW_TO_TC_PORT(pw_idx)        ((pw_idx) -

TGL_PW_CTL_IDX_AUX_TC1)

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+
+static void icl_tc_cold_exit(struct drm_i915_private *i915)
+{
+     int ret, tries = 0;
+
+     while (1) {
+             ret = snb_pcode_write_timeout(i915,

ICL_PCODE_EXIT_TCCOLD, 0,

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0
+                                           250, 1);
+             if (ret != -EAGAIN || ++tries == 3)
+                     break;
+             msleep(1);
+     }
+
+     /* Spec states that TC cold exit can take up to 1ms to complete

*/

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+     if (!ret)
+             msleep(1);
+
+     /* TODO: turn failure into a error as soon i915 CI updates ICL

IFWI */

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0
+     drm_dbg_kms(&i915->drm, "TC cold block %s\n", ret ? "failed" :
+                 "succeeded");
+}
+
+static void
+icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
+                              struct i915_power_well *power_well)
+{
+     enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
+     struct intel_digital_port *dig_port =

aux_ch_to_digital_port(dev_priv, aux_ch);
+ const struct i915_power_well_regs *regs = power_well->desc-

Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0
+     bool is_tbt = power_well->desc->hsw.is_tc_tbt;
+     bool timeout_expected;
+     u32 val;
+
+     icl_tc_port_assert_ref_held(dev_priv, power_well, dig_port);
+
+     val = intel_de_read(dev_priv, DP_AUX_CH_CTL(aux_ch));
+     val &= ~DP_AUX_CH_CTL_TBT_IO;
+     if (is_tbt)
+             val |= DP_AUX_CH_CTL_TBT_IO;
+     intel_de_write(dev_priv, DP_AUX_CH_CTL(aux_ch), val);
+
+     val = intel_de_read(dev_priv, regs->driver);
+     intel_de_write(dev_priv, regs->driver,
+                    val | HSW_PWR_WELL_CTL_REQ(power_well->desc-
Quoted 1 line

hsw.idx));

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0
+
+     /*
+      * An AUX timeout is expected if the TBT DP tunnel is down,
+      * or need to enable AUX on a legacy TypeC port as part of the

TC-cold

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+      * exit sequence.
+      */
+     timeout_expected = is_tbt ||

intel_tc_cold_requires_aux_pw(dig_port);
+ if (DISPLAY_VER(dev_priv) == 11 &&
intel_tc_cold_requires_aux_pw(dig_port))

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0
+             icl_tc_cold_exit(dev_priv);
+
+     hsw_wait_for_power_well_enable(dev_priv, power_well,

timeout_expected);

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0
+
+     if (DISPLAY_VER(dev_priv) >= 12 && !is_tbt) {
+             enum tc_port tc_port;
+
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 1 line

hsw.idx);

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DKL_CMN_UC_DW_27(tc_port),
+ DKL_CMN_UC_DW27_UC_HEALTH,
1))

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

aux_ch_to_digital_port(dev_priv, aux_ch);

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

power_well);

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

power_well);

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

;

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

hardware to
+ * enable it, so check if it's enabled and also check if we've requested it to
+ * be enabled.
+ */
+static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 1 line

ops->regs;

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

for PW1
+ * and the MISC_IO PW will be not restored, so check instead
for the
+ * BIOS's own request bits, which are forced-on for these power
wells

drivers/gpu/drm/i915/display/intel_display_power_well.c +13 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DC_STATE_EN_DC9),

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

enter DC9

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mode set

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*dev_priv)

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

indeed

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

mode

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

until

drivers/gpu/drm/i915/display/intel_display_power_well.c +54 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

gen9_dc_mask(dev_priv);

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

@state.
+ * DMC/HW can turn off individual display clocks and power rails when entering
+ * a deeper DC power state (higher in number) and turns these back when exiting
+ * that state to a shallower power state (lower in number). The HW will decide
+ * when to actually enter a given state on an on-demand basis, for instance
+ * depending on the active state of display pipes. The state of display
+ * registers backed by affected power rails are saved/restored as needed.
+ *
+ * Based on the above enabling a deeper DC power state is asynchronous wrt.
+ * enabling it. Disabling a deeper power state is synchronous: for instance
+ * setting %DC_STATE_DISABLE won't complete until all HW resources are turned
+ * back on and register state is restored. This is guaranteed by the MMIO write
+ * to DC_STATE_EN blocking until the state is restored.
+ */

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

%02x\n",

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

0x%x)\n",

drivers/gpu/drm/i915/display/intel_display_power_well.c +36 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 1 line

dmc.dmc_info[DMC_FW_MAIN].start_mmioaddr, 0)),

+ "DMC program storage start is
NULL\n");
+ drm_WARN_ONCE(&dev_priv->drm, !intel_de_read(dev_priv,
DMC_SSP_BASE),

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

DMC_HTP_SKL),

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

entry */

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

high_pg),
+ "Power wells above platform's DC5 limit still
enabled.\n");

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

UTIL_PIN_ENABLE,

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

GEN8_CHICKEN_DCPR_1) | SKL_SELECT_ALTERNATE_DC_EXIT);

drivers/gpu/drm/i915/display/intel_display_power_well.c +31 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

*dev_priv,

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +10 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +20 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +18 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +12 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +14 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +15 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +30 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +11 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +19 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +9 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +27 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

11 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

5 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +4 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +7 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +17 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +39 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +5 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +21 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +6 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

3 lines not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +25 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +30 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

1 line not shown · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +3 -0

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Quoted 8 lines

7 lines not shown · raw message

465 lines not shown · raw message

Parts of this message are not shown here. View the raw message.

author
#15 lore raw

PATCH v2 10/26 drm/i915: Unexport the for_each_power_well() macros

In reply to Imre Deak

The for_each_power_well() macros are only used in intel_display_power.c and intel_display_power_well.c, so unexport them.

---
 .../drm/i915/display/intel_display_power.c    |  8 ++++++++
 .../drm/i915/display/intel_display_power.h    | 20 -------------------
 .../i915/display/intel_display_power_well.h   | 12 +++++++++++
 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +8 -0
index 3414013e7f449..611729cf767c0 100644
@@ -18,6 +18,14 @@
 #include "intel_snps_phy.h"
 #include "vlv_sideband.h"
 
+#define for_each_power_domain_well(__dev_priv, __power_well, __domain_mask)	\
+	for_each_power_well(__dev_priv, __power_well)				\
+		for_each_if((__power_well)->desc->domains & (__domain_mask))
+
+#define for_each_power_domain_well_reverse(__dev_priv, __power_well, __domain_mask) \
+	for_each_power_well_reverse(__dev_priv, __power_well)		        \
+		for_each_if((__power_well)->desc->domains & (__domain_mask))
+
 const char *
 intel_display_power_domain_str(enum intel_display_power_domain domain)
 {
drivers/gpu/drm/i915/display/intel_display_power.h +0 -20
index ced384b0a1658..a3d48c47f0acd 100644
@@ -172,26 +172,6 @@ struct intel_display_power_domain_set {
 	for ((domain) = 0; (domain) < POWER_DOMAIN_NUM; (domain)++)	\
 		for_each_if(BIT_ULL(domain) & (mask))
 
-#define for_each_power_well(__dev_priv, __power_well)				\
-	for ((__power_well) = (__dev_priv)->power_domains.power_wells;	\
-	     (__power_well) - (__dev_priv)->power_domains.power_wells <	\
-		(__dev_priv)->power_domains.power_well_count;		\
-	     (__power_well)++)
-
-#define for_each_power_well_reverse(__dev_priv, __power_well)			\
-	for ((__power_well) = (__dev_priv)->power_domains.power_wells +		\
-			      (__dev_priv)->power_domains.power_well_count - 1;	\
-	     (__power_well) - (__dev_priv)->power_domains.power_wells >= 0;	\
-	     (__power_well)--)
-
-#define for_each_power_domain_well(__dev_priv, __power_well, __domain_mask)	\
-	for_each_power_well(__dev_priv, __power_well)				\
-		for_each_if((__power_well)->desc->domains & (__domain_mask))
-
-#define for_each_power_domain_well_reverse(__dev_priv, __power_well, __domain_mask) \
-	for_each_power_well_reverse(__dev_priv, __power_well)		        \
-		for_each_if((__power_well)->desc->domains & (__domain_mask))
-
 int intel_power_domains_init(struct drm_i915_private *dev_priv);
 void intel_power_domains_cleanup(struct drm_i915_private *dev_priv);
 void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume);
drivers/gpu/drm/i915/display/intel_display_power_well.h +12 -0
index 2c0e53fb976c4..473b65269896c 100644
@@ -12,6 +12,18 @@
 struct drm_i915_private;
 struct i915_power_well;
 
+#define for_each_power_well(__dev_priv, __power_well)				\
+	for ((__power_well) = (__dev_priv)->power_domains.power_wells;	\
+	     (__power_well) - (__dev_priv)->power_domains.power_wells <	\
+		(__dev_priv)->power_domains.power_well_count;		\
+	     (__power_well)++)
+
+#define for_each_power_well_reverse(__dev_priv, __power_well)			\
+	for ((__power_well) = (__dev_priv)->power_domains.power_wells +		\
+			      (__dev_priv)->power_domains.power_well_count - 1;	\
+	     (__power_well) - (__dev_priv)->power_domains.power_wells >= 0;	\
+	     (__power_well)--)
+
 /*
  * i915_power_well_id:
  *
Signature · 1 line
2.27.0
author
#16 lore raw

PATCH v2 11/26 drm/i915: Move the power domain->well mappings to intel_display_power_map.c

In reply to Imre Deak

Move the list of platform specific power domain -> power well definitions to intel_display_power_map.c. While at it group the platforms' power domain macros with the corresponding power well lists and keep all the power domain lists in the same order (matching the enum order).

No functional changes.

v2:
- s/intel_display_power_internal.h/intel_display_power_map.h/ (Jani)
- Simplify intel_cleanup_power_wells().
- Don't move intel_display_power_domain_str().

---
 drivers/gpu/drm/i915/Makefile                 |    1 +
 .../drm/i915/display/intel_display_power.c    | 2260 +----------------
 .../i915/display/intel_display_power_map.c    | 2136 ++++++++++++++++
 .../i915/display/intel_display_power_map.h    |   14 +
 4 files changed, 2154 insertions(+), 2257 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_map.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_power_map.h
drivers/gpu/drm/i915/Makefile +1 -0
index 71aeb94d0d734..df3492394d326 100644
@@ -210,6 +210,7 @@ i915-y += \
 	display/intel_cursor.o \
 	display/intel_display.o \
 	display/intel_display_power.o \
+	display/intel_display_power_map.o \
 	display/intel_display_power_well.o \
 	display/intel_dmc.o \
 	display/intel_dpio_phy.o \
drivers/gpu/drm/i915/display/intel_display_power.c +3 -2257

2,296 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_map.c new file +2136 -0

697 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_map.h new file +14 -0
new file mode 100644
index 0000000000000..05eda3a553ebd

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.27.0

Part of the diff is not shown here. View the raw message.

author
#17 lore raw

PATCH v2 12/26 drm/i915: Move the dg2 fixed_enable_delay power well param to a common bitfield

In reply to Imre Deak

The DG2 fixed delay duration is always 600usec, so save some space in the power well descriptors by converting the parameter to a flag. While at it also use a bitfield for both the always_on and fixed_enable_delay flag.

This change also lets simplifying the definiton of power wells sharing the same flags in an upcoming patch.

---
 .../gpu/drm/i915/display/intel_display_power_map.c | 10 +++++-----
 .../drm/i915/display/intel_display_power_well.c    |  5 ++---
 .../drm/i915/display/intel_display_power_well.h    | 14 +++++++-------
 3 files changed, 14 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power_map.c +5 -5
index 998cc7ad399f0..18fa146fb761f 100644
@@ -1920,37 +1920,37 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.name = "AUX A",
 		.domains = ICL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.fixed_enable_delay = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
-			.hsw.fixed_enable_delay = 600,
 		},
 	}, {
 		.name = "AUX B",
 		.domains = ICL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.fixed_enable_delay = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
-			.hsw.fixed_enable_delay = 600,
 		},
 	}, {
 		.name = "AUX C",
 		.domains = TGL_AUX_C_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.fixed_enable_delay = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
-			.hsw.fixed_enable_delay = 600,
 		},
 	}, {
 		.name = "AUX D_XELPD",
 		.domains = XELPD_AUX_IO_D_XELPD_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.fixed_enable_delay = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = XELPD_PW_CTL_IDX_AUX_D,
-			.hsw.fixed_enable_delay = 600,
 		},
 	}, {
 		.name = "AUX E_XELPD",
@@ -1964,10 +1964,10 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.name = "AUX USBC1",
 		.domains = XELPD_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.fixed_enable_delay = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
-			.hsw.fixed_enable_delay = 600,
 		},
 	}, {
 		.name = "AUX USBC2",
drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -3
index a92bb807f1972..0e13c15edfdd2 100644
@@ -242,15 +242,14 @@ static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
 {
 	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
 	int pw_idx = power_well->desc->hsw.idx;
-	int enable_delay = power_well->desc->hsw.fixed_enable_delay;
 
 	/*
 	 * For some power wells we're not supposed to watch the status bit for
 	 * an ack, but rather just wait a fixed amount of time and then
 	 * proceed.  This is only used on DG2.
 	 */
-	if (IS_DG2(dev_priv) && enable_delay) {
-		usleep_range(enable_delay, 2 * enable_delay);
+	if (IS_DG2(dev_priv) && power_well->desc->fixed_enable_delay) {
+		usleep_range(600, 1200);
 		return;
 	}
 
drivers/gpu/drm/i915/display/intel_display_power_well.h +7 -7
index 473b65269896c..b3d8baa2b7d41 100644
@@ -50,8 +50,14 @@ enum i915_power_well_id {
 
 struct i915_power_well_desc {
 	const char *name;
-	bool always_on;
 	u64 domains;
+	u8 always_on:1;
+	/*
+	 * Instead of waiting for the status bit to ack enables,
+	 * just wait a specific amount of time and then consider
+	 * the well enabled.
+	 */
+	u8 fixed_enable_delay:1;
 	/* unique identifier for this power well */
 	enum i915_power_well_id id;
 	/*
@@ -77,12 +83,6 @@ struct i915_power_well_desc {
 			u8 idx;
 			/* Mask of pipes whose IRQ logic is backed by the pw */
 			u8 irq_pipe_mask;
-			/*
-			 * Instead of waiting for the status bit to ack enables,
-			 * just wait a specific amount of time and then consider
-			 * the well enabled.
-			 */
-			u16 fixed_enable_delay;
 			/* The pw is backing the VGA functionality */
 			bool has_vga:1;
 			bool has_fuses:1;
Signature · 1 line
2.27.0
author
#18 lore raw

PATCH v2 13/26 drm/i915: Move the HSW power well flags to a common bitfield

In reply to Imre Deak

Save some space by grouping the HSW power well descriptor flags along with other flags in one bitfield.

This change also lets simplifying the definition of power well descriptors sharing the same flags in an upcoming patch.

---
 .../i915/display/intel_display_power_map.c    | 166 +++++++++---------
 .../i915/display/intel_display_power_well.c   |  16 +-
 .../i915/display/intel_display_power_well.h   |  25 +--
 3 files changed, 104 insertions(+), 103 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power_map.c +83 -83
index 18fa146fb761f..a098699d1c52c 100644
@@ -76,10 +76,10 @@ static const struct i915_power_well_desc hsw_power_wells[] = {
 		.name = "display",
 		.domains = HSW_DISPLAY_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
 		.id = HSW_DISP_PW_GLOBAL,
 		{
 			.hsw.idx = HSW_PW_CTL_IDX_GLOBAL,
-			.hsw.has_vga = true,
 		},
 	},
 };
@@ -112,11 +112,11 @@ static const struct i915_power_well_desc bdw_power_wells[] = {
 		.name = "display",
 		.domains = BDW_DISPLAY_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
 		.id = HSW_DISP_PW_GLOBAL,
 		{
 			.hsw.idx = HSW_PW_CTL_IDX_GLOBAL,
-			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
-			.hsw.has_vga = true,
 		},
 	},
 };
@@ -368,10 +368,10 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "MISC IO power well",
@@ -392,12 +392,12 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.name = "power well 2",
 		.domains = SKL_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
-			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DDI A/E IO power well",
@@ -484,10 +484,10 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -498,12 +498,12 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 		.name = "power well 2",
 		.domains = BXT_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
-			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "dpio-common-a",
@@ -594,10 +594,10 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -608,12 +608,12 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.name = "power well 2",
 		.domains = GLK_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
-			.hsw.irq_pipe_mask = BIT(PIPE_B) | BIT(PIPE_C),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "dpio-common-a",
@@ -789,10 +789,10 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -803,21 +803,21 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.name = "power well 2",
 		.domains = ICL_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well 3",
 		.domains = ICL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B),
+		.has_fuses = true,
 		.id = ICL_DISP_PW_3,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
-			.hsw.irq_pipe_mask = BIT(PIPE_B),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DDI A IO",
@@ -887,83 +887,83 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.name = "AUX C TC1",
 		.domains = ICL_AUX_C_TC1_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX D TC2",
 		.domains = ICL_AUX_D_TC2_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_D,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX E TC3",
 		.domains = ICL_AUX_E_TC3_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_E,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX F TC4",
 		.domains = ICL_AUX_F_TC4_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_F,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX C TBT1",
 		.domains = ICL_AUX_C_TBT1_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT1,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX D TBT2",
 		.domains = ICL_AUX_D_TBT2_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT2,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX E TBT3",
 		.domains = ICL_AUX_E_TBT3_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT3,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX F TBT4",
 		.domains = ICL_AUX_F_TBT4_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT4,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "power well 4",
 		.domains = ICL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_C),
+		.has_fuses = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_C),
 		},
 	},
 };
@@ -1077,10 +1077,10 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -1091,21 +1091,21 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.name = "power well 2",
 		.domains = TGL_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well 3",
 		.domains = TGL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.irq_pipe_mask = BIT(PIPE_B),
+		.has_fuses = true,
 		.id = ICL_DISP_PW_3,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
-			.hsw.irq_pipe_mask = BIT(PIPE_B),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DDI A IO",
@@ -1212,129 +1212,129 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.name = "AUX USBC1",
 		.domains = TGL_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC2",
 		.domains = TGL_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC3",
 		.domains = TGL_AUX_IO_USBC3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC3,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC4",
 		.domains = TGL_AUX_IO_USBC4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC4,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC5",
 		.domains = TGL_AUX_IO_USBC5_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC5,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC6",
 		.domains = TGL_AUX_IO_USBC6_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC6,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX TBT1",
 		.domains = TGL_AUX_IO_TBT1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT2",
 		.domains = TGL_AUX_IO_TBT2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT3",
 		.domains = TGL_AUX_IO_TBT3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT4",
 		.domains = TGL_AUX_IO_TBT4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT4,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT5",
 		.domains = TGL_AUX_IO_TBT5_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT5,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT6",
 		.domains = TGL_AUX_IO_TBT6_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT6,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "power well 4",
 		.domains = TGL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
+		.irq_pipe_mask = BIT(PIPE_C),
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_C),
 		}
 	}, {
 		.name = "power well 5",
 		.domains = TGL_PW_5_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
+		.irq_pipe_mask = BIT(PIPE_D),
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_PW_5,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_D),
 		},
 	},
 };
@@ -1400,10 +1400,10 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -1414,22 +1414,22 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.name = "power well 3",
 		.domains = RKL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_B),
+		.has_vga = true,
+		.has_fuses = true,
 		.id = ICL_DISP_PW_3,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
-			.hsw.irq_pipe_mask = BIT(PIPE_B),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well 4",
 		.domains = RKL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
+		.irq_pipe_mask = BIT(PIPE_C),
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_C),
 		}
 	}, {
 		.name = "DDI A IO",
@@ -1540,10 +1540,10 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -1554,21 +1554,21 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.name = "power well 2",
 		.domains = DG1_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well 3",
 		.domains = DG1_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_B),
+		.has_vga = true,
+		.has_fuses = true,
 		.id = ICL_DISP_PW_3,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
-			.hsw.irq_pipe_mask = BIT(PIPE_B),
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DDI A IO",
@@ -1622,39 +1622,39 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.name = "AUX USBC1",
 		.domains = TGL_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "AUX USBC2",
 		.domains = TGL_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = false,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
-			.hsw.is_tc_tbt = false,
 		},
 	}, {
 		.name = "power well 4",
 		.domains = TGL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
+		.irq_pipe_mask = BIT(PIPE_C),
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_C),
 		}
 	}, {
 		.name = "power well 5",
 		.domains = TGL_PW_5_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_fuses = true,
+		.irq_pipe_mask = BIT(PIPE_D),
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_PW_5,
-			.hsw.has_fuses = true,
-			.hsw.irq_pipe_mask = BIT(PIPE_D),
 		},
 	},
 };
@@ -1784,10 +1784,10 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
 		.always_on = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_1,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DC off",
@@ -1798,51 +1798,51 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.name = "power well 2",
 		.domains = XELPD_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.has_vga = true,
+		.has_fuses = true,
 		.id = SKL_DISP_PW_2,
 		{
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
-			.hsw.has_vga = true,
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well A",
 		.domains = XELPD_PW_A_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_A),
+		.has_fuses = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_A,
-			.hsw.irq_pipe_mask = BIT(PIPE_A),
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well B",
 		.domains = XELPD_PW_B_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_B),
+		.has_fuses = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_B,
-			.hsw.irq_pipe_mask = BIT(PIPE_B),
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well C",
 		.domains = XELPD_PW_C_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_C),
+		.has_fuses = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_C,
-			.hsw.irq_pipe_mask = BIT(PIPE_C),
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "power well D",
 		.domains = XELPD_PW_D_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
+		.irq_pipe_mask = BIT(PIPE_D),
+		.has_fuses = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_D,
-			.hsw.irq_pipe_mask = BIT(PIPE_D),
-			.hsw.has_fuses = true,
 		},
 	}, {
 		.name = "DDI A IO",
@@ -1997,37 +1997,37 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.name = "AUX TBT1",
 		.domains = XELPD_AUX_IO_TBT1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT2",
 		.domains = XELPD_AUX_IO_TBT2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT3",
 		.domains = XELPD_AUX_IO_TBT3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
-			.hsw.is_tc_tbt = true,
 		},
 	}, {
 		.name = "AUX TBT4",
 		.domains = XELPD_AUX_IO_TBT4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
+		.is_tc_tbt = true,
 		.id = DISP_PW_ID_NONE,
 		{
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT4,
-			.hsw.is_tc_tbt = true,
 		},
 	},
 };
drivers/gpu/drm/i915/display/intel_display_power_well.c +8 -8
index 0e13c15edfdd2..8d9bc7a654106 100644
@@ -196,8 +196,8 @@ static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well *power_well)
 {
 	int pw_idx = power_well->desc->hsw.idx;
 
-	return power_well->desc->hsw.is_tc_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
-						 ICL_AUX_PW_TO_CH(pw_idx);
+	return power_well->desc->is_tc_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
+					     ICL_AUX_PW_TO_CH(pw_idx);
 }
 
 static struct intel_digital_port *
@@ -325,7 +325,7 @@ static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
 	int pw_idx = power_well->desc->hsw.idx;
 	u32 val;
 
-	if (power_well->desc->hsw.has_fuses) {
+	if (power_well->desc->has_fuses) {
 		enum skl_power_gate pg;
 
 		pg = DISPLAY_VER(dev_priv) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
@@ -352,7 +352,7 @@ static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
 
 	hsw_wait_for_power_well_enable(dev_priv, power_well, false);
 
-	if (power_well->desc->hsw.has_fuses) {
+	if (power_well->desc->has_fuses) {
 		enum skl_power_gate pg;
 
 		pg = DISPLAY_VER(dev_priv) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
@@ -361,8 +361,8 @@ static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
 	}
 
 	hsw_power_well_post_enable(dev_priv,
-				   power_well->desc->hsw.irq_pipe_mask,
-				   power_well->desc->hsw.has_vga);
+				   power_well->desc->irq_pipe_mask,
+				   power_well->desc->has_vga);
 }
 
 static void hsw_power_well_disable(struct drm_i915_private *dev_priv,
@@ -373,7 +373,7 @@ static void hsw_power_well_disable(struct drm_i915_private *dev_priv,
 	u32 val;
 
 	hsw_power_well_pre_disable(dev_priv,
-				   power_well->desc->hsw.irq_pipe_mask);
+				   power_well->desc->irq_pipe_mask);
 
 	val = intel_de_read(dev_priv, regs->driver);
 	intel_de_write(dev_priv, regs->driver,
@@ -490,7 +490,7 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
 	enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
 	struct intel_digital_port *dig_port = aux_ch_to_digital_port(dev_priv, aux_ch);
 	const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
-	bool is_tbt = power_well->desc->hsw.is_tc_tbt;
+	bool is_tbt = power_well->desc->is_tc_tbt;
 	bool timeout_expected;
 	u32 val;
 
drivers/gpu/drm/i915/display/intel_display_power_well.h +13 -12
index b3d8baa2b7d41..f46d82f697678 100644
@@ -51,13 +51,24 @@ enum i915_power_well_id {
 struct i915_power_well_desc {
 	const char *name;
 	u64 domains;
-	u8 always_on:1;
+	/* Mask of pipes whose IRQ logic is backed by the pw */
+	u16 irq_pipe_mask:4;
+	u16 always_on:1;
 	/*
 	 * Instead of waiting for the status bit to ack enables,
 	 * just wait a specific amount of time and then consider
 	 * the well enabled.
 	 */
-	u8 fixed_enable_delay:1;
+	u16 fixed_enable_delay:1;
+	/* The pw is backing the VGA functionality */
+	u16 has_vga:1;
+	u16 has_fuses:1;
+	/*
+	 * The pw is for an ICL+ TypeC PHY port in
+	 * Thunderbolt mode.
+	 */
+	u16 is_tc_tbt:1;
+
 	/* unique identifier for this power well */
 	enum i915_power_well_id id;
 	/*
@@ -81,16 +92,6 @@ struct i915_power_well_desc {
 			 * constrol/status registers.
 			 */
 			u8 idx;
-			/* Mask of pipes whose IRQ logic is backed by the pw */
-			u8 irq_pipe_mask;
-			/* The pw is backing the VGA functionality */
-			bool has_vga:1;
-			bool has_fuses:1;
-			/*
-			 * The pw is for an ICL+ TypeC PHY port in
-			 * Thunderbolt mode.
-			 */
-			bool is_tc_tbt:1;
 		} hsw;
 	};
 	const struct i915_power_well_ops *ops;
Signature · 1 line
2.27.0
author
#19 lore raw

PATCH v2 14/26 drm/i915: Rename the power domain names to end with pipes/ports

In reply to Imre Deak

Make all power domain names end with the pipe/port instance for consistency.

No functional changes.

---
 drivers/gpu/drm/i915/display/icl_dsi.c        |   8 +-
 drivers/gpu/drm/i915/display/intel_ddi.c      |   2 +-
 drivers/gpu/drm/i915/display/intel_display.c  |  34 ++--
 .../drm/i915/display/intel_display_power.c    | 116 +++++------
 .../drm/i915/display/intel_display_power.h    |  66 +++----
 .../i915/display/intel_display_power_map.c    | 184 +++++++++---------
 6 files changed, 205 insertions(+), 205 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +4 -4
index 2d5bb9195b20f..990671e7aba21 100644
@@ -398,8 +398,8 @@ static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv,
 		intel_dsi->io_wakeref[port] =
 			intel_display_power_get(dev_priv,
 						port == PORT_A ?
-						POWER_DOMAIN_PORT_DDI_A_IO :
-						POWER_DOMAIN_PORT_DDI_B_IO);
+						POWER_DOMAIN_PORT_DDI_IO_A :
+						POWER_DOMAIN_PORT_DDI_IO_B);
 	}
 }
 
@@ -1425,8 +1425,8 @@ static void gen11_dsi_disable_io_power(struct intel_encoder *encoder)
 		wakeref = fetch_and_zero(&intel_dsi->io_wakeref[port]);
 		intel_display_power_put(dev_priv,
 					port == PORT_A ?
-					POWER_DOMAIN_PORT_DDI_A_IO :
-					POWER_DOMAIN_PORT_DDI_B_IO,
+					POWER_DOMAIN_PORT_DDI_IO_A :
+					POWER_DOMAIN_PORT_DDI_IO_B,
 					wakeref);
 	}
 
drivers/gpu/drm/i915/display/intel_ddi.c +1 -1
index 354b08d6f81d0..a4784f98d7d37 100644
@@ -4477,7 +4477,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	}
 
 	drm_WARN_ON(&dev_priv->drm, port > PORT_I);
-	dig_port->ddi_io_power_domain = POWER_DOMAIN_PORT_DDI_A_IO +
+	dig_port->ddi_io_power_domain = POWER_DOMAIN_PORT_DDI_IO_A +
 					      port - PORT_A;
 
 	if (init_dp) {
drivers/gpu/drm/i915/display/intel_display.c +17 -17
index 7f512f9e9e5c7..e2f1e9415415e 100644
@@ -2304,23 +2304,23 @@ enum intel_display_power_domain intel_port_to_power_domain(enum port port)
 {
 	switch (port) {
 	case PORT_A:
-		return POWER_DOMAIN_PORT_DDI_A_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_A;
 	case PORT_B:
-		return POWER_DOMAIN_PORT_DDI_B_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_B;
 	case PORT_C:
-		return POWER_DOMAIN_PORT_DDI_C_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_C;
 	case PORT_D:
-		return POWER_DOMAIN_PORT_DDI_D_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_D;
 	case PORT_E:
-		return POWER_DOMAIN_PORT_DDI_E_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_E;
 	case PORT_F:
-		return POWER_DOMAIN_PORT_DDI_F_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_F;
 	case PORT_G:
-		return POWER_DOMAIN_PORT_DDI_G_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_G;
 	case PORT_H:
-		return POWER_DOMAIN_PORT_DDI_H_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_H;
 	case PORT_I:
-		return POWER_DOMAIN_PORT_DDI_I_LANES;
+		return POWER_DOMAIN_PORT_DDI_LANES_I;
 	default:
 		MISSING_CASE(port);
 		return POWER_DOMAIN_PORT_OTHER;
@@ -2333,22 +2333,22 @@ intel_aux_power_domain(struct intel_digital_port *dig_port)
 	if (intel_tc_port_in_tbt_alt_mode(dig_port)) {
 		switch (dig_port->aux_ch) {
 		case AUX_CH_C:
-			return POWER_DOMAIN_AUX_C_TBT;
+			return POWER_DOMAIN_AUX_TBT_C;
 		case AUX_CH_D:
-			return POWER_DOMAIN_AUX_D_TBT;
+			return POWER_DOMAIN_AUX_TBT_D;
 		case AUX_CH_E:
-			return POWER_DOMAIN_AUX_E_TBT;
+			return POWER_DOMAIN_AUX_TBT_E;
 		case AUX_CH_F:
-			return POWER_DOMAIN_AUX_F_TBT;
+			return POWER_DOMAIN_AUX_TBT_F;
 		case AUX_CH_G:
-			return POWER_DOMAIN_AUX_G_TBT;
+			return POWER_DOMAIN_AUX_TBT_G;
 		case AUX_CH_H:
-			return POWER_DOMAIN_AUX_H_TBT;
+			return POWER_DOMAIN_AUX_TBT_H;
 		case AUX_CH_I:
-			return POWER_DOMAIN_AUX_I_TBT;
+			return POWER_DOMAIN_AUX_TBT_I;
 		default:
 			MISSING_CASE(dig_port->aux_ch);
-			return POWER_DOMAIN_AUX_C_TBT;
+			return POWER_DOMAIN_AUX_TBT_C;
 		}
 	}
 
drivers/gpu/drm/i915/display/intel_display_power.c +58 -58

134 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power.h +33 -33

99 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_map.c +92 -92

424 lines not on this page · raw message

Signature · 1 line
2.27.0
author
#20 lore raw

PATCH v2 15/26 drm/i915: Sanitize the power well names

In reply to Imre Deak

Use the shortest descriptive name for all power wells for simplicity and to use the same name for the same type of power wells on multiple platforms.

---
 .../i915/display/intel_display_power_map.c    | 254 +++++++++---------
 1 file changed, 127 insertions(+), 127 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power_map.c +127 -127
index df076816a92c3..6253ad846c613 100644
@@ -363,7 +363,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -374,7 +374,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "MISC IO power well",
+		.name = "MISC_IO",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -384,12 +384,12 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_MISC_IO,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = SKL_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = SKL_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -400,7 +400,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_PW_2,
 		},
 	}, {
-		.name = "DDI A/E IO power well",
+		.name = "DDI_IO_A_E",
 		.domains = SKL_DISPLAY_DDI_IO_A_E_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -408,7 +408,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_A_E,
 		},
 	}, {
-		.name = "DDI B IO power well",
+		.name = "DDI_IO_B",
 		.domains = SKL_DISPLAY_DDI_IO_B_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -416,7 +416,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_B,
 		},
 	}, {
-		.name = "DDI C IO power well",
+		.name = "DDI_IO_C",
 		.domains = SKL_DISPLAY_DDI_IO_C_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -424,7 +424,7 @@ static const struct i915_power_well_desc skl_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_C,
 		},
 	}, {
-		.name = "DDI D IO power well",
+		.name = "DDI_IO_D",
 		.domains = SKL_DISPLAY_DDI_IO_D_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -479,7 +479,7 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -490,12 +490,12 @@ static const struct i915_power_well_desc bxt_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = BXT_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = BXT_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -589,7 +589,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -600,12 +600,12 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = GLK_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = GLK_DISPLAY_POWERWELL_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -640,7 +640,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.bxt.phy = DPIO_PHY2,
 		},
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = GLK_DISPLAY_AUX_A_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -648,7 +648,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = GLK_DISPLAY_AUX_B_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -656,7 +656,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX C",
+		.name = "AUX_C",
 		.domains = GLK_DISPLAY_AUX_C_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -664,7 +664,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = GLK_PW_CTL_IDX_AUX_C,
 		},
 	}, {
-		.name = "DDI A IO power well",
+		.name = "DDI_IO_A",
 		.domains = GLK_DISPLAY_DDI_IO_A_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -672,7 +672,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = GLK_PW_CTL_IDX_DDI_A,
 		},
 	}, {
-		.name = "DDI B IO power well",
+		.name = "DDI_IO_B",
 		.domains = GLK_DISPLAY_DDI_IO_B_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -680,7 +680,7 @@ static const struct i915_power_well_desc glk_power_wells[] = {
 			.hsw.idx = SKL_PW_CTL_IDX_DDI_B,
 		},
 	}, {
-		.name = "DDI C IO power well",
+		.name = "DDI_IO_C",
 		.domains = GLK_DISPLAY_DDI_IO_C_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -784,7 +784,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -795,12 +795,12 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = ICL_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = ICL_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -809,7 +809,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 		},
 	}, {
-		.name = "power well 3",
+		.name = "PW_3",
 		.domains = ICL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -820,7 +820,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 		},
 	}, {
-		.name = "DDI A IO",
+		.name = "DDI_IO_A",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -828,7 +828,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		},
 	}, {
-		.name = "DDI B IO",
+		.name = "DDI_IO_B",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -836,7 +836,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		},
 	}, {
-		.name = "DDI C IO",
+		.name = "DDI_IO_C",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -844,7 +844,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		},
 	}, {
-		.name = "DDI D IO",
+		.name = "DDI_IO_D",
 		.domains = ICL_DDI_IO_D_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -852,7 +852,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_D,
 		},
 	}, {
-		.name = "DDI E IO",
+		.name = "DDI_IO_E",
 		.domains = ICL_DDI_IO_E_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -860,7 +860,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_E,
 		},
 	}, {
-		.name = "DDI F IO",
+		.name = "DDI_IO_F",
 		.domains = ICL_DDI_IO_F_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -868,7 +868,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_F,
 		},
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = ICL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -876,7 +876,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = ICL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -884,7 +884,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX C TC1",
+		.name = "AUX_C",
 		.domains = ICL_AUX_C_TC1_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -893,7 +893,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 		},
 	}, {
-		.name = "AUX D TC2",
+		.name = "AUX_D",
 		.domains = ICL_AUX_D_TC2_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -902,7 +902,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_D,
 		},
 	}, {
-		.name = "AUX E TC3",
+		.name = "AUX_E",
 		.domains = ICL_AUX_E_TC3_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -911,7 +911,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_E,
 		},
 	}, {
-		.name = "AUX F TC4",
+		.name = "AUX_F",
 		.domains = ICL_AUX_F_TC4_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -920,7 +920,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_F,
 		},
 	}, {
-		.name = "AUX C TBT1",
+		.name = "AUX_TBT1",
 		.domains = ICL_AUX_C_TBT1_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -929,7 +929,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT1,
 		},
 	}, {
-		.name = "AUX D TBT2",
+		.name = "AUX_TBT2",
 		.domains = ICL_AUX_D_TBT2_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -938,7 +938,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT2,
 		},
 	}, {
-		.name = "AUX E TBT3",
+		.name = "AUX_TBT3",
 		.domains = ICL_AUX_E_TBT3_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -947,7 +947,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT3,
 		},
 	}, {
-		.name = "AUX F TBT4",
+		.name = "AUX_TBT4",
 		.domains = ICL_AUX_F_TBT4_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -956,7 +956,7 @@ static const struct i915_power_well_desc icl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_TBT4,
 		},
 	}, {
-		.name = "power well 4",
+		.name = "PW_4",
 		.domains = ICL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_C),
@@ -1072,7 +1072,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -1083,12 +1083,12 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = TGL_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = TGL_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1097,7 +1097,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 		},
 	}, {
-		.name = "power well 3",
+		.name = "PW_3",
 		.domains = TGL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -1108,7 +1108,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 		},
 	}, {
-		.name = "DDI A IO",
+		.name = "DDI_IO_A",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1116,7 +1116,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	}, {
-		.name = "DDI B IO",
+		.name = "DDI_IO_B",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1124,7 +1124,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	}, {
-		.name = "DDI C IO",
+		.name = "DDI_IO_C",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1132,7 +1132,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		}
 	}, {
-		.name = "DDI IO TC1",
+		.name = "DDI_IO_TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1140,7 +1140,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	}, {
-		.name = "DDI IO TC2",
+		.name = "DDI_IO_TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1148,7 +1148,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	}, {
-		.name = "DDI IO TC3",
+		.name = "DDI_IO_TC3",
 		.domains = TGL_DDI_IO_TC3_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1156,7 +1156,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC3,
 		},
 	}, {
-		.name = "DDI IO TC4",
+		.name = "DDI_IO_TC4",
 		.domains = TGL_DDI_IO_TC4_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1164,7 +1164,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC4,
 		},
 	}, {
-		.name = "DDI IO TC5",
+		.name = "DDI_IO_TC5",
 		.domains = TGL_DDI_IO_TC5_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1172,7 +1172,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC5,
 		},
 	}, {
-		.name = "DDI IO TC6",
+		.name = "DDI_IO_TC6",
 		.domains = TGL_DDI_IO_TC6_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1180,12 +1180,12 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC6,
 		},
 	}, {
-		.name = "TC cold off",
+		.name = "TC_cold_off",
 		.domains = TGL_TC_COLD_OFF_POWER_DOMAINS,
 		.ops = &tgl_tc_cold_off_ops,
 		.id = TGL_DISP_PW_TC_COLD_OFF,
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = TGL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1193,7 +1193,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = TGL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1201,7 +1201,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX C",
+		.name = "AUX_C",
 		.domains = TGL_AUX_C_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1209,7 +1209,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 		},
 	}, {
-		.name = "AUX USBC1",
+		.name = "AUX_USBC1",
 		.domains = TGL_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1218,7 +1218,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 		},
 	}, {
-		.name = "AUX USBC2",
+		.name = "AUX_USBC2",
 		.domains = TGL_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1227,7 +1227,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 		},
 	}, {
-		.name = "AUX USBC3",
+		.name = "AUX_USBC3",
 		.domains = TGL_AUX_IO_USBC3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1236,7 +1236,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC3,
 		},
 	}, {
-		.name = "AUX USBC4",
+		.name = "AUX_USBC4",
 		.domains = TGL_AUX_IO_USBC4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1245,7 +1245,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC4,
 		},
 	}, {
-		.name = "AUX USBC5",
+		.name = "AUX_USBC5",
 		.domains = TGL_AUX_IO_USBC5_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1254,7 +1254,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC5,
 		},
 	}, {
-		.name = "AUX USBC6",
+		.name = "AUX_USBC6",
 		.domains = TGL_AUX_IO_USBC6_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1263,7 +1263,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC6,
 		},
 	}, {
-		.name = "AUX TBT1",
+		.name = "AUX_TBT1",
 		.domains = TGL_AUX_IO_TBT1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1272,7 +1272,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
 		},
 	}, {
-		.name = "AUX TBT2",
+		.name = "AUX_TBT2",
 		.domains = TGL_AUX_IO_TBT2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1281,7 +1281,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
 		},
 	}, {
-		.name = "AUX TBT3",
+		.name = "AUX_TBT3",
 		.domains = TGL_AUX_IO_TBT3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1290,7 +1290,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
 		},
 	}, {
-		.name = "AUX TBT4",
+		.name = "AUX_TBT4",
 		.domains = TGL_AUX_IO_TBT4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1299,7 +1299,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT4,
 		},
 	}, {
-		.name = "AUX TBT5",
+		.name = "AUX_TBT5",
 		.domains = TGL_AUX_IO_TBT5_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1308,7 +1308,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT5,
 		},
 	}, {
-		.name = "AUX TBT6",
+		.name = "AUX_TBT6",
 		.domains = TGL_AUX_IO_TBT6_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -1317,7 +1317,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT6,
 		},
 	}, {
-		.name = "power well 4",
+		.name = "PW_4",
 		.domains = TGL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1327,7 +1327,7 @@ static const struct i915_power_well_desc tgl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 		}
 	}, {
-		.name = "power well 5",
+		.name = "PW_5",
 		.domains = TGL_PW_5_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1395,7 +1395,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -1406,12 +1406,12 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = RKL_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 3",
+		.name = "PW_3",
 		.domains = RKL_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_B),
@@ -1422,7 +1422,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 		},
 	}, {
-		.name = "power well 4",
+		.name = "PW_4",
 		.domains = RKL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1432,7 +1432,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 		}
 	}, {
-		.name = "DDI A IO",
+		.name = "DDI_IO_A",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1440,7 +1440,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	}, {
-		.name = "DDI B IO",
+		.name = "DDI_IO_B",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1448,7 +1448,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	}, {
-		.name = "DDI IO TC1",
+		.name = "DDI_IO_TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1456,7 +1456,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	}, {
-		.name = "DDI IO TC2",
+		.name = "DDI_IO_TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1464,7 +1464,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = ICL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1472,7 +1472,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = ICL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1480,7 +1480,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX USBC1",
+		.name = "AUX_USBC1",
 		.domains = TGL_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1488,7 +1488,7 @@ static const struct i915_power_well_desc rkl_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 		},
 	}, {
-		.name = "AUX USBC2",
+		.name = "AUX_USBC2",
 		.domains = TGL_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1535,7 +1535,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -1546,12 +1546,12 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = DG1_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = DG1_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1560,7 +1560,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 		},
 	}, {
-		.name = "power well 3",
+		.name = "PW_3",
 		.domains = DG1_PW_3_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_B),
@@ -1571,7 +1571,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_3,
 		},
 	}, {
-		.name = "DDI A IO",
+		.name = "DDI_IO_A",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1579,7 +1579,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	}, {
-		.name = "DDI B IO",
+		.name = "DDI_IO_B",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1587,7 +1587,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	}, {
-		.name = "DDI IO TC1",
+		.name = "DDI_IO_TC1",
 		.domains = TGL_DDI_IO_TC1_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1595,7 +1595,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		},
 	}, {
-		.name = "DDI IO TC2",
+		.name = "DDI_IO_TC2",
 		.domains = TGL_DDI_IO_TC2_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1603,7 +1603,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		},
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = TGL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1611,7 +1611,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = TGL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1619,7 +1619,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX USBC1",
+		.name = "AUX_USBC1",
 		.domains = TGL_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1628,7 +1628,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 		},
 	}, {
-		.name = "AUX USBC2",
+		.name = "AUX_USBC2",
 		.domains = TGL_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = false,
@@ -1637,7 +1637,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 		},
 	}, {
-		.name = "power well 4",
+		.name = "PW_4",
 		.domains = TGL_PW_4_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1647,7 +1647,7 @@ static const struct i915_power_well_desc dg1_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_4,
 		}
 	}, {
-		.name = "power well 5",
+		.name = "PW_5",
 		.domains = TGL_PW_5_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_fuses = true,
@@ -1779,7 +1779,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 		.always_on = true,
 		.id = DISP_PW_ID_NONE,
 	}, {
-		.name = "power well 1",
+		.name = "PW_1",
 		/* Handled by the DMC firmware */
 		.domains = 0,
 		.ops = &hsw_power_well_ops,
@@ -1790,12 +1790,12 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_1,
 		},
 	}, {
-		.name = "DC off",
+		.name = "DC_off",
 		.domains = XELPD_DISPLAY_DC_OFF_POWER_DOMAINS,
 		.ops = &gen9_dc_off_power_well_ops,
 		.id = SKL_DISP_DC_OFF,
 	}, {
-		.name = "power well 2",
+		.name = "PW_2",
 		.domains = XELPD_PW_2_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.has_vga = true,
@@ -1805,7 +1805,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_PW_2,
 		},
 	}, {
-		.name = "power well A",
+		.name = "PW_A",
 		.domains = XELPD_PW_A_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_A),
@@ -1815,7 +1815,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_A,
 		},
 	}, {
-		.name = "power well B",
+		.name = "PW_B",
 		.domains = XELPD_PW_B_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_B),
@@ -1825,7 +1825,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_B,
 		},
 	}, {
-		.name = "power well C",
+		.name = "PW_C",
 		.domains = XELPD_PW_C_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_C),
@@ -1835,7 +1835,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_C,
 		},
 	}, {
-		.name = "power well D",
+		.name = "PW_D",
 		.domains = XELPD_PW_D_POWER_DOMAINS,
 		.ops = &hsw_power_well_ops,
 		.irq_pipe_mask = BIT(PIPE_D),
@@ -1845,7 +1845,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_PW_D,
 		},
 	}, {
-		.name = "DDI A IO",
+		.name = "DDI_IO_A",
 		.domains = ICL_DDI_IO_A_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1853,7 +1853,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_A,
 		}
 	}, {
-		.name = "DDI B IO",
+		.name = "DDI_IO_B",
 		.domains = ICL_DDI_IO_B_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1861,7 +1861,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_B,
 		}
 	}, {
-		.name = "DDI C IO",
+		.name = "DDI_IO_C",
 		.domains = ICL_DDI_IO_C_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1869,7 +1869,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_DDI_C,
 		}
 	}, {
-		.name = "DDI IO D_XELPD",
+		.name = "DDI_IO_D_XELPD",
 		.domains = XELPD_DDI_IO_D_XELPD_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1877,7 +1877,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_DDI_D,
 		}
 	}, {
-		.name = "DDI IO E_XELPD",
+		.name = "DDI_IO_E_XELPD",
 		.domains = XELPD_DDI_IO_E_XELPD_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1885,7 +1885,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_DDI_E,
 		}
 	}, {
-		.name = "DDI IO TC1",
+		.name = "DDI_IO_TC1",
 		.domains = XELPD_DDI_IO_TC1_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1893,7 +1893,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC1,
 		}
 	}, {
-		.name = "DDI IO TC2",
+		.name = "DDI_IO_TC2",
 		.domains = XELPD_DDI_IO_TC2_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1901,7 +1901,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC2,
 		}
 	}, {
-		.name = "DDI IO TC3",
+		.name = "DDI_IO_TC3",
 		.domains = XELPD_DDI_IO_TC3_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1909,7 +1909,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC3,
 		}
 	}, {
-		.name = "DDI IO TC4",
+		.name = "DDI_IO_TC4",
 		.domains = XELPD_DDI_IO_TC4_POWER_DOMAINS,
 		.ops = &icl_ddi_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1917,7 +1917,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_DDI_TC4,
 		}
 	}, {
-		.name = "AUX A",
+		.name = "AUX_A",
 		.domains = ICL_AUX_A_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.fixed_enable_delay = true,
@@ -1926,7 +1926,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_A,
 		},
 	}, {
-		.name = "AUX B",
+		.name = "AUX_B",
 		.domains = ICL_AUX_B_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.fixed_enable_delay = true,
@@ -1935,7 +1935,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_B,
 		},
 	}, {
-		.name = "AUX C",
+		.name = "AUX_C",
 		.domains = TGL_AUX_C_IO_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.fixed_enable_delay = true,
@@ -1944,7 +1944,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = ICL_PW_CTL_IDX_AUX_C,
 		},
 	}, {
-		.name = "AUX D_XELPD",
+		.name = "AUX_D_XELPD",
 		.domains = XELPD_AUX_IO_D_XELPD_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.fixed_enable_delay = true,
@@ -1953,7 +1953,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_AUX_D,
 		},
 	}, {
-		.name = "AUX E_XELPD",
+		.name = "AUX_E_XELPD",
 		.domains = XELPD_AUX_IO_E_XELPD_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1961,7 +1961,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = XELPD_PW_CTL_IDX_AUX_E,
 		},
 	}, {
-		.name = "AUX USBC1",
+		.name = "AUX_USBC1",
 		.domains = XELPD_AUX_IO_USBC1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.fixed_enable_delay = true,
@@ -1970,7 +1970,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC1,
 		},
 	}, {
-		.name = "AUX USBC2",
+		.name = "AUX_USBC2",
 		.domains = XELPD_AUX_IO_USBC2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1978,7 +1978,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC2,
 		},
 	}, {
-		.name = "AUX USBC3",
+		.name = "AUX_USBC3",
 		.domains = XELPD_AUX_IO_USBC3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1986,7 +1986,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC3,
 		},
 	}, {
-		.name = "AUX USBC4",
+		.name = "AUX_USBC4",
 		.domains = XELPD_AUX_IO_USBC4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.id = DISP_PW_ID_NONE,
@@ -1994,7 +1994,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TC4,
 		},
 	}, {
-		.name = "AUX TBT1",
+		.name = "AUX_TBT1",
 		.domains = XELPD_AUX_IO_TBT1_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -2003,7 +2003,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT1,
 		},
 	}, {
-		.name = "AUX TBT2",
+		.name = "AUX_TBT2",
 		.domains = XELPD_AUX_IO_TBT2_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -2012,7 +2012,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT2,
 		},
 	}, {
-		.name = "AUX TBT3",
+		.name = "AUX_TBT3",
 		.domains = XELPD_AUX_IO_TBT3_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
@@ -2021,7 +2021,7 @@ static const struct i915_power_well_desc xelpd_power_wells[] = {
 			.hsw.idx = TGL_PW_CTL_IDX_AUX_TBT3,
 		},
 	}, {
-		.name = "AUX TBT4",
+		.name = "AUX_TBT4",
 		.domains = XELPD_AUX_IO_TBT4_POWER_DOMAINS,
 		.ops = &icl_aux_power_well_ops,
 		.is_tc_tbt = true,
Signature · 1 line
2.27.0
author
#21 lore raw

PATCH v2 16/26 drm/i915: Convert the power well descriptor domain mask to an array of domains

In reply to Imre Deak

The next patch converts the i915_power_well_desc::domain mask from a u64 mask to a bitmap. I didn't find a reasonably simple way to initialize bitmaps statically, so prepare for the next patch here by converting the masks to an array of domain enums and initing the masks from these arrays during module loading.

v2: Clarify list vs. array in the commit message. (Jani)

---
 .../drm/i915/display/intel_display_power.c    |    4 +-
 .../i915/display/intel_display_power_map.c    | 1427 +++++++++--------
 .../i915/display/intel_display_power_well.c   |    2 +-
 .../i915/display/intel_display_power_well.h   |    6 +-
 4 files changed, 754 insertions(+), 685 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +2 -2
index a0db3dcecd006..32fb5acbb24e2 100644
@@ -21,11 +21,11 @@
 
 #define for_each_power_domain_well(__dev_priv, __power_well, __domain_mask)	\
 	for_each_power_well(__dev_priv, __power_well)				\
-		for_each_if((__power_well)->desc->domains & (__domain_mask))
+		for_each_if((__power_well)->domains & (__domain_mask))
 
 #define for_each_power_domain_well_reverse(__dev_priv, __power_well, __domain_mask) \
 	for_each_power_well_reverse(__dev_priv, __power_well)		        \
-		for_each_if((__power_well)->desc->domains & (__domain_mask))
+		for_each_if((__power_well)->domains & (__domain_mask))
 
 const char *
 intel_display_power_domain_str(enum intel_display_power_domain domain)
drivers/gpu/drm/i915/display/intel_display_power_map.c +746 -681

2,472 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power_well.c +1 -1
index 8d9bc7a654106..b3d648dfeaea3 100644
@@ -155,7 +155,7 @@ const char *intel_power_well_name(struct i915_power_well *power_well)
 
 u64 intel_power_well_domains(struct i915_power_well *power_well)
 {
-	return power_well->desc->domains;
+	return power_well->domains;
 }
 
 int intel_power_well_refcount(struct i915_power_well *power_well)
drivers/gpu/drm/i915/display/intel_display_power_well.h +5 -1
index f46d82f697678..6bb1d927f7936 100644
@@ -50,7 +50,10 @@ enum i915_power_well_id {
 
 struct i915_power_well_desc {
 	const char *name;
-	u64 domains;
+	const struct i915_power_domain_list {
+		const enum intel_display_power_domain *list;
+		u8 count;
+	} *domain_list;
 	/* Mask of pipes whose IRQ logic is backed by the pw */
 	u16 irq_pipe_mask:4;
 	u16 always_on:1;
@@ -99,6 +102,7 @@ struct i915_power_well_desc {
 
 struct i915_power_well {
 	const struct i915_power_well_desc *desc;
+	u64 domains;
 	/* power well enable/disable usage count */
 	int count;
 	/* cached hw enabled state */
Signature · 1 line
2.27.0
author
#22 lore raw

PATCH v2 17/26 drm/i915: Convert the u64 power well domains mask to a bitmap

In reply to Imre Deak

To remove the aliasing of the power domain enum values in a follow-up patch in this patchset (requiring a bigger mask) and allow for defining additional power domains in the future (at least some upcoming TypeC changes requires this) convert the u64 i915_power_well_desc::domains mask to a bitmap.

For simplicity I changed the for_each_power_domain_well() macros to accept one domain only instead of a mask, as there isn't any current user passing multiple domains.

v2: Don't add a typedef for the bitmap struct. (Jani)

---
 drivers/gpu/drm/i915/display/intel_display.c  |  65 ++++++-----
 .../drm/i915/display/intel_display_power.c    | 108 +++++++++++-------
 .../drm/i915/display/intel_display_power.h    |  18 +--
 .../i915/display/intel_display_power_map.c    |   4 +-
 .../i915/display/intel_display_power_well.c   |   4 +-
 .../i915/display/intel_display_power_well.h   |   5 +-
 6 files changed, 116 insertions(+), 88 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +34 -31
index e2f1e9415415e..16e496579e0aa 100644
@@ -2387,66 +2387,71 @@ intel_legacy_aux_to_power_domain(enum aux_ch aux_ch)
 	}
 }
 
-static u64 get_crtc_power_domains(struct intel_crtc_state *crtc_state)
+static void get_crtc_power_domains(struct intel_crtc_state *crtc_state,
+				   struct intel_power_domain_mask *mask)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
 	struct drm_encoder *encoder;
 	enum pipe pipe = crtc->pipe;
-	u64 mask;
+
+	bitmap_zero(mask->bits, POWER_DOMAIN_NUM);
 
 	if (!crtc_state->hw.active)
-		return 0;
+		return;
 
-	mask = BIT_ULL(POWER_DOMAIN_PIPE(pipe));
-	mask |= BIT_ULL(POWER_DOMAIN_TRANSCODER(cpu_transcoder));
+	set_bit(POWER_DOMAIN_PIPE(pipe), mask->bits);
+	set_bit(POWER_DOMAIN_TRANSCODER(cpu_transcoder), mask->bits);
 	if (crtc_state->pch_pfit.enabled ||
 	    crtc_state->pch_pfit.force_thru)
-		mask |= BIT_ULL(POWER_DOMAIN_PIPE_PANEL_FITTER(pipe));
+		set_bit(POWER_DOMAIN_PIPE_PANEL_FITTER(pipe), mask->bits);
 
 	drm_for_each_encoder_mask(encoder, &dev_priv->drm,
 				  crtc_state->uapi.encoder_mask) {
 		struct intel_encoder *intel_encoder = to_intel_encoder(encoder);
 
-		mask |= BIT_ULL(intel_encoder->power_domain);
+		set_bit(intel_encoder->power_domain, mask->bits);
 	}
 
 	if (HAS_DDI(dev_priv) && crtc_state->has_audio)
-		mask |= BIT_ULL(POWER_DOMAIN_AUDIO_MMIO);
+		set_bit(POWER_DOMAIN_AUDIO_MMIO, mask->bits);
 
 	if (crtc_state->shared_dpll)
-		mask |= BIT_ULL(POWER_DOMAIN_DISPLAY_CORE);
+		set_bit(POWER_DOMAIN_DISPLAY_CORE, mask->bits);
 
 	if (crtc_state->dsc.compression_enable)
-		mask |= BIT_ULL(intel_dsc_power_domain(crtc, cpu_transcoder));
-
-	return mask;
+		set_bit(intel_dsc_power_domain(crtc, cpu_transcoder), mask->bits);
 }
 
-static u64
-modeset_get_crtc_power_domains(struct intel_crtc_state *crtc_state)
+static void
+modeset_get_crtc_power_domains(struct intel_crtc_state *crtc_state,
+			       struct intel_power_domain_mask *old_domains)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 	enum intel_display_power_domain domain;
-	u64 domains, new_domains, old_domains;
+	struct intel_power_domain_mask domains, new_domains;
 
-	domains = get_crtc_power_domains(crtc_state);
+	get_crtc_power_domains(crtc_state, &domains);
 
-	new_domains = domains & ~crtc->enabled_power_domains.mask;
-	old_domains = crtc->enabled_power_domains.mask & ~domains;
+	bitmap_andnot(new_domains.bits,
+		      domains.bits,
+		      crtc->enabled_power_domains.mask.bits,
+		      POWER_DOMAIN_NUM);
+	bitmap_andnot(old_domains->bits,
+		      crtc->enabled_power_domains.mask.bits,
+		      domains.bits,
+		      POWER_DOMAIN_NUM);
 
-	for_each_power_domain(domain, new_domains)
+	for_each_power_domain(domain, &new_domains)
 		intel_display_power_get_in_set(dev_priv,
 					       &crtc->enabled_power_domains,
 					       domain);
-
-	return old_domains;
 }
 
 static void modeset_put_crtc_power_domains(struct intel_crtc *crtc,
-					   u64 domains)
+					   struct intel_power_domain_mask *domains)
 {
 	intel_display_power_put_mask_in_set(to_i915(crtc->base.dev),
 					    &crtc->enabled_power_domains,
@@ -8582,7 +8587,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	struct intel_crtc_state *new_crtc_state, *old_crtc_state;
 	struct intel_crtc *crtc;
-	u64 put_domains[I915_MAX_PIPES] = {};
+	struct intel_power_domain_mask put_domains[I915_MAX_PIPES] = {};
 	intel_wakeref_t wakeref = 0;
 	int i;
 
@@ -8599,9 +8604,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 					    new_crtc_state, i) {
 		if (intel_crtc_needs_modeset(new_crtc_state) ||
 		    new_crtc_state->update_pipe) {
-
-			put_domains[crtc->pipe] =
-				modeset_get_crtc_power_domains(new_crtc_state);
+			modeset_get_crtc_power_domains(new_crtc_state, &put_domains[crtc->pipe]);
 		}
 	}
 
@@ -8700,7 +8703,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		intel_post_plane_update(state, crtc);
 
-		modeset_put_crtc_power_domains(crtc, put_domains[crtc->pipe]);
+		modeset_put_crtc_power_domains(crtc, &put_domains[crtc->pipe]);
 
 		intel_modeset_verify_crtc(crtc, state, old_crtc_state, new_crtc_state);
 
@@ -10657,11 +10660,11 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
 	for_each_intel_crtc(dev, crtc) {
 		struct intel_crtc_state *crtc_state =
 			to_intel_crtc_state(crtc->base.state);
-		u64 put_domains;
+		struct intel_power_domain_mask put_domains;
 
-		put_domains = modeset_get_crtc_power_domains(crtc_state);
-		if (drm_WARN_ON(dev, put_domains))
-			modeset_put_crtc_power_domains(crtc, put_domains);
+		modeset_get_crtc_power_domains(crtc_state, &put_domains);
+		if (drm_WARN_ON(dev, !bitmap_empty(put_domains.bits, POWER_DOMAIN_NUM)))
+			modeset_put_crtc_power_domains(crtc, &put_domains);
 	}
 
 	intel_display_power_put(dev_priv, POWER_DOMAIN_INIT, wakeref);
drivers/gpu/drm/i915/display/intel_display_power.c +64 -44

296 lines not on this page · raw message

drivers/gpu/drm/i915/display/intel_display_power.h +11 -7
index 1aa695387de5d..01f613d3ad208 100644
@@ -139,6 +139,10 @@ enum intel_display_power_domain {
 	((tran) == TRANSCODER_EDP ? POWER_DOMAIN_TRANSCODER_EDP : \
 	 (tran) + POWER_DOMAIN_TRANSCODER_A)
 
+struct intel_power_domain_mask {
+	DECLARE_BITMAP(bits, POWER_DOMAIN_NUM);
+};
+
 struct i915_power_domains {
 	/*
 	 * Power wells needed for initialization at driver init and suspend
@@ -156,21 +160,21 @@ struct i915_power_domains {
 
 	struct delayed_work async_put_work;
 	intel_wakeref_t async_put_wakeref;
-	u64 async_put_domains[2];
+	struct intel_power_domain_mask async_put_domains[2];
 
 	struct i915_power_well *power_wells;
 };
 
 struct intel_display_power_domain_set {
-	u64 mask;
+	struct intel_power_domain_mask mask;
 #ifdef CONFIG_DRM_I915_DEBUG_RUNTIME_PM
 	intel_wakeref_t wakerefs[POWER_DOMAIN_NUM];
 #endif
 };
 
-#define for_each_power_domain(domain, mask)				\
-	for ((domain) = 0; (domain) < POWER_DOMAIN_NUM; (domain)++)	\
-		for_each_if(BIT_ULL(domain) & (mask))
+#define for_each_power_domain(__domain, __mask)				\
+	for ((__domain) = 0; (__domain) < POWER_DOMAIN_NUM; (__domain)++)	\
+		for_each_if(test_bit((__domain), (__mask)->bits))
 
 int intel_power_domains_init(struct drm_i915_private *dev_priv);
 void intel_power_domains_cleanup(struct drm_i915_private *dev_priv);
@@ -251,13 +255,13 @@ intel_display_power_get_in_set_if_enabled(struct drm_i915_private *i915,
 void
 intel_display_power_put_mask_in_set(struct drm_i915_private *i915,
 				    struct intel_display_power_domain_set *power_domain_set,
-				    u64 mask);
+				    struct intel_power_domain_mask *mask);
 
 static inline void
 intel_display_power_put_all_in_set(struct drm_i915_private *i915,
 				   struct intel_display_power_domain_set *power_domain_set)
 {
-	intel_display_power_put_mask_in_set(i915, power_domain_set, power_domain_set->mask);
+	intel_display_power_put_mask_in_set(i915, power_domain_set, &power_domain_set->mask);
 }
 
 void intel_display_power_debug(struct drm_i915_private *i915, struct seq_file *m);
drivers/gpu/drm/i915/display/intel_display_power_map.c +2 -2
index 8a433260b5fbe..4dad861f252f7 100644
@@ -2084,13 +2084,13 @@ static void init_power_well_domains(const struct i915_power_well_desc *desc,
 		return;
 
 	if (desc->domain_list->count == 0) {
-		power_well->domains = GENMASK_ULL(POWER_DOMAIN_NUM - 1, 0);
+		bitmap_fill(power_well->domains.bits, POWER_DOMAIN_NUM);
 
 		return;
 	}
 
 	for (j = 0; j < desc->domain_list->count; j++)
-		power_well->domains |= BIT_ULL(desc->domain_list->list[j]);
+		set_bit(desc->domain_list->list[j], power_well->domains.bits);
 }
 
 static int
drivers/gpu/drm/i915/display/intel_display_power_well.c +2 -2
index b3d648dfeaea3..5d8145bcb90eb 100644
@@ -153,9 +153,9 @@ const char *intel_power_well_name(struct i915_power_well *power_well)
 	return power_well->desc->name;
 }
 
-u64 intel_power_well_domains(struct i915_power_well *power_well)
+struct intel_power_domain_mask *intel_power_well_domains(struct i915_power_well *power_well)
 {
-	return power_well->domains;
+	return &power_well->domains;
 }
 
 int intel_power_well_refcount(struct i915_power_well *power_well)
drivers/gpu/drm/i915/display/intel_display_power_well.h +3 -2
index 6bb1d927f7936..2bf1bdfd6467d 100644
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 
 #include "intel_display.h"
+#include "intel_display_power.h"
 
 struct drm_i915_private;
 struct i915_power_well;
@@ -102,7 +103,7 @@ struct i915_power_well_desc {
 
 struct i915_power_well {
 	const struct i915_power_well_desc *desc;
-	u64 domains;
+	struct intel_power_domain_mask domains;
 	/* power well enable/disable usage count */
 	int count;
 	/* cached hw enabled state */
@@ -129,7 +130,7 @@ bool intel_display_power_well_is_enabled(struct drm_i915_private *dev_priv,
 					 enum i915_power_well_id power_well_id);
 bool intel_power_well_is_always_on(struct i915_power_well *power_well);
 const char *intel_power_well_name(struct i915_power_well *power_well);
-u64 intel_power_well_domains(struct i915_power_well *power_well);
+struct intel_power_domain_mask *intel_power_well_domains(struct i915_power_well *power_well);
 int intel_power_well_refcount(struct i915_power_well *power_well);
 
 void gen9_enable_dc5(struct drm_i915_private *dev_priv);
Signature · 1 line
2.27.0