All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: [Intel-gfx] [PATCH v2 3/9] drm/i915: Generalize the PPS vlv_pipe_check() stuff
Date: Fri, 25 Nov 2022 19:31:50 +0200	[thread overview]
Message-ID: <20221125173156.31689-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20221125173156.31689-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Restate the vlv_pipe_check() stuff in terms of PPS index
(rather than pipe, which it is on VLV/CHV) so that we can
reuse this same mechanim on other platforms as well.

Cc: Animesh Manna <animesh.manna@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_pps.c | 27 ++++++++++--------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 9bbf41a076f7..41ab12fcce0e 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -234,31 +234,26 @@ bxt_power_sequencer_idx(struct intel_dp *intel_dp)
 	return backlight_controller;
 }
 
-typedef bool (*vlv_pipe_check)(struct drm_i915_private *dev_priv,
-			       enum pipe pipe);
+typedef bool (*pps_check)(struct drm_i915_private *dev_priv, int pps_idx);
 
-static bool vlv_pipe_has_pp_on(struct drm_i915_private *dev_priv,
-			       enum pipe pipe)
+static bool pps_has_pp_on(struct drm_i915_private *dev_priv, int pps_idx)
 {
-	return intel_de_read(dev_priv, PP_STATUS(pipe)) & PP_ON;
+	return intel_de_read(dev_priv, PP_STATUS(pps_idx)) & PP_ON;
 }
 
-static bool vlv_pipe_has_vdd_on(struct drm_i915_private *dev_priv,
-				enum pipe pipe)
+static bool pps_has_vdd_on(struct drm_i915_private *dev_priv, int pps_idx)
 {
-	return intel_de_read(dev_priv, PP_CONTROL(pipe)) & EDP_FORCE_VDD;
+	return intel_de_read(dev_priv, PP_CONTROL(pps_idx)) & EDP_FORCE_VDD;
 }
 
-static bool vlv_pipe_any(struct drm_i915_private *dev_priv,
-			 enum pipe pipe)
+static bool pps_any(struct drm_i915_private *dev_priv, int pps_idx)
 {
 	return true;
 }
 
 static enum pipe
 vlv_initial_pps_pipe(struct drm_i915_private *dev_priv,
-		     enum port port,
-		     vlv_pipe_check pipe_check)
+		     enum port port, pps_check check)
 {
 	enum pipe pipe;
 
@@ -269,7 +264,7 @@ vlv_initial_pps_pipe(struct drm_i915_private *dev_priv,
 		if (port_sel != PANEL_PORT_SELECT_VLV(port))
 			continue;
 
-		if (!pipe_check(dev_priv, pipe))
+		if (!check(dev_priv, pipe))
 			continue;
 
 		return pipe;
@@ -290,15 +285,15 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
 	/* try to find a pipe with this port selected */
 	/* first pick one where the panel is on */
 	intel_dp->pps.pps_pipe = vlv_initial_pps_pipe(dev_priv, port,
-						      vlv_pipe_has_pp_on);
+						      pps_has_pp_on);
 	/* didn't find one? pick one where vdd is on */
 	if (intel_dp->pps.pps_pipe == INVALID_PIPE)
 		intel_dp->pps.pps_pipe = vlv_initial_pps_pipe(dev_priv, port,
-							      vlv_pipe_has_vdd_on);
+							      pps_has_vdd_on);
 	/* didn't find one? pick one with just the correct port */
 	if (intel_dp->pps.pps_pipe == INVALID_PIPE)
 		intel_dp->pps.pps_pipe = vlv_initial_pps_pipe(dev_priv, port,
-							      vlv_pipe_any);
+							      pps_any);
 
 	/* didn't find one? just let vlv_power_sequencer_pipe() pick one when needed */
 	if (intel_dp->pps.pps_pipe == INVALID_PIPE) {
-- 
2.37.4


  parent reply	other threads:[~2022-11-25 17:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 17:31 [Intel-gfx] [PATCH v2 0/9] drm/i915: Fake dual eDP VBT fixes Ville Syrjala
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 1/9] drm/i915: Introduce intel_panel_init_alloc() Ville Syrjala
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 2/9] drm/i915: Do panel VBT init early if the VBT declares an explicit panel type Ville Syrjala
2022-11-25 17:31 ` Ville Syrjala [this message]
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 4/9] drm/i915: Try to use the correct power sequencer intiially on bxt/glk Ville Syrjala
2022-12-08 15:28   ` Manna, Animesh
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 5/9] drm/i915: Extend dual PPS handlind for ICP+ Ville Syrjala
2022-12-08 15:29   ` Manna, Animesh
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 6/9] drm/i915: Reject unusablee power sequencers Ville Syrjala
2022-12-08 15:30   ` Manna, Animesh
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 7/9] drm/i915: Print the PPS registers using consistent format Ville Syrjala
2022-12-08 15:30   ` Manna, Animesh
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 8/9] drm/i915: Fix whitespace Ville Syrjala
2022-12-08 15:31   ` Manna, Animesh
2022-11-25 17:31 ` [Intel-gfx] [PATCH v2 9/9] drm/i915: Improve PPS debugs Ville Syrjala
2022-11-27 13:42   ` [Intel-gfx] [PATCH v3 " Ville Syrjala
2022-11-27 15:52   ` [Intel-gfx] [PATCH v4 " Ville Syrjala
2022-12-08 15:41   ` [Intel-gfx] [PATCH v2 " Manna, Animesh
2022-11-25 17:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fake dual eDP VBT fixes (rev2) Patchwork
2022-11-25 17:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-25 18:15 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-11-27 13:56 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fake dual eDP VBT fixes (rev3) Patchwork
2022-11-27 13:56 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-27 14:18 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-11-27 16:07 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fake dual eDP VBT fixes (rev4) Patchwork
2022-11-27 16:07 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-11-27 16:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " 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=20221125173156.31689-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.