Re: [Intel-gfx] [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

2016-09-26 Thread Jani Nikula

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

BR,
Jani.


On Mon, 26 Sep 2016, "Yang, Libin"  wrote:
> Yes, I see. I will co-work with DK to fix the issue.
>
> Regards,
> Libin
>
>
>> -Original Message-
>> From: Jani Nikula [mailto:jani.nik...@linux.intel.com]
>> Sent: Monday, September 26, 2016 4:39 PM
>> To: Yang, Libin ; libin.y...@linux.intel.com; intel-
>> g...@lists.freedesktop.org; ville.syrj...@linux.intel.com; Vetter, Daniel
>> ; ti...@suse.de
>> Cc: Pandiyan, Dhinakaran ; Bride, Jim
>> ; Kp, Jeeja 
>> 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"  wrote:
>> > Add DK, Jim and Jeeja
>> >
>> > Regards,
>> > Libin
>> >
>> >
>> >> -Original Message-
>> >> From: libin.y...@linux.intel.com [mailto:libin.y...@linux.intel.com]
>> >> Sent: Monday, September 26, 2016 4:21 PM
>> >> To: intel-gfx@lists.freedesktop.org; jani.nik...@linux.intel.com;
>> >> ville.syrj...@linux.intel.com; Vetter, Daniel
>> >> ; ti...@suse.de
>> >> Cc: Yang, Libin ; Libin Yang
>> >> 
>> >> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support
>> >> more scenarios
>> >>
>> >> From: Libin Yang 
>> >>
>> >> 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 
>> >> ---
>> >>  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


Re: [Intel-gfx] [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

2016-09-26 Thread Yang, Libin
Yes, I see. I will co-work with DK to fix the issue.

Regards,
Libin


> -Original Message-
> From: Jani Nikula [mailto:jani.nik...@linux.intel.com]
> Sent: Monday, September 26, 2016 4:39 PM
> To: Yang, Libin ; libin.y...@linux.intel.com; intel-
> g...@lists.freedesktop.org; ville.syrj...@linux.intel.com; Vetter, Daniel
> ; ti...@suse.de
> Cc: Pandiyan, Dhinakaran ; Bride, Jim
> ; Kp, Jeeja 
> 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"  wrote:
> > Add DK, Jim and Jeeja
> >
> > Regards,
> > Libin
> >
> >
> >> -Original Message-
> >> From: libin.y...@linux.intel.com [mailto:libin.y...@linux.intel.com]
> >> Sent: Monday, September 26, 2016 4:21 PM
> >> To: intel-gfx@lists.freedesktop.org; jani.nik...@linux.intel.com;
> >> ville.syrj...@linux.intel.com; Vetter, Daniel
> >> ; ti...@suse.de
> >> Cc: Yang, Libin ; Libin Yang
> >> 
> >> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support
> >> more scenarios
> >>
> >> From: Libin Yang 
> >>
> >> 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 
> >> ---
> >>  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


Re: [Intel-gfx] [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

2016-09-26 Thread Jani Nikula

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"  wrote:
> Add DK, Jim and Jeeja
>
> Regards,
> Libin
>
>
>> -Original Message-
>> From: libin.y...@linux.intel.com [mailto:libin.y...@linux.intel.com]
>> Sent: Monday, September 26, 2016 4:21 PM
>> To: intel-gfx@lists.freedesktop.org; jani.nik...@linux.intel.com;
>> ville.syrj...@linux.intel.com; Vetter, Daniel ;
>> ti...@suse.de
>> Cc: Yang, Libin ; Libin Yang
>> 
>> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more
>> scenarios
>> 
>> From: Libin Yang 
>> 
>> 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 
>> ---
>>  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


Re: [Intel-gfx] [PATCH] drm/i915/audio: extend get_saved_enc() to support more scenarios

2016-09-26 Thread Yang, Libin
Add DK, Jim and Jeeja

Regards,
Libin


> -Original Message-
> From: libin.y...@linux.intel.com [mailto:libin.y...@linux.intel.com]
> Sent: Monday, September 26, 2016 4:21 PM
> To: intel-gfx@lists.freedesktop.org; jani.nik...@linux.intel.com;
> ville.syrj...@linux.intel.com; Vetter, Daniel ;
> ti...@suse.de
> Cc: Yang, Libin ; Libin Yang
> 
> Subject: [PATCH] drm/i915/audio: extend get_saved_enc() to support more
> scenarios
> 
> From: Libin Yang 
> 
> 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 
> ---
>  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