Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Animesh Manna <animesh.manna@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915/pps: Add get_pps_idx() hook as part of pps_get_register() cleanup
Date: Wed, 9 Nov 2022 12:12:23 +0200	[thread overview]
Message-ID: <Y2t9Bxcgyy7j3PPd@intel.com> (raw)
In-Reply-To: <20221108211822.28048-1-animesh.manna@intel.com>

On Wed, Nov 09, 2022 at 02:48:20AM +0530, Animesh Manna wrote:
> Simplified pps_get_register() which use get_pps_idx() hook to derive the
> pps instance and get_pps_idx() will be initialized at pps_init().
> 
> v1: Initial version. Got r-b from Jani.
> v2: Corrected unintentional change around memset() call. [Jani]
> 
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_types.h |  1 +
>  drivers/gpu/drm/i915/display/intel_pps.c           | 14 +++++++++-----
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index c6abaaa46e17..87163ef32983 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1698,6 +1698,7 @@ struct intel_dp {
>  	u8 (*preemph_max)(struct intel_dp *intel_dp);
>  	u8 (*voltage_max)(struct intel_dp *intel_dp,
>  			  const struct intel_crtc_state *crtc_state);
> +	int (*get_pps_idx)(struct intel_dp *intel_dp);
>  
>  	/* Displayport compliance testing */
>  	struct intel_dp_compliance compliance;
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index 22f5e08d396b..3949fb449353 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -366,11 +366,8 @@ static void intel_pps_get_registers(struct intel_dp *intel_dp,
>  	int pps_idx = 0;
>  
>  	memset(regs, 0, sizeof(*regs));
> -
> -	if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
> -		pps_idx = bxt_power_sequencer_idx(intel_dp);
> -	else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> -		pps_idx = vlv_power_sequencer_pipe(intel_dp);
> +	if (intel_dp->get_pps_idx)
> +		pps_idx = intel_dp->get_pps_idx(intel_dp);

I don't really see the poing of adding a vfunc for this kind of single
use thing, especially as it's all inside the same file anyway.

>  
>  	regs->pp_ctrl = PP_CONTROL(pps_idx);
>  	regs->pp_stat = PP_STATUS(pps_idx);
> @@ -1433,6 +1430,13 @@ void intel_pps_init(struct intel_dp *intel_dp)
>  	intel_dp->pps.initializing = true;
>  	INIT_DELAYED_WORK(&intel_dp->pps.panel_vdd_work, edp_panel_vdd_work);
>  
> +	if (IS_GEMINILAKE(i915) || IS_BROXTON(i915))
> +		intel_dp->get_pps_idx = bxt_power_sequencer_idx;
> +	else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915))
> +		intel_dp->get_pps_idx = vlv_power_sequencer_pipe;
> +	else
> +		intel_dp->get_pps_idx = NULL;
> +
>  	pps_init_timestamps(intel_dp);
>  
>  	with_intel_pps_lock(intel_dp, wakeref) {
> -- 
> 2.29.0

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2022-11-09 10:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 21:18 [Intel-gfx] [PATCH 1/3] drm/i915/pps: Add get_pps_idx() hook as part of pps_get_register() cleanup Animesh Manna
2022-11-08 21:18 ` [Intel-gfx] [PATCH 2/3] drm/i915/pps: Enable 2nd pps for dual EDP scenario Animesh Manna
2022-11-09 10:11   ` Ville Syrjälä
2022-11-09 10:25     ` Jani Nikula
2022-11-09 10:29       ` Ville Syrjälä
2022-11-09 10:41         ` Jani Nikula
2022-11-09 11:09           ` Manna, Animesh
2022-11-08 21:18 ` [Intel-gfx] [PATCH 3/3] drm/i915/edp: Fix warning as vdd went down without driver knowledge Animesh Manna
2022-11-09  9:55   ` Jani Nikula
2022-11-09 10:52     ` Manna, Animesh
2022-11-08 21:38 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915/pps: Add get_pps_idx() hook as part of pps_get_register() cleanup Patchwork
2022-11-08 22:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-09  4:05 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-11-09 10:12 ` Ville Syrjälä [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-11-09 11:15 [Intel-gfx] [PATCH 1/3] " Animesh Manna

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=Y2t9Bxcgyy7j3PPd@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=animesh.manna@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox