Skip to contentSkip to conversation

drm/i915/audio: extend get_saved_enc() to support more scenarios

PATCH In review [email protected] 4 participants 6 messages Sep 26, 2016

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

PATCH 1/1 drm/i915/audio: extend get_saved_enc() to support more scenarios

From: Libin Yang <[email protected]>

When bootup, audio driver may not know it is MST or not. The audio driver will poll all the port & pipe combinations in either MST or Non-MST mode. get_saved_enc() should handle this situation.

---
 drivers/gpu/drm/i915/intel_audio.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +28 -4
index 9583f43..a6af14f 100644
@@ -635,25 +635,49 @@ static int i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }
 
+/*
+ * get the intel_encoder according to the parameter port and pipe
+ * intel_encoder is saved by the index of pipe
+ * MST & (pipe >= 0): return the av_enc_map[pipe],
+ *   when port is matched
+ * MST & (pipe < 0): this is invalid
+ * Non-MST & (pipe >= 0): only pipe = 0 (the first device entry)
+ *   will get the right intel_encoder with port matched
+ * Non-MST & (pipe < 0): get the right intel_encoder with port matched
+ */
 static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
 					       int port, int pipe)
 {
+	struct intel_encoder *encoder;
 
 	if (WARN_ON(pipe >= I915_MAX_PIPES))
 		return NULL;
 
 	/* MST */
-	if (pipe >= 0)
-		return dev_priv->av_enc_map[pipe];
+	if (pipe >= 0) {
+		encoder = dev_priv->av_enc_map[pipe];
+		/*
+		 * when bootup, audio driver may not know it is
+		 * MST or not. So it will poll all the port & pipe
+		 * combinations
+		 */
+		if (encoder != NULL && encoder->port == port &&
+		    encoder->type == INTEL_OUTPUT_DP_MST)
+			return encoder;
+	}
 
 	/* Non-MST */
-	for_each_pipe(dev_priv, pipe) {
-		struct intel_encoder *encoder;
+	if (pipe > 0)
+		return NULL;
 
+	for_each_pipe(dev_priv, pipe) {
 		encoder = dev_priv->av_enc_map[pipe];
 		if (encoder == NULL)
 			continue;
 
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
 			return encoder;
 	}
Signature · 6 lines
1.9.1

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

Add DK, Jim and Jeeja

Regards,
Libin

Quoted 85 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:21 PM
To: [email protected]; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

From: Libin Yang <[email protected]>

When bootup, audio driver may not know it is MST or not. The audio driver will poll all the port & pipe combinations in either MST or Non-MST mode. get_saved_enc() should handle this situation.

---
 drivers/gpu/drm/i915/intel_audio.c | 32 ++++++++++++++++++++++++++++--
--
 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +28 -4
index 9583f43..a6af14f 100644
@@ -635,25 +635,49 @@ static int
 i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }
 
+/*
+ * get the intel_encoder according to the parameter port and pipe
+ * intel_encoder is saved by the index of pipe
+ * MST & (pipe >= 0): return the av_enc_map[pipe],
+ *   when port is matched
+ * MST & (pipe < 0): this is invalid
+ * Non-MST & (pipe >= 0): only pipe = 0 (the first device entry)
+ *   will get the right intel_encoder with port matched
+ * Non-MST & (pipe < 0): get the right intel_encoder with port matched
+*/
 static struct intel_encoder *get_saved_enc(struct drm_i915_private
 *dev_priv,
 					       int port, int pipe)
 {
+	struct intel_encoder *encoder;
 
 	if (WARN_ON(pipe >= I915_MAX_PIPES))
 		return NULL;
 
 	/* MST */
-	if (pipe >= 0)
-		return dev_priv->av_enc_map[pipe];
+	if (pipe >= 0) {
+		encoder = dev_priv->av_enc_map[pipe];
+		/*
+		 * when bootup, audio driver may not know it is
+		 * MST or not. So it will poll all the port & pipe
+		 * combinations
+		 */
+		if (encoder != NULL && encoder->port == port &&
+		    encoder->type == INTEL_OUTPUT_DP_MST)
+			return encoder;
+	}
 
 	/* Non-MST */
-	for_each_pipe(dev_priv, pipe) {
-		struct intel_encoder *encoder;
+	if (pipe > 0)
+		return NULL;
 
+	for_each_pipe(dev_priv, pipe) {
 		encoder = dev_priv->av_enc_map[pipe];
 		if (encoder == NULL)
 			continue;
 
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
drivers/gpu/drm/i915/intel_audio.c +0 -1
 			return encoder;
 	}
--
Quoted 1 line

1.9.1

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

maintainer
#2 lore raw

I will NAK all further DP MST audio patches until

https://bugs.freedesktop.org/show_bug.cgi?id=97907

is fixed.

BR,
Jani.

Quoted 93 lines · Libin

Add DK, Jim and Jeeja

Regards,
Libin

Quoted 86 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:21 PM
To: [email protected]; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

From: Libin Yang <[email protected]>

When bootup, audio driver may not know it is MST or not. The audio driver will poll all the port & pipe combinations in either MST or Non-MST mode. get_saved_enc() should handle this situation.

---
 drivers/gpu/drm/i915/intel_audio.c | 32 ++++++++++++++++++++++++++++--
--
 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +28 -4
index 9583f43..a6af14f 100644
@@ -635,25 +635,49 @@ static int
 i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }
 
+/*
+ * get the intel_encoder according to the parameter port and pipe
+ * intel_encoder is saved by the index of pipe
+ * MST & (pipe >= 0): return the av_enc_map[pipe],
+ *   when port is matched
+ * MST & (pipe < 0): this is invalid
+ * Non-MST & (pipe >= 0): only pipe = 0 (the first device entry)
+ *   will get the right intel_encoder with port matched
+ * Non-MST & (pipe < 0): get the right intel_encoder with port matched
+*/
 static struct intel_encoder *get_saved_enc(struct drm_i915_private
 *dev_priv,
 					       int port, int pipe)
 {
+	struct intel_encoder *encoder;
 
 	if (WARN_ON(pipe >= I915_MAX_PIPES))
 		return NULL;
 
 	/* MST */
-	if (pipe >= 0)
-		return dev_priv->av_enc_map[pipe];
+	if (pipe >= 0) {
+		encoder = dev_priv->av_enc_map[pipe];
+		/*
+		 * when bootup, audio driver may not know it is
+		 * MST or not. So it will poll all the port & pipe
+		 * combinations
+		 */
+		if (encoder != NULL && encoder->port == port &&
+		    encoder->type == INTEL_OUTPUT_DP_MST)
+			return encoder;
+	}
 
 	/* Non-MST */
-	for_each_pipe(dev_priv, pipe) {
-		struct intel_encoder *encoder;
+	if (pipe > 0)
+		return NULL;
 
+	for_each_pipe(dev_priv, pipe) {
 		encoder = dev_priv->av_enc_map[pipe];
 		if (encoder == NULL)
 			continue;
 
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
drivers/gpu/drm/i915/intel_audio.c +0 -1
 			return encoder;
 	}
--

1.9.1

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

✓ Fi.CI.BAT: success for drm/i915/audio: extend get_saved_enc() to support more scenarios

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: drm/i915/audio: extend get_saved_enc() to support more scenarios
URL : https://patchwork.freedesktop.org/series/12917/
State : success

== Summary ==

Series 12917v1 drm/i915/audio: extend get_saved_enc() to support more scenarios
https://patchwork.freedesktop.org/api/1.0/series/12917/revisions/1/mbox/

Test gem_exec_gttfill:

        Subgroup basic:
                skip       -> PASS       (fi-ivb-3520m)
                skip       -> PASS       (fi-snb-2520m)
                skip       -> PASS       (fi-hsw-4770r)
                skip       -> PASS       (fi-byt-n2820)
Test kms_psr_sink_crc:
        Subgroup psr_basic:
                dmesg-warn -> PASS       (fi-skl-6700hq)
fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
fi-byt-n2820     total:244  pass:208  dwarn:0   dfail:0   fail:1   skip:35 
fi-hsw-4770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-hsw-4770r     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ilk-650       total:244  pass:182  dwarn:0   dfail:0   fail:2   skip:60 
fi-ivb-3520m     total:244  pass:219  dwarn:0   dfail:0   fail:0   skip:25 
fi-ivb-3770      total:244  pass:207  dwarn:0   dfail:0   fail:0   skip:37 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6700k     total:244  pass:219  dwarn:1   dfail:0   fail:0   skip:24 
fi-skl-6770hq    total:244  pass:228  dwarn:1   dfail:0   fail:1   skip:14 
fi-snb-2520m     total:244  pass:208  dwarn:0   dfail:0   fail:0   skip:36 
fi-snb-2600      total:244  pass:206  dwarn:0   dfail:0   fail:0   skip:38 

Results at /archive/results/CI_IGT_test/Patchwork_2573/

3c9e639197bb52280334830e611082d5b6bfaceb drm-intel-nightly: 2016y-09m-25d-21h-07m-07s UTC integration manifest 5251283 drm/i915/audio: extend get_saved_enc() to support more scenarios

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

#3 lore raw
In reply to Jani Nikula

Yes, I see. I will co-work with DK to fix the issue.

Regards,
Libin

Quoted 120 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:39 PM
To: Yang, Libin <[email protected]>; [email protected]; intel- [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Pandiyan, Dhinakaran <[email protected]>; Bride, Jim <[email protected]>; Kp, Jeeja <[email protected]>
Subject: RE: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

I will NAK all further DP MST audio patches until

https://bugs.freedesktop.org/show_bug.cgi?id=97907

is fixed.

BR,
Jani.

Quoted 21 lines · Libin

Add DK, Jim and Jeeja

Regards,
Libin

Quoted 15 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:21 PM
To: [email protected]; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

From: Libin Yang <[email protected]>

When bootup, audio driver may not know it is MST or not. The audio driver will poll all the port & pipe combinations in either MST or Non-MST

mode.

Quoted 64 lines
Quoted 64 lines

get_saved_enc() should handle this situation.

---
 drivers/gpu/drm/i915/intel_audio.c | 32
++++++++++++++++++++++++++++--
--
 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +25 -4
index 9583f43..a6af14f 100644
@@ -635,25 +635,49 @@ static int
 i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }
 
+/*
+ * get the intel_encoder according to the parameter port and pipe
+ * intel_encoder is saved by the index of pipe
+ * MST & (pipe >= 0): return the av_enc_map[pipe],
+ *   when port is matched
+ * MST & (pipe < 0): this is invalid
+ * Non-MST & (pipe >= 0): only pipe = 0 (the first device entry)
+ *   will get the right intel_encoder with port matched
+ * Non-MST & (pipe < 0): get the right intel_encoder with port
+matched */
 static struct intel_encoder *get_saved_enc(struct drm_i915_private
 *dev_priv,
 					       int port, int pipe)
 {
+	struct intel_encoder *encoder;
 
 	if (WARN_ON(pipe >= I915_MAX_PIPES))
 		return NULL;
 
 	/* MST */
-	if (pipe >= 0)
-		return dev_priv->av_enc_map[pipe];
+	if (pipe >= 0) {
+		encoder = dev_priv->av_enc_map[pipe];
+		/*
+		 * when bootup, audio driver may not know it is
+		 * MST or not. So it will poll all the port & pipe
+		 * combinations
+		 */
+		if (encoder != NULL && encoder->port == port &&
+		    encoder->type == INTEL_OUTPUT_DP_MST)
+			return encoder;
+	}
 
 	/* Non-MST */
-	for_each_pipe(dev_priv, pipe) {
-		struct intel_encoder *encoder;
+	if (pipe > 0)
+		return NULL;
 
+	for_each_pipe(dev_priv, pipe) {
 		encoder = dev_priv->av_enc_map[pipe];
 		if (encoder == NULL)
 			continue;
 
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_audio.c +3 -0
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
drivers/gpu/drm/i915/intel_audio.c +0 -1
 			return encoder;
 	}
--

1.9.1

Quoted 2 lines

--
Jani Nikula, Intel Open Source Technology Center

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

maintainer
#4 lore raw

Thanks. Unless there's a trivial quick fix, I expect a revert first.

BR,
Jani.

Quoted 128 lines · Libin

Yes, I see. I will co-work with DK to fix the issue.

Regards,
Libin

Quoted 122 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:39 PM
To: Yang, Libin <[email protected]>; [email protected]; intel- [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Pandiyan, Dhinakaran <[email protected]>; Bride, Jim <[email protected]>; Kp, Jeeja <[email protected]>
Subject: RE: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

I will NAK all further DP MST audio patches until

https://bugs.freedesktop.org/show_bug.cgi?id=97907

is fixed.

BR,
Jani.

Quoted 21 lines · Libin

Add DK, Jim and Jeeja

Regards,
Libin

Quoted 15 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, September 26, 2016 4:21 PM
To: [email protected]; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

From: Libin Yang <[email protected]>

When bootup, audio driver may not know it is MST or not. The audio driver will poll all the port & pipe combinations in either MST or Non-MST

mode.

Quoted 64 lines
Quoted 64 lines

get_saved_enc() should handle this situation.

---
 drivers/gpu/drm/i915/intel_audio.c | 32
++++++++++++++++++++++++++++--
--
 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +25 -4
index 9583f43..a6af14f 100644
@@ -635,25 +635,49 @@ static int
 i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }
 
+/*
+ * get the intel_encoder according to the parameter port and pipe
+ * intel_encoder is saved by the index of pipe
+ * MST & (pipe >= 0): return the av_enc_map[pipe],
+ *   when port is matched
+ * MST & (pipe < 0): this is invalid
+ * Non-MST & (pipe >= 0): only pipe = 0 (the first device entry)
+ *   will get the right intel_encoder with port matched
+ * Non-MST & (pipe < 0): get the right intel_encoder with port
+matched */
 static struct intel_encoder *get_saved_enc(struct drm_i915_private
 *dev_priv,
 					       int port, int pipe)
 {
+	struct intel_encoder *encoder;
 
 	if (WARN_ON(pipe >= I915_MAX_PIPES))
 		return NULL;
 
 	/* MST */
-	if (pipe >= 0)
-		return dev_priv->av_enc_map[pipe];
+	if (pipe >= 0) {
+		encoder = dev_priv->av_enc_map[pipe];
+		/*
+		 * when bootup, audio driver may not know it is
+		 * MST or not. So it will poll all the port & pipe
+		 * combinations
+		 */
+		if (encoder != NULL && encoder->port == port &&
+		    encoder->type == INTEL_OUTPUT_DP_MST)
+			return encoder;
+	}
 
 	/* Non-MST */
-	for_each_pipe(dev_priv, pipe) {
-		struct intel_encoder *encoder;
+	if (pipe > 0)
+		return NULL;
 
+	for_each_pipe(dev_priv, pipe) {
 		encoder = dev_priv->av_enc_map[pipe];
 		if (encoder == NULL)
 			continue;
 
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_audio.c +3 -0
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
drivers/gpu/drm/i915/intel_audio.c +0 -1
 			return encoder;
 	}
--

1.9.1

--
Jani Nikula, Intel Open Source Technology Center

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx