diff mbox series

[1/2] drm/i915/dp: fix DP audio for PORT_A on gen12+

Message ID 20191122134603.11496-1-kai.vehmanen@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/dp: fix DP audio for PORT_A on gen12+ | expand

Commit Message

Kai Vehmanen Nov. 22, 2019, 1:46 p.m. UTC
Starting with gen12, PORT_A can be connected to a transcoder
with audio support. Modify the existing logic that disabled
audio on PORT_A unconditionally.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä Nov. 22, 2019, 2:01 p.m. UTC | #1
On Fri, Nov 22, 2019 at 03:46:02PM +0200, Kai Vehmanen wrote:
> Starting with gen12, PORT_A can be connected to a transcoder
> with audio support. Modify the existing logic that disabled
> audio on PORT_A unconditionally.
> 
> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0a023f3e633b..c50cf809b44c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2341,7 +2341,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
>  		return ret;
>  
>  	pipe_config->has_drrs = false;
> -	if (IS_G4X(dev_priv) || port == PORT_A)
> +	if (IS_G4X(dev_priv) || (INTEL_GEN(dev_priv) < 12 && port == PORT_A))

Getting a bit messy.

Hoovering that into something like
static bool intel_dp_port_has_audio(struct intel_encoder *encoder);
or
static bool intel_dp_port_has_audio(struct drm_i915_private *dev_priv, enum port port);
might be nice.


>  		pipe_config->has_audio = false;
>  	else if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
>  		pipe_config->has_audio = intel_dp->has_audio;
> -- 
> 2.17.1
Kai Vehmanen Nov. 25, 2019, 12:54 p.m. UTC | #2
Hi,

On Fri, 22 Nov 2019, Ville Syrjälä wrote:

> > -	if (IS_G4X(dev_priv) || port == PORT_A)
> > +	if (IS_G4X(dev_priv) || (INTEL_GEN(dev_priv) < 12 && port == PORT_A))
> 
> Getting a bit messy.
> 
> Hoovering that into something like
> static bool intel_dp_port_has_audio(struct intel_encoder *encoder);
> or
> static bool intel_dp_port_has_audio(struct drm_i915_private *dev_priv, enum port port);
> might be nice.

thanks for the review! I went for the latter option in the v2 I just
sent out.

Br, Kai
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 0a023f3e633b..c50cf809b44c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2341,7 +2341,7 @@  intel_dp_compute_config(struct intel_encoder *encoder,
 		return ret;
 
 	pipe_config->has_drrs = false;
-	if (IS_G4X(dev_priv) || port == PORT_A)
+	if (IS_G4X(dev_priv) || (INTEL_GEN(dev_priv) < 12 && port == PORT_A))
 		pipe_config->has_audio = false;
 	else if (intel_conn_state->force_audio == HDMI_AUDIO_AUTO)
 		pipe_config->has_audio = intel_dp->has_audio;