All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios
@ 2016-09-26  8:20 libin.yang
  2016-09-26  8:28 ` Yang, Libin
  2016-09-26  8:50 ` ✓ Fi.CI.BAT: success for " Patchwork
  0 siblings, 2 replies; 6+ messages in thread
From: libin.yang @ 2016-09-26  8:20 UTC (permalink / raw)
  To: intel-gfx, jani.nikula, ville.syrjala, daniel.vetter, tiwai; +Cc: Libin Yang

From: Libin Yang <libin.yang@linux.intel.com>

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.

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

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 9583f43..a6af14f 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -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;
 	}
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios
  2016-09-26  8:20 [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios libin.yang
@ 2016-09-26  8:28 ` Yang, Libin
  2016-09-26  8:38   ` Jani Nikula
  2016-09-26  8:50 ` ✓ Fi.CI.BAT: success for " Patchwork
  1 sibling, 1 reply; 6+ messages in thread
From: Yang, Libin @ 2016-09-26  8:28 UTC (permalink / raw)
  To: libin.yang, intel-gfx, jani.nikula, ville.syrjala, Vetter, Daniel, tiwai
  Cc: Kp, Jeeja, Bride, Jim, Pandiyan, Dhinakaran

Add DK, Jim and Jeeja

Regards,
Libin


> -----Original Message-----
> From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
> Sent: Monday, September 26, 2016 4:21 PM
> To: intel-gfx@lists.freedesktop.org; jani.nikula@linux.intel.com;
> ville.syrjala@linux.intel.com; Vetter, Daniel <daniel.vetter@intel.com>;
> tiwai@suse.de
> Cc: Yang, Libin <libin.yang@intel.com>; Libin Yang
> <libin.yang@linux.intel.com>
> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more
> scenarios
> 
> From: Libin Yang <libin.yang@linux.intel.com>
> 
> 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.
> 
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 32 ++++++++++++++++++++++++++++--
> --
>  1 file changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_audio.c
> b/drivers/gpu/drm/i915/intel_audio.c
> index 9583f43..a6af14f 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -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;
>  	}
> --
> 1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios
  2016-09-26  8:28 ` Yang, Libin
@ 2016-09-26  8:38   ` Jani Nikula
  2016-09-26 11:51     ` Yang, Libin
  0 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2016-09-26  8:38 UTC (permalink / raw)
  To: Yang, Libin, libin.yang, intel-gfx, ville.syrjala, Vetter, Daniel, tiwai
  Cc: Kp, Jeeja, Bride, Jim, Pandiyan, Dhinakaran


I will NAK all further DP MST audio patches until

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

is fixed.


BR,
Jani.


On Mon, 26 Sep 2016, "Yang, Libin" <libin.yang@intel.com> wrote:
> Add DK, Jim and Jeeja
>
> Regards,
> Libin
>
>
>> -----Original Message-----
>> From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
>> Sent: Monday, September 26, 2016 4:21 PM
>> To: intel-gfx@lists.freedesktop.org; jani.nikula@linux.intel.com;
>> ville.syrjala@linux.intel.com; Vetter, Daniel <daniel.vetter@intel.com>;
>> tiwai@suse.de
>> Cc: Yang, Libin <libin.yang@intel.com>; Libin Yang
>> <libin.yang@linux.intel.com>
>> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more
>> scenarios
>> 
>> From: Libin Yang <libin.yang@linux.intel.com>
>> 
>> 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.
>> 
>> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 32 ++++++++++++++++++++++++++++--
>> --
>>  1 file changed, 28 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 9583f43..a6af14f 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -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;
>>  	}
>> --
>> 1.9.1
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/audio: extend get_saved_enc() to support more scenarios
  2016-09-26  8:20 [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios libin.yang
  2016-09-26  8:28 ` Yang, Libin
@ 2016-09-26  8:50 ` Patchwork
  1 sibling, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-09-26  8:50 UTC (permalink / raw)
  To: libin.yang; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios
  2016-09-26  8:38   ` Jani Nikula
@ 2016-09-26 11:51     ` Yang, Libin
  2016-09-26 12:06       ` Jani Nikula
  0 siblings, 1 reply; 6+ messages in thread
From: Yang, Libin @ 2016-09-26 11:51 UTC (permalink / raw)
  To: Jani Nikula, libin.yang, intel-gfx, ville.syrjala, Vetter, Daniel, tiwai
  Cc: Kp, Jeeja, Bride, Jim, Pandiyan, Dhinakaran

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

Regards,
Libin


> -----Original Message-----
> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
> Sent: Monday, September 26, 2016 4:39 PM
> To: Yang, Libin <libin.yang@intel.com>; libin.yang@linux.intel.com; intel-
> gfx@lists.freedesktop.org; ville.syrjala@linux.intel.com; Vetter, Daniel
> <daniel.vetter@intel.com>; tiwai@suse.de
> Cc: Pandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>; Bride, Jim
> <jim.bride@intel.com>; Kp, Jeeja <jeeja.kp@intel.com>
> 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.
> 
> 
> On Mon, 26 Sep 2016, "Yang, Libin" <libin.yang@intel.com> wrote:
> > Add DK, Jim and Jeeja
> >
> > Regards,
> > Libin
> >
> >
> >> -----Original Message-----
> >> From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
> >> Sent: Monday, September 26, 2016 4:21 PM
> >> To: intel-gfx@lists.freedesktop.org; jani.nikula@linux.intel.com;
> >> ville.syrjala@linux.intel.com; Vetter, Daniel
> >> <daniel.vetter@intel.com>; tiwai@suse.de
> >> Cc: Yang, Libin <libin.yang@intel.com>; Libin Yang
> >> <libin.yang@linux.intel.com>
> >> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support
> >> more scenarios
> >>
> >> From: Libin Yang <libin.yang@linux.intel.com>
> >>
> >> 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.
> >>
> >> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/intel_audio.c | 32
> >> ++++++++++++++++++++++++++++--
> >> --
> >>  1 file changed, 28 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_audio.c
> >> b/drivers/gpu/drm/i915/intel_audio.c
> >> index 9583f43..a6af14f 100644
> >> --- a/drivers/gpu/drm/i915/intel_audio.c
> >> +++ b/drivers/gpu/drm/i915/intel_audio.c
> >> @@ -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;
> >>  	}
> >> --
> >> 1.9.1
> >
> 
> --
> Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios
  2016-09-26 11:51     ` Yang, Libin
@ 2016-09-26 12:06       ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2016-09-26 12:06 UTC (permalink / raw)
  To: Yang, Libin, libin.yang, intel-gfx, ville.syrjala, Vetter, Daniel, tiwai
  Cc: Kp, Jeeja, Bride, Jim, Pandiyan, Dhinakaran


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

BR,
Jani.


On Mon, 26 Sep 2016, "Yang, Libin" <libin.yang@intel.com> wrote:
> Yes, I see. I will co-work with DK to fix the issue.
>
> Regards,
> Libin
>
>
>> -----Original Message-----
>> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>> Sent: Monday, September 26, 2016 4:39 PM
>> To: Yang, Libin <libin.yang@intel.com>; libin.yang@linux.intel.com; intel-
>> gfx@lists.freedesktop.org; ville.syrjala@linux.intel.com; Vetter, Daniel
>> <daniel.vetter@intel.com>; tiwai@suse.de
>> Cc: Pandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>; Bride, Jim
>> <jim.bride@intel.com>; Kp, Jeeja <jeeja.kp@intel.com>
>> 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.
>> 
>> 
>> On Mon, 26 Sep 2016, "Yang, Libin" <libin.yang@intel.com> wrote:
>> > Add DK, Jim and Jeeja
>> >
>> > Regards,
>> > Libin
>> >
>> >
>> >> -----Original Message-----
>> >> From: libin.yang@linux.intel.com [mailto:libin.yang@linux.intel.com]
>> >> Sent: Monday, September 26, 2016 4:21 PM
>> >> To: intel-gfx@lists.freedesktop.org; jani.nikula@linux.intel.com;
>> >> ville.syrjala@linux.intel.com; Vetter, Daniel
>> >> <daniel.vetter@intel.com>; tiwai@suse.de
>> >> Cc: Yang, Libin <libin.yang@intel.com>; Libin Yang
>> >> <libin.yang@linux.intel.com>
>> >> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support
>> >> more scenarios
>> >>
>> >> From: Libin Yang <libin.yang@linux.intel.com>
>> >>
>> >> 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.
>> >>
>> >> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
>> >> ---
>> >>  drivers/gpu/drm/i915/intel_audio.c | 32
>> >> ++++++++++++++++++++++++++++--
>> >> --
>> >>  1 file changed, 28 insertions(+), 4 deletions(-)
>> >>
>> >> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> >> b/drivers/gpu/drm/i915/intel_audio.c
>> >> index 9583f43..a6af14f 100644
>> >> --- a/drivers/gpu/drm/i915/intel_audio.c
>> >> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> >> @@ -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;
>> >>  	}
>> >> --
>> >> 1.9.1
>> >
>> 
>> --
>> Jani Nikula, Intel Open Source Technology Center

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-26 12:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26  8:20 [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios libin.yang
2016-09-26  8:28 ` Yang, Libin
2016-09-26  8:38   ` Jani Nikula
2016-09-26 11:51     ` Yang, Libin
2016-09-26 12:06       ` Jani Nikula
2016-09-26  8:50 ` ✓ Fi.CI.BAT: success for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.