All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Manna, Animesh" <animesh.manna@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v2 5/9] drm/i915: Extend dual PPS handlind for ICP+
Date: Thu, 8 Dec 2022 15:29:33 +0000	[thread overview]
Message-ID: <PH7PR11MB5981D0CF63A72A33A69CECADF91D9@PH7PR11MB5981.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221125173156.31689-6-ville.syrjala@linux.intel.com>



> -----Original Message-----
> From: Ville Syrjala <ville.syrjala@linux.intel.com>
> Sent: Friday, November 25, 2022 11:02 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Manna, Animesh <animesh.manna@intel.com>
> Subject: [PATCH v2 5/9] drm/i915: Extend dual PPS handlind for ICP+
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> On the PCH side the second PPS was introduced in ICP. Let's make sure we
> examine both power sequencer on ICP+ as well.
> 
> Note that DG1/2 south block only has the single PPS, so need to exclude the
> fake DG1/2 PCHs.
> 
> Cc: Animesh Manna <animesh.manna@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

LGTM.
Reviewed-by: Animesh Manna <animesh.manna@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_pps.c | 44 +++++++++++++++++-------
>  1 file changed, 32 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c
> b/drivers/gpu/drm/i915/display/intel_pps.c
> index d8d2f22f3e0c..77b0a4f27abc 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -310,10 +310,27 @@ vlv_initial_power_sequencer_setup(struct intel_dp
> *intel_dp)
>  		    pipe_name(intel_dp->pps.pps_pipe));
>  }
> 
> +static int intel_num_pps(struct drm_i915_private *i915) {
> +	if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915))
> +		return 2;
> +
> +	if (IS_GEMINILAKE(i915) || IS_BROXTON(i915))
> +		return 2;
> +
> +	if (INTEL_PCH_TYPE(i915) >= PCH_DG1)
> +		return 1;
> +
> +	if (INTEL_PCH_TYPE(i915) >= PCH_ICP)
> +		return 2;
> +
> +	return 1;
> +}
> +
>  static int
>  bxt_initial_pps_idx(struct drm_i915_private *i915, pps_check check)  {
> -	int pps_idx, pps_num = 2;
> +	int pps_idx, pps_num = intel_num_pps(i915);
> 
>  	for (pps_idx = 0; pps_idx < pps_num; pps_idx++) {
>  		if (check(i915, pps_idx))
> @@ -337,12 +354,13 @@ pps_initial_setup(struct intel_dp *intel_dp)
>  		return;
>  	}
> 
> -	if (!IS_GEMINILAKE(i915) && !IS_BROXTON(i915))
> -		return;
> -
>  	/* first ask the VBT */
> -	intel_dp->pps.pps_idx = connector->panel.vbt.backlight.controller;
> -	if (drm_WARN_ON(&i915->drm, intel_dp->pps.pps_idx >= 2))
> +	if (intel_num_pps(i915) > 1)
> +		intel_dp->pps.pps_idx = connector-
> >panel.vbt.backlight.controller;
> +	else
> +		intel_dp->pps.pps_idx = 0;
> +
> +	if (drm_WARN_ON(&i915->drm, intel_dp->pps.pps_idx >=
> +intel_num_pps(i915)))
>  		intel_dp->pps.pps_idx = -1;
> 
>  	/* VBT wasn't parsed yet? pick one where the panel is on */ @@ -
> 416,7 +434,7 @@ static void intel_pps_get_registers(struct intel_dp
> *intel_dp,
>  				    struct pps_registers *regs)
>  {
>  	struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
> -	int pps_idx = 0;
> +	int pps_idx;
> 
>  	memset(regs, 0, sizeof(*regs));
> 
> @@ -424,6 +442,8 @@ static void intel_pps_get_registers(struct intel_dp
> *intel_dp,
>  		pps_idx = vlv_power_sequencer_pipe(intel_dp);
>  	else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
>  		pps_idx = bxt_power_sequencer_idx(intel_dp);
> +	else
> +		pps_idx = intel_dp->pps.pps_idx;
> 
>  	regs->pp_ctrl = PP_CONTROL(pps_idx);
>  	regs->pp_stat = PP_STATUS(pps_idx);
> @@ -1508,7 +1528,10 @@ static void pps_init_late(struct intel_dp *intel_dp)
>  	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
>  	struct intel_connector *connector = intel_dp->attached_connector;
> 
> -	if (!IS_GEMINILAKE(i915) && !IS_BROXTON(i915))
> +	if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915))
> +		return;
> +
> +	if (intel_num_pps(i915) < 2)
>  		return;
> 
>  	drm_WARN(&i915->drm, connector->panel.vbt.backlight.controller
> >= 0 && @@ -1551,10 +1574,7 @@ void intel_pps_unlock_regs_wa(struct
> drm_i915_private *dev_priv)
>  	 * This w/a is needed at least on CPT/PPT, but to be sure apply it
>  	 * everywhere where registers can be write protected.
>  	 */
> -	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> -		pps_num = 2;
> -	else
> -		pps_num = 1;
> +	pps_num = intel_num_pps(dev_priv);
> 
>  	for (pps_idx = 0; pps_idx < pps_num; pps_idx++) {
>  		u32 val = intel_de_read(dev_priv, PP_CONTROL(pps_idx));
> --
> 2.37.4


  reply	other threads:[~2022-12-08 15:29 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 ` [Intel-gfx] [PATCH v2 3/9] drm/i915: Generalize the PPS vlv_pipe_check() stuff Ville Syrjala
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 [this message]
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=PH7PR11MB5981D0CF63A72A33A69CECADF91D9@PH7PR11MB5981.namprd11.prod.outlook.com \
    --to=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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.