intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 05/11] drm/i915: Combine the EDID fixed_mode+downclock_mode lookup into one
Date: Thu, 31 Mar 2022 16:26:48 +0300	[thread overview]
Message-ID: <877d8a9rs7.fsf@intel.com> (raw)
In-Reply-To: <20220331112822.11462-6-ville.syrjala@linux.intel.com>

On Thu, 31 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The intel_panel_add_edid_fixed_mode() vs.
> intel_panel_add_edid_downclock_mode() split is not really
> helpful. Let's just roll those into a single function so
> that the connector init code doesn't have to care too much
> about this. All we need to know is whether DRRS should be
> allowed or not.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dp.c    |  6 ++----
>  drivers/gpu/drm/i915/display/intel_lvds.c  |  2 +-
>  drivers/gpu/drm/i915/display/intel_panel.c | 11 +++++++++--
>  drivers/gpu/drm/i915/display/intel_panel.h |  3 +--
>  drivers/gpu/drm/i915/display/intel_sdvo.c  |  2 +-
>  5 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index e539bc315d7b..abfdaa0c7382 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5072,10 +5072,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
>  	}
>  	intel_connector->edid = edid;
>  
> -	intel_panel_add_edid_fixed_mode(intel_connector);
> -	if (intel_panel_preferred_fixed_mode(intel_connector) &&
> -	    intel_edp_has_drrs(intel_dp))
> -		intel_panel_add_edid_downclock_mode(intel_connector);
> +	intel_panel_add_edid_fixed_modes(intel_connector,
> +					 intel_edp_has_drrs(intel_dp));
>  
>  	/* MSO requires information from the EDID */
>  	intel_edp_mso_init(intel_dp);
> diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c
> index 193daffadc90..73129d21f5e5 100644
> --- a/drivers/gpu/drm/i915/display/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/display/intel_lvds.c
> @@ -968,7 +968,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
>  	intel_connector->edid = edid;
>  
>  	/* Try EDID first */
> -	intel_panel_add_edid_fixed_mode(intel_connector);
> +	intel_panel_add_edid_fixed_modes(intel_connector, false);
>  
>  	/* Failed to get EDID, what about VBT? */
>  	if (!intel_panel_preferred_fixed_mode(intel_connector))
> diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
> index 5ecc6fc80588..3b1da9aa023f 100644
> --- a/drivers/gpu/drm/i915/display/intel_panel.c
> +++ b/drivers/gpu/drm/i915/display/intel_panel.c
> @@ -159,7 +159,7 @@ static bool is_downclock_mode(const struct drm_display_mode *downclock_mode,
>  		downclock_mode->clock < fixed_mode->clock;
>  }
>  
> -void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
> +static void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>  	const struct drm_display_mode *fixed_mode =
> @@ -202,7 +202,7 @@ void intel_panel_add_edid_downclock_mode(struct intel_connector *connector)
>  	list_add_tail(&downclock_mode->head, &connector->panel.fixed_modes);
>  }
>  
> -void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
> +static void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>  	const struct drm_display_mode *scan;
> @@ -244,6 +244,13 @@ void intel_panel_add_edid_fixed_mode(struct intel_connector *connector)
>  	list_add_tail(&fixed_mode->head, &connector->panel.fixed_modes);
>  }
>  
> +void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, bool has_drrs)
> +{
> +	intel_panel_add_edid_fixed_mode(connector);
> +	if (intel_panel_preferred_fixed_mode(connector) && has_drrs)
> +		intel_panel_add_edid_downclock_mode(connector);
> +}
> +
>  static void intel_panel_add_fixed_mode(struct intel_connector *connector,
>  				       struct drm_display_mode *fixed_mode,
>  				       const char *type)
> diff --git a/drivers/gpu/drm/i915/display/intel_panel.h b/drivers/gpu/drm/i915/display/intel_panel.h
> index 5eaa2a1c2337..2e32bb728beb 100644
> --- a/drivers/gpu/drm/i915/display/intel_panel.h
> +++ b/drivers/gpu/drm/i915/display/intel_panel.h
> @@ -40,8 +40,7 @@ int intel_panel_fitting(struct intel_crtc_state *crtc_state,
>  			const struct drm_connector_state *conn_state);
>  int intel_panel_compute_config(struct intel_connector *connector,
>  			       struct drm_display_mode *adjusted_mode);
> -void intel_panel_add_edid_fixed_mode(struct intel_connector *connector);
> -void intel_panel_add_edid_downclock_mode(struct intel_connector *connector);
> +void intel_panel_add_edid_fixed_modes(struct intel_connector *connector, bool has_drrs);
>  void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector);
>  void intel_panel_add_vbt_sdvo_fixed_mode(struct intel_connector *connector);
>  void intel_panel_add_encoder_fixed_mode(struct intel_connector *connector,
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index 866e05c1a49d..ab88d8b783e6 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -2907,7 +2907,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
>  
>  	if (!intel_panel_preferred_fixed_mode(intel_connector)) {
>  		intel_ddc_get_modes(connector, &intel_sdvo->ddc);
> -		intel_panel_add_edid_fixed_mode(intel_connector);
> +		intel_panel_add_edid_fixed_modes(intel_connector, false);
>  	}
>  
>  	intel_panel_init(intel_connector);

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-03-31 13:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 11:28 [Intel-gfx] [PATCH v2 00/11] drm/i915: Finish off static DRRS Ville Syrjala
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 01/11] drm/i915: Extract intel_edp_has_drrs() Ville Syrjala
2022-04-04 12:24   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 02/11] drm/i915: Put fixed modes directly onto the panel's fixed_modes list Ville Syrjala
2022-03-31 13:04   ` Jani Nikula
2022-03-31 13:15     ` Jani Nikula
2022-03-31 13:16     ` Ville Syrjälä
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 03/11] drm/i915: Refactor non-EDID fixed mode duplication Ville Syrjala
2022-03-31 13:23   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 04/11] drm/i915: Nuke intel_drrs_init() Ville Syrjala
2022-03-31 13:25   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 05/11] drm/i915: Combine the EDID fixed_mode+downclock_mode lookup into one Ville Syrjala
2022-03-31 13:26   ` Jani Nikula [this message]
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 06/11] drm/i915: Stop duplicating the EDID fixed/downclock modes Ville Syrjala
2022-03-31 13:34   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 07/11] drm/i915: Allow an arbitrary number of downclock modes Ville Syrjala
2022-03-31 13:37   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 08/11] drm/i915: Allow higher refresh rate alternate fixed modes Ville Syrjala
2022-03-31 13:43   ` Jani Nikula
2022-03-31 16:55     ` Ville Syrjälä
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 09/11] drm/i915: Move intel_drrs_compute_config() into intel_dp.c Ville Syrjala
2022-03-31 13:46   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 10/11] drm/i915: Allow static DRRS on all eDP ports Ville Syrjala
2022-03-31 13:57   ` Jani Nikula
2022-03-31 11:28 ` [Intel-gfx] [PATCH v2 11/11] drm/i915: Allow static DRRS on LVDS Ville Syrjala
2022-03-31 13:59   ` Jani Nikula
2022-03-31 14:05     ` Ville Syrjälä
2022-04-01 15:09       ` Ville Syrjälä
2022-03-31 14:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Finish off static DRRS (rev2) Patchwork
2022-03-31 17:38 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=877d8a9rs7.fsf@intel.com \
    --to=jani.nikula@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).