diff mbox series

[1/5] drm/i915: Introduce g4x_hdmi_compute_config()

Message ID 20221107194604.15227-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Fix audio/infroframes on g4x | expand

Commit Message

Ville Syrjälä Nov. 7, 2022, 7:46 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Start pulling some of the more platform specific things out from
intel_hdmi_compute_config(). has_pch_encoder is clearly one
such thing.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/g4x_hdmi.c   | 14 +++++++++++++-
 drivers/gpu/drm/i915/display/intel_hdmi.c |  3 ---
 2 files changed, 13 insertions(+), 4 deletions(-)

Comments

Jani Nikula Nov. 8, 2022, 11:50 a.m. UTC | #1
On Mon, 07 Nov 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Start pulling some of the more platform specific things out from
> intel_hdmi_compute_config(). has_pch_encoder is clearly one
> such thing.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/i915/display/g4x_hdmi.c   | 14 +++++++++++++-
>  drivers/gpu/drm/i915/display/intel_hdmi.c |  3 ---
>  2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> index 8aadf96fa5e9..3d09359d7337 100644
> --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> @@ -78,6 +78,18 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
>  	return ret;
>  }
>  
> +static int g4x_hdmi_compute_config(struct intel_encoder *encoder,
> +				   struct intel_crtc_state *crtc_state,
> +				   struct drm_connector_state *conn_state)
> +{
> +	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> +
> +	if (HAS_PCH_SPLIT(i915))
> +		crtc_state->has_pch_encoder = true;
> +
> +	return intel_hdmi_compute_config(encoder, crtc_state, conn_state);
> +}
> +
>  static void intel_hdmi_get_config(struct intel_encoder *encoder,
>  				  struct intel_crtc_state *pipe_config)
>  {
> @@ -543,7 +555,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
>  			 "HDMI %c", port_name(port));
>  
>  	intel_encoder->hotplug = intel_hdmi_hotplug;
> -	intel_encoder->compute_config = intel_hdmi_compute_config;
> +	intel_encoder->compute_config = g4x_hdmi_compute_config;
>  	if (HAS_PCH_SPLIT(dev_priv)) {
>  		intel_encoder->disable = pch_disable_hdmi;
>  		intel_encoder->post_disable = pch_post_disable_hdmi;
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 02f8374ea51f..f2a4431a7fbf 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2257,9 +2257,6 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
>  		pipe_config->pixel_multiplier = 2;
>  
> -	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv))
> -		pipe_config->has_pch_encoder = true;
> -
>  	pipe_config->has_audio =
>  		intel_hdmi_has_audio(encoder, pipe_config, conn_state);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c
index 8aadf96fa5e9..3d09359d7337 100644
--- a/drivers/gpu/drm/i915/display/g4x_hdmi.c
+++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c
@@ -78,6 +78,18 @@  static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
 	return ret;
 }
 
+static int g4x_hdmi_compute_config(struct intel_encoder *encoder,
+				   struct intel_crtc_state *crtc_state,
+				   struct drm_connector_state *conn_state)
+{
+	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+
+	if (HAS_PCH_SPLIT(i915))
+		crtc_state->has_pch_encoder = true;
+
+	return intel_hdmi_compute_config(encoder, crtc_state, conn_state);
+}
+
 static void intel_hdmi_get_config(struct intel_encoder *encoder,
 				  struct intel_crtc_state *pipe_config)
 {
@@ -543,7 +555,7 @@  void g4x_hdmi_init(struct drm_i915_private *dev_priv,
 			 "HDMI %c", port_name(port));
 
 	intel_encoder->hotplug = intel_hdmi_hotplug;
-	intel_encoder->compute_config = intel_hdmi_compute_config;
+	intel_encoder->compute_config = g4x_hdmi_compute_config;
 	if (HAS_PCH_SPLIT(dev_priv)) {
 		intel_encoder->disable = pch_disable_hdmi;
 		intel_encoder->post_disable = pch_post_disable_hdmi;
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 02f8374ea51f..f2a4431a7fbf 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2257,9 +2257,6 @@  int intel_hdmi_compute_config(struct intel_encoder *encoder,
 	if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
 		pipe_config->pixel_multiplier = 2;
 
-	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv))
-		pipe_config->has_pch_encoder = true;
-
 	pipe_config->has_audio =
 		intel_hdmi_has_audio(encoder, pipe_config, conn_state);