diff mbox series

[v2,03/16] drm/i915/lvds: Pass fixed_mode to compute_is_dual_link_lvds()

Message ID 20220311172428.14685-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: DRRS fixes/cleanups and start of static DRRS | expand

Commit Message

Ville Syrjälä March 11, 2022, 5:24 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We want to eventually get rid of the connector->panel.fixed_mode
pointer so avoid using it during LVDS setup. Since this all
happens during the encoder init we already have the fixed_mode
around, just pass that in.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_lvds.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jani Nikula March 14, 2022, 9:44 a.m. UTC | #1
On Fri, 11 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We want to eventually get rid of the connector->panel.fixed_mode
> pointer so avoid using it during LVDS setup. Since this all
> happens during the encoder init we already have the fixed_mode
> around, just pass that in.
>
> 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_lvds.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c
> index 9fced37bed70..dd7292d3c88e 100644
> --- a/drivers/gpu/drm/i915/display/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/display/intel_lvds.c
> @@ -784,7 +784,8 @@ bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv)
>  	return encoder && to_lvds_encoder(&encoder->base)->is_dual_link;
>  }
>  
> -static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
> +static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder,
> +				      const struct drm_display_mode *fixed_mode)
>  {
>  	struct drm_device *dev = lvds_encoder->base.base.dev;
>  	unsigned int val;
> @@ -795,7 +796,7 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
>  		return dev_priv->params.lvds_channel_mode == 2;
>  
>  	/* single channel LVDS is limited to 112 MHz */
> -	if (lvds_encoder->attached_connector->panel.fixed_mode->clock > 112999)
> +	if (fixed_mode->clock > 112999)
>  		return true;
>  
>  	if (dmi_check_system(intel_dual_link_lvds))
> @@ -1004,7 +1005,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
>  	intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
>  	intel_backlight_setup(intel_connector, INVALID_PIPE);
>  
> -	lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
> +	lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder, fixed_mode);
>  	drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n",
>  		    lvds_encoder->is_dual_link ? "dual" : "single");
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c
index 9fced37bed70..dd7292d3c88e 100644
--- a/drivers/gpu/drm/i915/display/intel_lvds.c
+++ b/drivers/gpu/drm/i915/display/intel_lvds.c
@@ -784,7 +784,8 @@  bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv)
 	return encoder && to_lvds_encoder(&encoder->base)->is_dual_link;
 }
 
-static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
+static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder,
+				      const struct drm_display_mode *fixed_mode)
 {
 	struct drm_device *dev = lvds_encoder->base.base.dev;
 	unsigned int val;
@@ -795,7 +796,7 @@  static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
 		return dev_priv->params.lvds_channel_mode == 2;
 
 	/* single channel LVDS is limited to 112 MHz */
-	if (lvds_encoder->attached_connector->panel.fixed_mode->clock > 112999)
+	if (fixed_mode->clock > 112999)
 		return true;
 
 	if (dmi_check_system(intel_dual_link_lvds))
@@ -1004,7 +1005,7 @@  void intel_lvds_init(struct drm_i915_private *dev_priv)
 	intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
 	intel_backlight_setup(intel_connector, INVALID_PIPE);
 
-	lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
+	lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder, fixed_mode);
 	drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n",
 		    lvds_encoder->is_dual_link ? "dual" : "single");