diff mbox series

[2/5] drm/i915: Expose the force_audio property with DP MST

Message ID 20190308192409.5804-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/5] drm/i915: Add broadcast RGB property for DP MST | expand

Commit Message

Ville Syrjälä March 8, 2019, 7:24 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We already expose the force_audio property with SST. Do the same
with MST.

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

Comments

Jani Nikula March 26, 2019, 10:41 a.m. UTC | #1
On Fri, 08 Mar 2019, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We already expose the force_audio property with SST. Do the same
> with MST.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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


> ---
>  drivers/gpu/drm/i915/intel_dp_mst.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 2b791d67a43f..f9ce9e87d35b 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -64,6 +64,14 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
>  		DRM_DEBUG_KMS("Setting pipe bpp to %d\n",
>  			      bpp);
>  	}
> +
> +	if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
> +		pipe_config->has_audio =
> +			drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, port);
> +	else
> +		pipe_config->has_audio =
> +			intel_conn_state->force_audio == HDMI_AUDIO_ON;
> +
>  	/*
>  	 * for MST we always configure max link bw - the spec doesn't
>  	 * seem to suggest we should do otherwise.
> @@ -76,9 +84,6 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
>  
>  	pipe_config->port_clock = intel_dp_max_link_rate(intel_dp);
>  
> -	if (drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, port))
> -		pipe_config->has_audio = true;
> -
>  	if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) {
>  		/*
>  		 * See:
> @@ -510,6 +515,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  	if (ret)
>  		goto err;
>  
> +	intel_attach_force_audio_property(connector);
>  	intel_attach_broadcast_rgb_property(connector);
>  
>  	return connector;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 2b791d67a43f..f9ce9e87d35b 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -64,6 +64,14 @@  static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
 		DRM_DEBUG_KMS("Setting pipe bpp to %d\n",
 			      bpp);
 	}
+
+	if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
+		pipe_config->has_audio =
+			drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, port);
+	else
+		pipe_config->has_audio =
+			intel_conn_state->force_audio == HDMI_AUDIO_ON;
+
 	/*
 	 * for MST we always configure max link bw - the spec doesn't
 	 * seem to suggest we should do otherwise.
@@ -76,9 +84,6 @@  static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
 
 	pipe_config->port_clock = intel_dp_max_link_rate(intel_dp);
 
-	if (drm_dp_mst_port_has_audio(&intel_dp->mst_mgr, port))
-		pipe_config->has_audio = true;
-
 	if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) {
 		/*
 		 * See:
@@ -510,6 +515,7 @@  static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 	if (ret)
 		goto err;
 
+	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
 
 	return connector;