All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: m.deepak@intel.com,
	Ander Conselvan de Oliveira
	<ander.conselvan.de.oliveira@intel.com>
Subject: [PATCH v2 2/9] drm/i915: Explicitly map broxton DPIO power wells to phys
Date: Thu,  6 Oct 2016 19:22:15 +0300	[thread overview]
Message-ID: <7fe97582fa08c7340ce6a3b6b0ea3e72a73182d7.1475770848.git-series.ander.conselvan.de.oliveira@intel.com> (raw)
In-Reply-To: <cover.d70d631f7f5a73a187167a165d5f1fef85aa2ff6.1475770848.git-series.ander.conselvan.de.oliveira@intel.com>
In-Reply-To: <cover.d70d631f7f5a73a187167a165d5f1fef85aa2ff6.1475770848.git-series.ander.conselvan.de.oliveira@intel.com>

The mapping from the BXT_DPIO_CMN_* power wells to their respective phys
required a detour implemented in the bxt_power_well_to_phy() function.
Instead, embed that information directly into the power_well struct, by
resurrecting the data field.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h         |  5 +++++
 drivers/gpu/drm/i915/intel_runtime_pm.c | 22 +++++++---------------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5bd3f59..93c90b9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1318,6 +1318,11 @@ struct i915_power_well {
 	unsigned long domains;
 	/* unique identifier for this power well */
 	unsigned long id;
+	/*
+	 * Arbitraty data associated with this power well. Platform and power
+	 * well specific.
+	 */
+	unsigned long data;
 	const struct i915_power_well_ops *ops;
 };
 
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 4ecaf6a..d41fd46 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -846,13 +846,6 @@ static void skl_power_well_disable(struct drm_i915_private *dev_priv,
 	skl_set_power_well(dev_priv, power_well, false);
 }
 
-static enum dpio_phy bxt_power_well_to_phy(struct i915_power_well *power_well)
-{
-	enum skl_disp_power_wells power_well_id = power_well->id;
-
-	return power_well_id == BXT_DPIO_CMN_A ? DPIO_PHY1 : DPIO_PHY0;
-}
-
 static void bxt_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
 					   struct i915_power_well *power_well)
 {
@@ -868,7 +861,7 @@ static void bxt_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
 		intel_power_well_get(dev_priv, cmn_a_well);
 	}
 
-	bxt_ddi_phy_init(dev_priv, bxt_power_well_to_phy(power_well));
+	bxt_ddi_phy_init(dev_priv, power_well->data);
 
 	if (cmn_a_well)
 		intel_power_well_put(dev_priv, cmn_a_well);
@@ -877,14 +870,13 @@ static void bxt_dpio_cmn_power_well_enable(struct drm_i915_private *dev_priv,
 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, bxt_power_well_to_phy(power_well));
+	bxt_ddi_phy_uninit(dev_priv, power_well->data);
 }
 
 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,
-				      bxt_power_well_to_phy(power_well));
+	return bxt_ddi_phy_is_enabled(dev_priv, power_well->data);
 }
 
 static void bxt_dpio_cmn_power_well_sync_hw(struct drm_i915_private *dev_priv,
@@ -903,13 +895,11 @@ static void bxt_verify_ddi_phy_power_wells(struct drm_i915_private *dev_priv)
 
 	power_well = lookup_power_well(dev_priv, BXT_DPIO_CMN_A);
 	if (power_well->count > 0)
-		bxt_ddi_phy_verify_state(dev_priv,
-					 bxt_power_well_to_phy(power_well));
+		bxt_ddi_phy_verify_state(dev_priv, power_well->data);
 
 	power_well = lookup_power_well(dev_priv, BXT_DPIO_CMN_BC);
 	if (power_well->count > 0)
-		bxt_ddi_phy_verify_state(dev_priv,
-					 bxt_power_well_to_phy(power_well));
+		bxt_ddi_phy_verify_state(dev_priv, power_well->data);
 }
 
 static bool gen9_dc_off_power_well_enabled(struct drm_i915_private *dev_priv,
@@ -2163,12 +2153,14 @@ static struct i915_power_well bxt_power_wells[] = {
 		.domains = BXT_DPIO_CMN_A_POWER_DOMAINS,
 		.ops = &bxt_dpio_cmn_power_well_ops,
 		.id = BXT_DPIO_CMN_A,
+		.data = DPIO_PHY1,
 	},
 	{
 		.name = "dpio-common-bc",
 		.domains = BXT_DPIO_CMN_BC_POWER_DOMAINS,
 		.ops = &bxt_dpio_cmn_power_well_ops,
 		.id = BXT_DPIO_CMN_BC,
+		.data = DPIO_PHY0,
 	},
 };
 
-- 
git-series 0.8.10
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-10-06 16:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 16:22 [PATCH v2 0/9] Broxton ddi phy refactoring Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 1/9] drm/i915: Rename struct i915_power_well field data to id Ander Conselvan de Oliveira
2016-10-06 16:22 ` Ander Conselvan de Oliveira [this message]
2016-10-06 16:22 ` [PATCH v2 3/9] drm/i915: Pass lane count to bxt_ddi_phy_calc_lane_optmin_mask() Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 4/9] drm/i915: Move broxton phy code to intel_dpio_phy.c Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 5/9] drm/i915: Move DPIO phy documentation section " Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 6/9] drm/i915: Move broxton vswing sequence " Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 7/9] drm/i915: Create a struct to hold information about the broxton phys Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 8/9] drm/i915: Add location of the Rcomp resistor to bxt_ddi_phy_info Ander Conselvan de Oliveira
2016-10-06 16:22 ` [PATCH v2 9/9] drm/i915: Address broxton phy registers based on phy and channel number Ander Conselvan de Oliveira
2016-10-07  7:28   ` [PATCH v3 " Ander Conselvan de Oliveira
2016-10-10 11:53     ` Imre Deak
2016-10-19  7:54       ` [PATCH v4 " Ander Conselvan de Oliveira
2016-10-19  7:59       ` [PATCH v5 " Ander Conselvan de Oliveira
2016-10-06 17:21 ` ✗ Fi.CI.BAT: warning for Broxton ddi phy refactoring (rev2) Patchwork
2016-10-07  7:50 ` ✗ Fi.CI.BAT: warning for Broxton ddi phy refactoring (rev3) Patchwork
2016-10-07  8:35 ` Patchwork
2016-10-19  9:57 ` ✗ Fi.CI.BAT: failure for Broxton ddi phy refactoring (rev5) Patchwork
2016-10-19 16:56 ` Patchwork
2016-10-21 14:16   ` Ander Conselvan De Oliveira
2016-10-21 14:23     ` Ville Syrjälä
2016-10-28 10:51       ` Ander Conselvan De Oliveira
2016-10-21 15:04     ` Chris Wilson
2016-10-28  9:46 ` ✗ Fi.CI.BAT: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fe97582fa08c7340ce6a3b6b0ea3e72a73182d7.1475770848.git-series.ander.conselvan.de.oliveira@intel.com \
    --to=ander.conselvan.de.oliveira@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=m.deepak@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.