Skip to contentSkip to conversation

drm/i915: fix get digital port issue in intel_audio

PATCH In review [email protected] 5 participants 7 messages Jan 6, 2016 – Jan 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: fix get digital port issue in intel_audio

From: Libin Yang <[email protected]>

For DP MST, use enc_to_mst(encoder)->primary to get intel_digital_port, instead of using enc_to_dig_port(encoder).

---
 drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +17 -4
index 31f6d21..431487a0 100644
@@ -187,6 +187,16 @@ static bool intel_eld_uptodate(struct drm_connector *connector,
 	return true;
 }
 
+static struct intel_digital_port *
+intel_encoder_to_dig_port(struct intel_encoder *intel_encoder)
+{
+	struct drm_encoder *encoder = &intel_encoder->base;
+
+	if (intel_encoder->type == INTEL_OUTPUT_DP_MST)
+		return enc_to_mst(encoder)->primary;
+	return enc_to_dig_port(encoder);
+}
+
 static void g4x_audio_codec_disable(struct intel_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
@@ -286,7 +296,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,
 	struct i915_audio_component *acomp = dev_priv->audio_component;
 	const uint8_t *eld = connector->eld;
 	struct intel_digital_port *intel_dig_port =
-		enc_to_dig_port(&encoder->base);
+		intel_encoder_to_dig_port(encoder);
 	enum port port = intel_dig_port->port;
 	uint32_t tmp;
 	int len, i;
@@ -500,7 +510,8 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder)
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv->audio_component;
-	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 	enum port port = intel_dig_port->port;
 
 	connector = drm_select_eld(encoder);
@@ -546,7 +557,8 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv->audio_component;
-	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 	enum port port = intel_dig_port->port;
 
 	if (dev_priv->display.audio_codec_disable)
@@ -724,7 +736,8 @@ static int i915_audio_component_get_eld(struct device *dev, int port,
 	/* intel_encoder might be NULL for DP MST */
 	if (intel_encoder) {
 		ret = 0;
-		intel_dig_port = enc_to_dig_port(&intel_encoder->base);
+		intel_dig_port =
+			intel_encoder_to_dig_port(intel_encoder);
 		*enabled = intel_dig_port->audio_connector != NULL;
 		if (*enabled) {
 			eld = intel_dig_port->audio_connector->eld;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/i915: add dp mst judgement in hsw_audio_codec_enable

From: Libin Yang <[email protected]>

hsw platforms supports DP MST while ilk doesn't.
This patch fixes the bug.

---
 drivers/gpu/drm/i915/intel_audio.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +4 -7
index 431487a0..d8d42d3 100644
@@ -272,8 +272,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder)
 	tmp |= AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_UPPER_N_MASK;
 	tmp &= ~AUD_CONFIG_LOWER_N_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 
@@ -339,7 +338,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	else
 		tmp |= audio_config_hdmi_pixel_clock(adjusted_mode);
@@ -486,8 +485,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	else
 		tmp |= audio_config_hdmi_pixel_clock(adjusted_mode);
@@ -526,8 +524,7 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder)
 
 	/* ELD Conn_Type */
 	connector->eld[5] &= ~(3 << 2);
-	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(crtc, INTEL_OUTPUT_DP_MST))
+	if (crtc->config->has_dp_encoder)
 		connector->eld[5] |= (1 << 2);
 
 	connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

✗ failure: Fi.CI.BAT

In reply to [email protected]
== Summary ==

== Summary ==

Built on 89d0d1b6f0e9c3a6b90476bd115cfe1881646fd6 drm-intel-nightly: 2016y-01m-06d-10h-37m-17s UTC integration manifest

Test kms_addfb_basic:

        Subgroup small-bo:
                skip       -> PASS       (bdw-nuci7)
Test pm_rpm:
        Subgroup basic-rte:
                pass       -> DMESG-WARN (byt-nuc) UNSTABLE
