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

Submitted by libin.yang@linux.intel.com on Dec. 23, 2015, 6:50 a.m.

Details

Message ID 1450853447-16795-1-git-send-email-libin.yang@linux.intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

libin.yang@linux.intel.com Dec. 23, 2015, 6:50 a.m.
From: Libin Yang <libin.yang@linux.intel.com>

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

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_audio.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 31f6d21..431487a0 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -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;

Comments

Sorry to interrupt.

I got this email sent to me. It seems one of my patch causes this 
issue? Does anyone know how to find which patch causes this issue from 
the below message? Thanks.

Best Regards,
Libin

On 12/23/2015 03:49 PM, Patchwork wrote:
> == Summary ==
>
> Built on 7e671e69deffb88d60687dacffe6e34a5d046500 drm-intel-nightly: 2015y-12m-22d-13h-28m-34s UTC integration manifest
>
> Test gem_storedw_loop:
>          Subgroup basic-render:
>                  pass       -> DMESG-WARN (skl-i5k-2)
> Test kms_flip:
>          Subgroup basic-flip-vs-dpms:
>                  dmesg-warn -> PASS       (ilk-hp8440p)
>          Subgroup basic-flip-vs-modeset:
>                  dmesg-warn -> PASS       (bsw-nuc-2)
>                  pass       -> DMESG-WARN (skl-i5k-2)
>                  dmesg-warn -> PASS       (byt-nuc)
>                  pass       -> DMESG-WARN (hsw-brixbox)
>                  pass       -> DMESG-WARN (bdw-nuci7)
>                  dmesg-warn -> PASS       (ilk-hp8440p)
>          Subgroup basic-plain-flip:
>                  pass       -> DMESG-WARN (bdw-ultra)
> Test kms_pipe_crc_basic:
>          Subgroup read-crc-pipe-a-frame-sequence:
>                  dmesg-warn -> PASS       (byt-nuc)
>          Subgroup read-crc-pipe-b:
>                  dmesg-warn -> PASS       (skl-i5k-2)
>          Subgroup read-crc-pipe-b-frame-sequence:
>                  pass       -> DMESG-WARN (byt-nuc)
> Test kms_psr_sink_crc:
>          Subgroup psr_basic:
>                  dmesg-warn -> PASS       (bdw-ultra)
>
> bdw-nuci7        total:132  pass:121  dwarn:2   dfail:0   fail:0   skip:9
> bdw-ultra        total:132  pass:124  dwarn:2   dfail:0   fail:0   skip:6
> bsw-nuc-2        total:135  pass:114  dwarn:1   dfail:0   fail:0   skip:20
> byt-nuc          total:135  pass:119  dwarn:3   dfail:0   fail:0   skip:13
> hsw-brixbox      total:135  pass:126  dwarn:2   dfail:0   fail:0   skip:7
> hsw-gt2          total:135  pass:130  dwarn:1   dfail:0   fail:0   skip:4
> hsw-xps12        total:132  pass:125  dwarn:3   dfail:0   fail:0   skip:4
> ilk-hp8440p      total:135  pass:100  dwarn:0   dfail:0   fail:0   skip:35
> ivb-t430s        total:135  pass:127  dwarn:2   dfail:0   fail:0   skip:6
> skl-i5k-2        total:135  pass:123  dwarn:4   dfail:0   fail:0   skip:8
> skl-i7k-2        total:135  pass:124  dwarn:3   dfail:0   fail:0   skip:8
> snb-dellxps      total:135  pass:121  dwarn:2   dfail:0   fail:0   skip:12
> snb-x220t        total:135  pass:122  dwarn:1   dfail:0   fail:1   skip:11
>
> Results at /archive/results/CI_IGT_test/Patchwork_799/
>
On Tue, 29 Dec 2015, Libin Yang <libin.yang@linux.intel.com> wrote:
> Sorry to interrupt.
>
> I got this email sent to me. It seems one of my patch causes this 
> issue? Does anyone know how to find which patch causes this issue from 
> the below message? Thanks.

Some of the tests don't give stable results yet. We're working on it. It
doesn't look like your patch would change the results of any of those
tests for real.

BR,
Jani.


>
> Best Regards,
> Libin
>
> On 12/23/2015 03:49 PM, Patchwork wrote:
>> == Summary ==
>>
>> Built on 7e671e69deffb88d60687dacffe6e34a5d046500 drm-intel-nightly: 2015y-12m-22d-13h-28m-34s UTC integration manifest
>>
>> Test gem_storedw_loop:
>>          Subgroup basic-render:
>>                  pass       -> DMESG-WARN (skl-i5k-2)
>> Test kms_flip:
>>          Subgroup basic-flip-vs-dpms:
>>                  dmesg-warn -> PASS       (ilk-hp8440p)
>>          Subgroup basic-flip-vs-modeset:
>>                  dmesg-warn -> PASS       (bsw-nuc-2)
>>                  pass       -> DMESG-WARN (skl-i5k-2)
>>                  dmesg-warn -> PASS       (byt-nuc)
>>                  pass       -> DMESG-WARN (hsw-brixbox)
>>                  pass       -> DMESG-WARN (bdw-nuci7)
>>                  dmesg-warn -> PASS       (ilk-hp8440p)
>>          Subgroup basic-plain-flip:
>>                  pass       -> DMESG-WARN (bdw-ultra)
>> Test kms_pipe_crc_basic:
>>          Subgroup read-crc-pipe-a-frame-sequence:
>>                  dmesg-warn -> PASS       (byt-nuc)
>>          Subgroup read-crc-pipe-b:
>>                  dmesg-warn -> PASS       (skl-i5k-2)
>>          Subgroup read-crc-pipe-b-frame-sequence:
>>                  pass       -> DMESG-WARN (byt-nuc)
>> Test kms_psr_sink_crc:
>>          Subgroup psr_basic:
>>                  dmesg-warn -> PASS       (bdw-ultra)
>>
>> bdw-nuci7        total:132  pass:121  dwarn:2   dfail:0   fail:0   skip:9
>> bdw-ultra        total:132  pass:124  dwarn:2   dfail:0   fail:0   skip:6
>> bsw-nuc-2        total:135  pass:114  dwarn:1   dfail:0   fail:0   skip:20
>> byt-nuc          total:135  pass:119  dwarn:3   dfail:0   fail:0   skip:13
>> hsw-brixbox      total:135  pass:126  dwarn:2   dfail:0   fail:0   skip:7
>> hsw-gt2          total:135  pass:130  dwarn:1   dfail:0   fail:0   skip:4
>> hsw-xps12        total:132  pass:125  dwarn:3   dfail:0   fail:0   skip:4
>> ilk-hp8440p      total:135  pass:100  dwarn:0   dfail:0   fail:0   skip:35
>> ivb-t430s        total:135  pass:127  dwarn:2   dfail:0   fail:0   skip:6
>> skl-i5k-2        total:135  pass:123  dwarn:4   dfail:0   fail:0   skip:8
>> skl-i7k-2        total:135  pass:124  dwarn:3   dfail:0   fail:0   skip:8
>> snb-dellxps      total:135  pass:121  dwarn:2   dfail:0   fail:0   skip:12
>> snb-x220t        total:135  pass:122  dwarn:1   dfail:0   fail:1   skip:11
>>
>> Results at /archive/results/CI_IGT_test/Patchwork_799/
>>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx