Skip to contentSkip to conversation

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

PATCH In review [email protected] 4 participants 12 messages Nov 15, 2016 – Dec 1, 2016

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

PATCH 1/2 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 49f1053..c8a1345 100644
@@ -737,25 +737,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
2.7.4

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

PATCH 2/2 drm/i915/audio: Extend audio sync rate support for DP MST

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +2 -1
index c8a1345..88ed869 100644
@@ -807,7 +807,8 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {
 		DRM_DEBUG_KMS("Not valid for port %c\n", port_name(port));
 		err = -ENODEV;
 		goto unlock;
Signature · 6 lines
2.7.4

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

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 15 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
@@ -807,7 +807,8 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
        	return;

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

BR,
Jani.

Quoted 3 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		DRM_DEBUG_KMS("Not valid for port %c\n", port_name(port));
 		err = -ENODEV;
 		goto unlock;
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 27 lines · Jani Nikula
Quoted 15 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
@@ -807,7 +807,8 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

Quoted 8 lines
	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
        	return;

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

This while encoder->type thing is pretty broken actually. Currently we're semi-randomly flipping DDI encoders between UNKNOWN,HDMI and DP. I want to eliminate that so that their type will always be just "DDI". For iguring out what kind of signal we are driving out you should be looking at crtc_state->output_types.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 51 lines

-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Wednesday, November 30, 2016 12:50 AM
To: Jani Nikula <[email protected]>
Cc: Yang, Libin <[email protected]>; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 11 lines · Jani Nikula
Quoted 10 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 6 lines

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

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644
@@ -807,7 +807,8 @@ static int

i915_audio_component_sync_audio_rate(struct device *kdev, int port,

Quoted 11 lines

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

Quoted 8 lines
	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
        	return;

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

Quoted 5 lines

This while encoder->type thing is pretty broken actually. Currently we're semi- randomly flipping DDI encoders between UNKNOWN,HDMI and DP.
I want to eliminate that so that their type will always be just "DDI". For iguring out what kind of signal we are driving out you should be looking at crtc_state->output_types.

Do you mean the code should be like:
@@ -807,10 +807,7 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,

/* 1. get the pipe */
intel_encoder = get_saved_enc(dev_priv, port, pipe);
- if (!intel_encoder || !intel_encoder->base.crtc ||
- (intel_encoder->type != INTEL_OUTPUT_HDMI &&
- intel_encoder->type != INTEL_OUTPUT_DP &&
- intel_encoder->type != INTEL_OUTPUT_DP_MST)) {
+ if (!intel_encoder || !intel_encoder->base.crtc) {
DRM_DEBUG_KMS("Not valid for port %c\n", port_name(port));
err = -ENODEV;
goto unlock;
@@ -819,7 +816,12 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
/* pipe passed from the audio driver will be -1 for Non-MST case */
crtc = to_intel_crtc(intel_encoder->base.crtc);
crtc_state = crtc->config;
+ if (WARN_ON((crtc_state->output_types &
+ ((1 << INTEL_OUTPUT_HDMI) |
+ (1 << INTEL_OUTPUT_DP) |
+ (1 << INTEL_OUTPUT_DP_MST))) == 0))
+ return 0;
+
pipe = crtc->pipe;

I did the test, and it seems intel_encoder->type can show the correct type on my platform. It is similar with crtc_state->output_types.

Regards,
Libin

Quoted 4 lines

--
Ville Syrjälä
Intel OTC

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

#5 lore raw

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

In reply to Jani Nikula
Quoted 40 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Wednesday, November 30, 2016 12:34 AM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>
Subject: Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

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

Quoted 15 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644
@@ -807,7 +807,8 @@ static int

i915_audio_component_sync_audio_rate(struct device *kdev, int port,

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

Quoted 8 lines
	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
       	return;

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

We can't put the check at the beginning of the function.
We still need the check in the same place as we need get intel_encoder at first.

Regards,
Libin

Quoted 5 lines

BR,
Jani.

Quoted 7 lines

drivers/gpu/drm/i915/intel_audio.c static int · line 812

Quoted 1 line
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		DRM_DEBUG_KMS("Not valid for port %c\n",

port_name(port));

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 814

Quoted 2 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		err = -ENODEV;
 		goto unlock;

--
Jani Nikula, Intel Open Source Technology Center

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

maintainer
#6 lore raw

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 44 lines · Libin
Quoted 44 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Wednesday, November 30, 2016 12:34 AM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>
Subject: Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

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

Quoted 15 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644
@@ -807,7 +807,8 @@ static int

i915_audio_component_sync_audio_rate(struct device *kdev, int port,

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
       	return;
Quoted 6 lines
Quoted 3 lines

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

We can't put the check at the beginning of the function.
We still need the check in the same place as we need get intel_encoder at first.

We do not need to duplicate the checks here if we ensure only good stuff is ever put into av_enc_map.

Quoted 16 lines

Regards,
Libin

Quoted 12 lines

BR,
Jani.

drivers/gpu/drm/i915/intel_audio.c static int · line 812

Quoted 1 line
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		DRM_DEBUG_KMS("Not valid for port %c\n",

port_name(port));

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 814

Quoted 2 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		err = -ENODEV;
 		goto unlock;

--
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
#7 lore raw

Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 61 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Wednesday, November 30, 2016 11:52 PM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Subject: RE: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

Quoted 49 lines · Libin
Quoted 48 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Wednesday, November 30, 2016 12:34 AM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>
Subject: Re: [PATCH 2/2] drm/i915/audio: Extend audio sync rate support for DP MST

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

Quoted 15 lines · On Tue, 15 Nov 2016, [email protected] wrote:

From: Libin Yang <[email protected]>

This patch extends the support of audio sample rate sync up to DP MST.

---
 drivers/gpu/drm/i915/intel_audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index c8a1345..88ed869 100644
@@ -807,7 +807,8 @@ static int

i915_audio_component_sync_audio_rate(struct device *kdev, int port,

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 811

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +2 -1
 	intel_encoder = get_saved_enc(dev_priv, port, pipe);
 	if (!intel_encoder || !intel_encoder->base.crtc ||
 	    (intel_encoder->type != INTEL_OUTPUT_HDMI &&
-	     intel_encoder->type != INTEL_OUTPUT_DP)) {
+	     intel_encoder->type != INTEL_OUTPUT_DP &&
+		 intel_encoder->type != INTEL_OUTPUT_DP_MST)) {

I think the better option is to make absolutely sure we never store other kinds of encoders in dev_priv->av_enc_map[pipe] to begin with. I think that's true already, but please add

	if (WARN_ON(intel_encoder->type != INTEL_OUTPUT_HDMI &&
		    intel_encoder->type != INTEL_OUTPUT_DP &&
		    intel_encoder->type != INTEL_OUTPUT_DP_MST))
       	return;

near the beginning of intel_audio_codec_enable(), and remove the type checks here. This reduces the confusion about different kinds of checks after calling get_saved_enc().

Quoted 6 lines
Quoted 2 lines

We can't put the check at the beginning of the function.
We still need the check in the same place as we need get intel_encoder at

first.

We do not need to duplicate the checks here if we ensure only good stuff is ever put into av_enc_map.

Yes, I agree. I will remove the type judgement.

Regards,
Libin

Quoted 12 lines
Quoted 12 lines

Regards,
Libin

Quoted 7 lines

BR,
Jani.

drivers/gpu/drm/i915/intel_audio.c static int · line 812

Quoted 1 line
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		DRM_DEBUG_KMS("Not valid for port %c\n",

port_name(port));

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_sync_audio_rate(struct device *kdev, int port, · line 814

Quoted 2 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 		err = -ENODEV;
 		goto unlock;

--
Jani Nikula, Intel Open Source Technology Center

--
Jani Nikula, Intel Open Source Technology Center

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

#8 lore raw

✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/audio: extend get_saved_enc() to support more scenarios

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

== Series Details ==

Series: series starting with [1/2] drm/i915/audio: extend get_saved_enc() to support more scenarios
URL : https://patchwork.freedesktop.org/series/15321/
State : success

== Summary ==

Series 15321v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/15321/revisions/1/mbox/

fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

2f21978cfd8984c79e4cbd77ce63d9f73fe226ef drm-intel-nightly: 2016y-11m-14d-21h-23m-10s UTC integration manifest de72750 drm/i915/audio: Extend audio sync rate support for DP MST
06279ec drm/i915/audio: extend get_saved_enc() to support more scenarios

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2995/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#9 lore raw
In reply to [email protected]
Quoted 18 lines · On Tue, 15 Nov 2016, [email protected] wrote:

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 +0 -0
index 49f1053..c8a1345 100644
@@ -737,25 +737,49 @@ static int i915_audio_component_get_cdclk_freq(struct device *kdev)
 	return dev_priv->cdclk_freq;
 }

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_cdclk_freq(struct device *kdev) · line 748

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +9 -0
 
+/*
+ * 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

This essentially describes the code in English. I can read the code. I need to know more about the higher level of what this does and *why*.

I also look at the call sites of get_saved_enc and wonder why they have different checks for the return values. Also patch 2/2 only modifies one of them, not both. Why?

So maybe I'm just too clueless about DP (MST) audio in general, and I wouldn't even get offended if you told me that. But I don't think the commit message and the comments in this patch properly help me either.

BR,
Jani.

Quoted 41 lines
drivers/gpu/drm/i915/intel_audio.c +19 -4
+ */
 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 · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
Quoted 35 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, November 25, 2016 10:46 PM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: Re: [PATCH 1/2] drm/i915/audio: extend get_saved_enc() to support more scenarios

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

Quoted 18 lines · On Tue, 15 Nov 2016, [email protected] wrote:

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 +0 -0
index 49f1053..c8a1345 100644
@@ -737,25 +737,49 @@ static int

i915_audio_component_get_cdclk_freq(struct device *kdev)

Quoted 3 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	return dev_priv->cdclk_freq;
 }
 
Quoted 13 lines

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_cdclk_freq(struct device *kdev)

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +10 -0
+/*
+ * 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

This essentially describes the code in English. I can read the code. I need to know more about the higher level of what this does and *why*.

In initialization, audio driver will call functions get_eld() and etc. But at that time, audio driver may not know whether it is DP MST or not. In the original function get_saved_enc(), if it is DP MST, it will set the pipe to the correct value, otherwise, it will be set -1.

Although audio driver can get the knowledge whether it is in DP MST mode or not by reading the codec register. But it will drop performance each time it call the get_eld and other functions. As gfx driver can easily know whether it is in DP MST mode or not. I would like to extend the get_saved_enc() function to handle the situation that audio driver still send the device id info even it is in DP mode. In this situation, get_saved_enc() will return the correct intel_encoder instead of panic.

Quoted 4 lines

I also look at the call sites of get_saved_enc and wonder why they have different checks for the return values. Also patch 2/2 only modifies one of them, not both. Why?

The 2 check should be similar? In sync_audio_rate(), it calls get_saved_enc() and checked base.crtc, I think it is because it will use base.crtc later.

And it will check the intel_encoder->type because this function only need handle HDMI/DP/DP MST situation to setup the audio config.

Regards,
Libin

Quoted 45 lines

So maybe I'm just too clueless about DP (MST) audio in general, and I wouldn't even get offended if you told me that. But I don't think the commit message and the comments in this patch properly help me either.

BR,
Jani.

drivers/gpu/drm/i915/intel_audio.c static int · line 751

Quoted 2 lines
drivers/gpu/drm/i915/intel_audio.c +1 -0
+ */
 static struct intel_encoder *get_saved_enc(struct drm_i915_private

*dev_priv,

Quoted 33 lines
drivers/gpu/drm/i915/intel_audio.c +15 -4
 					       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

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_cdclk_freq(struct device *kdev) · line 785

Quoted 6 lines
drivers/gpu/drm/i915/intel_audio.c +3 -0
+		if (encoder->type == INTEL_OUTPUT_DP_MST)
+			continue;
+
 		if (port == encoder->port)
 			return encoder;
 	}

--
Jani Nikula, Intel Open Source Technology Center

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

maintainer
#11 lore raw
Quoted 53 lines · Libin
Quoted 34 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Friday, November 25, 2016 10:46 PM
To: Yang, Libin <[email protected]>; [email protected]; [email protected]; Vetter, Daniel <[email protected]>; Pandiyan, Dhinakaran <[email protected]>; Kp, Jeeja <[email protected]>; [email protected]
Cc: Yang, Libin <[email protected]>; Libin Yang <[email protected]>
Subject: Re: [PATCH 1/2] drm/i915/audio: extend get_saved_enc() to support more scenarios

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

Quoted 18 lines · On Tue, 15 Nov 2016, [email protected] wrote:

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 +0 -0
index 49f1053..c8a1345 100644
@@ -737,25 +737,49 @@ static int

i915_audio_component_get_cdclk_freq(struct device *kdev)

Quoted 3 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 	return dev_priv->cdclk_freq;
 }
 
Quoted 13 lines

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_cdclk_freq(struct device *kdev)

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +10 -0
+/*
+ * 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

This essentially describes the code in English. I can read the code. I need to know more about the higher level of what this does and *why*.

In initialization, audio driver will call functions get_eld() and etc. But at that time, audio driver may not know whether it is DP MST or not. In the original function get_saved_enc(), if it is DP MST, it will set the pipe to the correct value, otherwise, it will be set -1.

Quoted 7 lines

Although audio driver can get the knowledge whether it is in DP MST mode or not by reading the codec register. But it will drop performance each time it call the get_eld and other functions. As gfx driver can easily know whether it is in DP MST mode or not. I would like to extend the get_saved_enc() function to handle the situation that audio driver still send the device id info even it is in DP mode. In this situation, get_saved_enc() will return the correct intel_encoder instead of panic.

Please describe that in the commit message and/or comments in the patch.

Quoted 10 lines
Quoted 4 lines

I also look at the call sites of get_saved_enc and wonder why they have different checks for the return values. Also patch 2/2 only modifies one of them, not both. Why?

The 2 check should be similar? In sync_audio_rate(), it calls get_saved_enc() and checked base.crtc, I think it is because it will use base.crtc later.

And it will check the intel_encoder->type because this function only need handle HDMI/DP/DP MST situation to setup the audio config.

I think addressing my review comment on patch 2 will help this.

BR,
Jani.

Quoted 58 lines

Regards,
Libin

Quoted 54 lines

So maybe I'm just too clueless about DP (MST) audio in general, and I wouldn't even get offended if you told me that. But I don't think the commit message and the comments in this patch properly help me either.

BR,
Jani.

drivers/gpu/drm/i915/intel_audio.c static int · line 751

Quoted 2 lines
drivers/gpu/drm/i915/intel_audio.c +1 -0
+ */
 static struct intel_encoder *get_saved_enc(struct drm_i915_private

*dev_priv,

Quoted 29 lines
drivers/gpu/drm/i915/intel_audio.c +15 -4
 					       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) {

drivers/gpu/drm/i915/intel_audio.c static int i915_audio_component_get_cdclk_freq(struct device *kdev) · line 785

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +3 -0
 		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;
 	}

--
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