bdw-nuci7        total:132  pass:1    dwarn:0   dfail:0   fail:0   skip:131
bsw-nuc-2        total:135  pass:115  dwarn:0   dfail:0   fail:0   skip:20 
byt-nuc          total:135  pass:121  dwarn:1   dfail:0   fail:0   skip:13 
skl-i5k-2        total:135  pass:125  dwarn:2   dfail:0   fail:0   skip:8  
skl-i7k-2        total:135  pass:125  dwarn:2   dfail:0   fail:0   skip:8  

HANGED snb-dellxps in igt@drv_module_reload_basic

Results at /archive/results/CI_IGT_test/Patchwork_1097/

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
In reply to [email protected]
Quoted 32 lines · On Wed, Jan 06, 2016 at 10:26:41AM +0800, [email protected] wrote:

From: Libin Yang <[email protected]>

For DP MST, use enc_to_mst(encoder)->primary to get intel_digital_port, instead of using enc_to_dig_port(encoder).

---
 drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +10 -0
index 31f6d21..431487a0 100644
@@ -187,6 +187,16 @@ static bool intel_eld_uptodate(struct drm_connector *connector,
 	return true;
 }
 
+static struct intel_digital_port *
+intel_encoder_to_dig_port(struct intel_encoder *intel_encoder)
+{
+	struct drm_encoder *encoder = &intel_encoder->base;
+
+	if (intel_encoder->type == INTEL_OUTPUT_DP_MST)
+		return enc_to_mst(encoder)->primary;
+	return enc_to_dig_port(encoder);
+}
+
 static void g4x_audio_codec_disable(struct intel_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;

drivers/gpu/drm/i915/intel_audio.c static void hsw_audio_codec_enable(struct drm_connector *connector, · line 299

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
@@ -286,7 +296,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,
 	struct i915_audio_component *acomp = dev_priv->audio_component;
 	const uint8_t *eld = connector->eld;
 	struct intel_digital_port *intel_dig_port =
-		enc_to_dig_port(&encoder->base);
+		intel_encoder_to_dig_port(encoder);

This hunk makes sense since we just look at intel_dig_port->port. Might make sense to entirely eliminate the local inte_dig_port variable from these hooks so that there's no confusion whether it points at the fake or primary encoder.

Quoted 25 lines
drivers/gpu/drm/i915/intel_audio.c +4 -2
 	enum port port = intel_dig_port->port;
 	uint32_t tmp;
 	int len, i;
@@ -500,7 +510,8 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder)
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv->audio_component;
-	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 	enum port port = intel_dig_port->port;
 
 	connector = drm_select_eld(encoder);
@@ -546,7 +557,8 @@ void intel_audio_codec_disable(struct intel_encoder *intel_encoder)
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv->audio_component;
-	struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 
 	enum port port = intel_dig_port->port;
 
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	if (dev_priv->display.audio_codec_disable)

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_eld(struct device *dev, int port, · line 741

Quoted 7 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
@@ -724,7 +736,8 @@ static int i915_audio_component_get_eld(struct device *dev, int port,
 	/* intel_encoder might be NULL for DP MST */
 	if (intel_encoder) {
 		ret = 0;
-		intel_dig_port = enc_to_dig_port(&intel_encoder->base);
+		intel_dig_port =
+			intel_encoder_to_dig_port(intel_encoder);
 		*enabled = intel_dig_port->audio_connector != NULL;

These not so much. We'd clobber 'intel_dig_port->audio_connector' for the primary encoder whenever a new MST stream is enabled.

Was the intention just to fix the port information passed to .pin_eld_notify()?

This whole thing seems highlight a rather big issue with the current component stuff; How do you tell the streams apart when all are using the same DDI port?

Quoted 4 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		if (*enabled) {
 			eld = intel_dig_port->audio_connector->eld;
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: add dp mst judgement in hsw_audio_codec_enable

In reply to [email protected]
Quoted 34 lines · On Wed, Jan 06, 2016 at 10:26:42AM +0800, [email protected] wrote:

From: Libin Yang <[email protected]>

hsw platforms supports DP MST while ilk doesn't.
This patch fixes the bug.

---
 drivers/gpu/drm/i915/intel_audio.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +2 -3
index 431487a0..d8d42d3 100644
@@ -272,8 +272,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder)
 	tmp |= AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_UPPER_N_MASK;
 	tmp &= ~AUD_CONFIG_LOWER_N_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 
@@ -339,7 +338,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	else
 		tmp |= audio_config_hdmi_pixel_clock(adjusted_mode);

drivers/gpu/drm/i915/intel_audio.c static void ilk_audio_codec_enable(struct drm_connector *connector, · line 488

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +1 -2
@@ -486,8 +485,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))

Could have used has_dp_encoder everywhere, but whatever

Quoted 15 lines
drivers/gpu/drm/i915/intel_audio.c +1 -2
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	else
 		tmp |= audio_config_hdmi_pixel_clock(adjusted_mode);
@@ -526,8 +524,7 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder)
 
 	/* ELD Conn_Type */
 	connector->eld[5] &= ~(3 << 2);
-	if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(crtc, INTEL_OUTPUT_DP_MST))
+	if (crtc->config->has_dp_encoder)
 		connector->eld[5] |= (1 << 2);
 
 	connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH 2/2] drm/i915: add dp mst judgement in hsw_audio_codec_enable

Quoted 35 lines · Ville Syrjälä
Quoted 34 lines · On Wed, Jan 06, 2016 at 10:26:42AM +0800, [email protected] wrote:

From: Libin Yang <[email protected]>

hsw platforms supports DP MST while ilk doesn't.
This patch fixes the bug.

---
 drivers/gpu/drm/i915/intel_audio.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +2 -3
index 431487a0..d8d42d3 100644
@@ -272,8 +272,7 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder)
 	tmp |= AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_UPPER_N_MASK;
 	tmp &= ~AUD_CONFIG_LOWER_N_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 
@@ -339,7 +338,7 @@ static void hsw_audio_codec_enable(struct drm_connector *connector,
 	tmp = I915_READ(HSW_AUD_CFG(pipe));
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))
+	if (intel_crtc->config->has_dp_encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	else
 		tmp |= audio_config_hdmi_pixel_clock(adjusted_mode);
@@ -486,8 +485,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
Quoted 8 lines

drivers/gpu/drm/i915/intel_audio.c static void ilk_audio_codec_enable(struct drm_connector *connector, · line 488

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +1 -2
 	tmp &= ~AUD_CONFIG_N_VALUE_INDEX;
 	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
 	tmp &= ~AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK;
-	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT) ||
-	    intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DP_MST))
+	if (intel_pipe_has_type(intel_crtc, INTEL_OUTPUT_DISPLAYPORT))

Could have used has_dp_encoder everywhere, but whatever

I think this would be good chance to do for consistency, before merging. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
In reply to Ville Syrjälä

Hi Ville,

Quoted 47 lines

-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Friday, January 08, 2016 12:50 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Vetter, Daniel; [email protected]; Yang, Libin
Subject: Re: [PATCH 1/2] drm/i915: fix get digital port issue in intel_audio

Quoted 3 lines · On Wed, Jan 06, 2016 at 10:26:41AM +0800, [email protected] wrote:

From: Libin Yang <[email protected]>

For DP MST, use enc_to_mst(encoder)->primary to get

intel_digital_port,

Review

Quoted 8 lines

instead of using enc_to_dig_port(encoder).

---
 drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_audio.c

drivers/gpu/drm/i915/intel_audio.c static bool intel_eld_uptodate(struct

Quoted 4 lines

index 31f6d21..431487a0 100644

drivers/gpu/drm/i915/intel_audio.c +0 -0
@@ -187,6 +187,16 @@ static bool intel_eld_uptodate(struct

drm_connector *connector,

drivers/gpu/drm/i915/intel_audio.c static void hsw_audio_codec_enable(struct

Quoted 18 lines
drivers/gpu/drm/i915/intel_audio.c +10 -0
 	return true;
 }
 
+static struct intel_digital_port *
+intel_encoder_to_dig_port(struct intel_encoder *intel_encoder)
+{
+	struct drm_encoder *encoder = &intel_encoder->base;
+
+	if (intel_encoder->type == INTEL_OUTPUT_DP_MST)
+		return enc_to_mst(encoder)->primary;
+	return enc_to_dig_port(encoder);
+}
+
 static void g4x_audio_codec_disable(struct intel_encoder *encoder)
 {
 	struct drm_i915_private *dev_priv = encoder->base.dev-

dev_private;

drivers/gpu/drm/i915/intel_audio.c +0 -0
@@ -286,7 +296,7 @@ static void hsw_audio_codec_enable(struct

drm_connector *connector,

Quoted 11 lines

drivers/gpu/drm/i915/intel_audio.c static void hsw_audio_codec_enable(struct drm_connector *connector, · line 299

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
 	struct i915_audio_component *acomp = dev_priv-
 audio_component;
 	const uint8_t *eld = connector->eld;
 	struct intel_digital_port *intel_dig_port =
-		enc_to_dig_port(&encoder->base);
+		intel_encoder_to_dig_port(encoder);

This hunk makes sense since we just look at intel_dig_port->port. Might make sense to entirely eliminate the local inte_dig_port variable from these hooks so that there's no confusion whether it points at the fake or primary encoder.

Do you mean we can still use enc_to_dig_port()? Maybe the new code is better. What do you think we use the wrapper intel_encoder_to_dig_port() here?

Quoted 33 lines

drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_enable(struct

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	enum port port = intel_dig_port->port;
 	uint32_t tmp;
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	int len, i;
@@ -500,7 +510,8 @@ void intel_audio_codec_enable(struct

intel_encoder *intel_encoder)

drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_enable(struct · line 504

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +0 -1
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv-
 audio_component;
-	struct intel_digital_port *intel_dig_port =

enc_to_dig_port(encoder);

drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_disable(struct

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -0
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 	enum port port = intel_dig_port->port;
 
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	connector = drm_select_eld(encoder);
@@ -546,7 +557,8 @@ void intel_audio_codec_disable(struct

intel_encoder *intel_encoder)

drivers/gpu/drm/i915/intel_audio.c void intel_audio_codec_disable(struct · line 550

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +0 -1
 	struct drm_device *dev = encoder->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_audio_component *acomp = dev_priv-
 audio_component;
-	struct intel_digital_port *intel_dig_port =

enc_to_dig_port(encoder);

drivers/gpu/drm/i915/intel_audio.c static int

Quoted 7 lines
drivers/gpu/drm/i915/intel_audio.c +2 -0
+	struct intel_digital_port *intel_dig_port =
+		intel_encoder_to_dig_port(intel_encoder);
 
 	enum port port = intel_dig_port->port;
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	if (dev_priv->display.audio_codec_disable)
@@ -724,7 +736,8 @@ static int

i915_audio_component_get_eld(struct device *dev, int port,

Quoted 11 lines

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_eld(struct device *dev, int port, · line 741

Quoted 8 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
 	/* intel_encoder might be NULL for DP MST */
 	if (intel_encoder) {
 		ret = 0;
-		intel_dig_port = enc_to_dig_port(&intel_encoder-
 base);
+		intel_dig_port =
+			intel_encoder_to_dig_port(intel_encoder);
 		*enabled = intel_dig_port->audio_connector != NULL;

These not so much. We'd clobber 'intel_dig_port->audio_connector' for the primary encoder whenever a new MST stream is enabled.

Yes. If we are using i915_audio_component_get_eld() for MST audio, we need a parameter device_entry_id in the function. I remember David has sent a patch to support device entry before. But MST was not supported and he removed the device_entry_id parameter.

Quoted 3 lines

Was the intention just to fix the port information passed to .pin_eld_notify()?

No. It's based on device entry.

Quoted 4 lines

This whole thing seems highlight a rather big issue with the current component stuff; How do you tell the streams apart when all are using the same DDI port?

If we need support other device entries, we need get the other ports besides primary port. Do you know how to get the ports?

As Takashi has changed to get eld_info from unsol_event to using this callback, it seems this is a must to support MST audio.

Quoted 9 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		if (*enabled) {

eld = intel_dig_port->audio_connector->eld;
--
1.9.1

--
Ville Syrjälä
Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx