diff mbox

drm/i915/audio: not to set N/M value manually for KBL.

Message ID 1491014281-18853-1-git-send-email-quanxian.wang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang, Quanxian April 1, 2017, 2:38 a.m. UTC
It doesn't work on KBL. Just using automatic N/M.

According to the bspec, when set N/M, should disable
and enable transcoder which attaching DP audio. but there is no
such code to do that.
without this implementation except KBL platforms, seems work well.

Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
Tested-By: Cui Yueping<yuepingx.cui@intel.com>
---
 drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Jani Nikula April 4, 2017, 10:54 a.m. UTC | #1
On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
> It doesn't work on KBL. Just using automatic N/M.

Please provide a more elaborate commit message. In particular, have a
look at

commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
Author: Libin Yang <libin.yang@linux.intel.com>
Date:   Tue Oct 25 17:54:18 2016 +0300

    drm/i915/audio: set proper N/M in modeset

and explain why that doesn't apply to KBL. And why just KBL, why not
others?

> According to the bspec, when set N/M, should disable
> and enable transcoder which attaching DP audio. but there is no
> such code to do that.
> without this implementation except KBL platforms, seems work well.
>
> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 52c207e..0542031 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>  
> -	if (nm) {
> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>  		tmp &= ~AUD_CONFIG_N_MASK;
>  		tmp |= AUD_CONFIG_N(nm->n);
>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
>  
>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>  
> +	if (IS_KABYLAKE(dev_priv))
> +		return;
> +

The debug logging near the top of the function will be wrong for KBL,
and you now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic
values.

Seems to me the simplest would be to do

	if (IS_KABYLAKE(dev_priv))
        	nm = NULL;

*but* this still needs better rationale, especially why this is specific
to KBL.

BR,
Jani.


>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>  	tmp &= ~AUD_CONFIG_M_MASK;
>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
Wang, Quanxian April 5, 2017, 2:20 a.m. UTC | #2
Sorry, I don't find them in bspec. With our testing, SKL/APL works and KBL failed.

The commit 6014ac122ed081feca99217bc57b2e15c7fc1a51 mentioned  should not do testing on KBL DP audio.

We found the issue in the testing for Ubuntu latest release 17.04. (Almost upstream)

But really I don't know the root cause.

Also I have mentioned in commit, for general process of DP audio in bspec, transcoder should be restart to make it.
 But no code to do that. Also I don't know why driver doesn't implement that.

-----Original Message-----
From: Jani Nikula [mailto:jani.nikula@linux.intel.com] 
Sent: Tuesday, April 4, 2017 6:55 PM
To: Wang, Quanxian <quanxian.wang@intel.com>; intel-gfx@lists.freedesktop.org
Cc: Yang, Libin <libin.yang@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.

On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
> It doesn't work on KBL. Just using automatic N/M.

Please provide a more elaborate commit message. In particular, have a look at

commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
Author: Libin Yang <libin.yang@linux.intel.com>
Date:   Tue Oct 25 17:54:18 2016 +0300

    drm/i915/audio: set proper N/M in modeset

and explain why that doesn't apply to KBL. And why just KBL, why not others?

> According to the bspec, when set N/M, should disable and enable 
> transcoder which attaching DP audio. but there is no such code to do 
> that.
> without this implementation except KBL platforms, seems work well.
>
> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c 
> b/drivers/gpu/drm/i915/intel_audio.c
> index 52c207e..0542031 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>  
> -	if (nm) {
> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>  		tmp &= ~AUD_CONFIG_N_MASK;
>  		tmp |= AUD_CONFIG_N(nm->n);
>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc 
> *intel_crtc, enum port port,
>  
>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>  
> +	if (IS_KABYLAKE(dev_priv))
> +		return;
> +

The debug logging near the top of the function will be wrong for KBL, and you now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.

Seems to me the simplest would be to do

	if (IS_KABYLAKE(dev_priv))
        	nm = NULL;

*but* this still needs better rationale, especially why this is specific to KBL.

BR,
Jani.


>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>  	tmp &= ~AUD_CONFIG_M_MASK;
>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;

--
Jani Nikula, Intel Open Source Technology Center
Yang, Libin April 5, 2017, 2:22 a.m. UTC | #3
>-----Original Message-----
>From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>Sent: Tuesday, April 4, 2017 6:55 PM
>To: Wang, Quanxian <quanxian.wang@intel.com>; intel-
>gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value
>manually for KBL.
>
>On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
>> It doesn't work on KBL. Just using automatic N/M.
>
>Please provide a more elaborate commit message. In particular, have a look at
>
>commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
>Author: Libin Yang <libin.yang@linux.intel.com>
>Date:   Tue Oct 25 17:54:18 2016 +0300
>
>    drm/i915/audio: set proper N/M in modeset
>
>and explain why that doesn't apply to KBL. And why just KBL, why not others?
>
>> According to the bspec, when set N/M, should disable and enable
>> transcoder which attaching DP audio. but there is no such code to do
>> that.
>> without this implementation except KBL platforms, seems work well.

Is this a mandatory requirement on the new platform?
We saw "disable and enable transcoder" requirement on old platforms.
But it will dramatically impact on the user experience. After discussion,
we skipped this step and did a lot of test on the old platforms. They all works.

I suggested that we can talk with silicon team to figure out a proper solution,
because on the new platform we may also meet the same situations like old
platforms that some resolution will not work properly.

BTW: please test the playback on 4K resolution to see whether the playback
and delay is normal. 4K is often an issue.

Regards,
Libin

>>
>> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
>> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
>> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 52c207e..0542031 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc
>*intel_crtc, enum port port,
>>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>>
>> -	if (nm) {
>> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>>  		tmp &= ~AUD_CONFIG_N_MASK;
>>  		tmp |= AUD_CONFIG_N(nm->n);
>>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
>> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc
>> *intel_crtc, enum port port,
>>
>>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>>
>> +	if (IS_KABYLAKE(dev_priv))
>> +		return;
>> +
>
>The debug logging near the top of the function will be wrong for KBL, and you
>now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.
>
>Seems to me the simplest would be to do
>
>	if (IS_KABYLAKE(dev_priv))
>        	nm = NULL;
>
>*but* this still needs better rationale, especially why this is specific to KBL.
>
>BR,
>Jani.
>
>
>>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>>  	tmp &= ~AUD_CONFIG_M_MASK;
>>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
>
>--
>Jani Nikula, Intel Open Source Technology Center
Yang, Libin April 5, 2017, 2:25 a.m. UTC | #4
Hi Quanxian,

>-----Original Message-----
>From: Wang, Quanxian
>Sent: Wednesday, April 5, 2017 10:21 AM
>To: Jani Nikula <jani.nikula@linux.intel.com>; intel-gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value
>manually for KBL.
>
>Sorry, I don't find them in bspec. With our testing, SKL/APL works and KBL
>failed.
>
>The commit 6014ac122ed081feca99217bc57b2e15c7fc1a51 mentioned  should
>not do testing on KBL DP audio.
>
>We found the issue in the testing for Ubuntu latest release 17.04. (Almost
>upstream)
>
>But really I don't know the root cause.
>
>Also I have mentioned in commit, for general process of DP audio in bspec,
>transcoder should be restart to make it.
> But no code to do that. Also I don't know why driver doesn't implement that.

Please see my another email. I explained the reason on it. And I strongly suggest
you doing all the resolution and audio format playback test. We did find some
resolution and audio format will fail on the auto setting of N/M.

Regards,
Libin

>
>-----Original Message-----
>From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>Sent: Tuesday, April 4, 2017 6:55 PM
>To: Wang, Quanxian <quanxian.wang@intel.com>; intel-
>gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value
>manually for KBL.
>
>On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
>> It doesn't work on KBL. Just using automatic N/M.
>
>Please provide a more elaborate commit message. In particular, have a look at
>
>commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
>Author: Libin Yang <libin.yang@linux.intel.com>
>Date:   Tue Oct 25 17:54:18 2016 +0300
>
>    drm/i915/audio: set proper N/M in modeset
>
>and explain why that doesn't apply to KBL. And why just KBL, why not others?
>
>> According to the bspec, when set N/M, should disable and enable
>> transcoder which attaching DP audio. but there is no such code to do
>> that.
>> without this implementation except KBL platforms, seems work well.
>>
>> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
>> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
>> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 52c207e..0542031 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc
>*intel_crtc, enum port port,
>>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>>
>> -	if (nm) {
>> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>>  		tmp &= ~AUD_CONFIG_N_MASK;
>>  		tmp |= AUD_CONFIG_N(nm->n);
>>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
>> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc
>> *intel_crtc, enum port port,
>>
>>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>>
>> +	if (IS_KABYLAKE(dev_priv))
>> +		return;
>> +
>
>The debug logging near the top of the function will be wrong for KBL, and you
>now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.
>
>Seems to me the simplest would be to do
>
>	if (IS_KABYLAKE(dev_priv))
>        	nm = NULL;
>
>*but* this still needs better rationale, especially why this is specific to KBL.
>
>BR,
>Jani.
>
>
>>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>>  	tmp &= ~AUD_CONFIG_M_MASK;
>>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
>
>--
>Jani Nikula, Intel Open Source Technology Center
Wang, Quanxian April 5, 2017, 2:35 a.m. UTC | #5
Hi, Libin

We don't have 4K resolution monitor. We will double check others resolutions.

-----Original Message-----
From: Yang, Libin 
Sent: Wednesday, April 5, 2017 10:22 AM
To: Jani Nikula <jani.nikula@linux.intel.com>; Wang, Quanxian <quanxian.wang@intel.com>; intel-gfx@lists.freedesktop.org
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.


>-----Original Message-----
>From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>Sent: Tuesday, April 4, 2017 6:55 PM
>To: Wang, Quanxian <quanxian.wang@intel.com>; intel- 
>gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value 
>manually for KBL.
>
>On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
>> It doesn't work on KBL. Just using automatic N/M.
>
>Please provide a more elaborate commit message. In particular, have a 
>look at
>
>commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
>Author: Libin Yang <libin.yang@linux.intel.com>
>Date:   Tue Oct 25 17:54:18 2016 +0300
>
>    drm/i915/audio: set proper N/M in modeset
>
>and explain why that doesn't apply to KBL. And why just KBL, why not others?
>
>> According to the bspec, when set N/M, should disable and enable 
>> transcoder which attaching DP audio. but there is no such code to do 
>> that.
>> without this implementation except KBL platforms, seems work well.

Is this a mandatory requirement on the new platform?
[Wang, Quanxian] yes. At least bspec said that with 'NOTE'.
We saw "disable and enable transcoder" requirement on old platforms.
But it will dramatically impact on the user experience. After discussion, we skipped this step and did a lot of test on the old platforms. They all works.
[Wang, Quanxian] Seems to be in old platforms.

I suggested that we can talk with silicon team to figure out a proper solution, because on the new platform we may also meet the same situations like old platforms that some resolution will not work properly.

BTW: please test the playback on 4K resolution to see whether the playback and delay is normal. 4K is often an issue.

Regards,
Libin

>>
>> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
>> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
>> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 52c207e..0542031 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc
>*intel_crtc, enum port port,
>>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>>
>> -	if (nm) {
>> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>>  		tmp &= ~AUD_CONFIG_N_MASK;
>>  		tmp |= AUD_CONFIG_N(nm->n);
>>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
>> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc 
>> *intel_crtc, enum port port,
>>
>>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>>
>> +	if (IS_KABYLAKE(dev_priv))
>> +		return;
>> +
>
>The debug logging near the top of the function will be wrong for KBL, 
>and you now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.
>
>Seems to me the simplest would be to do
>
>	if (IS_KABYLAKE(dev_priv))
>        	nm = NULL;
>
>*but* this still needs better rationale, especially why this is specific to KBL.
>
>BR,
>Jani.
>
>
>>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>>  	tmp &= ~AUD_CONFIG_M_MASK;
>>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
>
>--
>Jani Nikula, Intel Open Source Technology Center
Wang, Quanxian May 17, 2017, 2:45 a.m. UTC | #6
Hi, Jani

After testing on 4K monitor. It is fine to get audio with our patch on 
KBL platform. We have tested with 'speaker' command and "play mp3/mp4 directly", not 
found delay for DP audio.

Libin is fine with this patch.

Any comment, please let me know.

Thanks

Quanxian Wang


-----Original Message-----
From: Wang, Quanxian 
Sent: Wednesday, April 5, 2017 10:36 AM
To: Yang, Libin <libin.yang@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>; intel-gfx@lists.freedesktop.org; Cui, YuepingX <yuepingx.cui@intel.com>; Wang, Quanxian <quanxian.wang@intel.com>
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.

Hi, Libin

We don't have 4K resolution monitor. We will double check others resolutions.

-----Original Message-----
From: Yang, Libin 
Sent: Wednesday, April 5, 2017 10:22 AM
To: Jani Nikula <jani.nikula@linux.intel.com>; Wang, Quanxian <quanxian.wang@intel.com>; intel-gfx@lists.freedesktop.org
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.


>-----Original Message-----
>From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>Sent: Tuesday, April 4, 2017 6:55 PM
>To: Wang, Quanxian <quanxian.wang@intel.com>; intel- 
>gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value 
>manually for KBL.
>
>On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
>> It doesn't work on KBL. Just using automatic N/M.
>
>Please provide a more elaborate commit message. In particular, have a 
>look at
>
>commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
>Author: Libin Yang <libin.yang@linux.intel.com>
>Date:   Tue Oct 25 17:54:18 2016 +0300
>
>    drm/i915/audio: set proper N/M in modeset
>
>and explain why that doesn't apply to KBL. And why just KBL, why not others?
>
>> According to the bspec, when set N/M, should disable and enable 
>> transcoder which attaching DP audio. but there is no such code to do 
>> that.
>> without this implementation except KBL platforms, seems work well.

Is this a mandatory requirement on the new platform?
[Wang, Quanxian] yes. At least bspec said that with 'NOTE'.
We saw "disable and enable transcoder" requirement on old platforms.
But it will dramatically impact on the user experience. After discussion, we skipped this step and did a lot of test on the old platforms. They all works.
[Wang, Quanxian] Seems to be in old platforms.

I suggested that we can talk with silicon team to figure out a proper solution, because on the new platform we may also meet the same situations like old platforms that some resolution will not work properly.

BTW: please test the playback on 4K resolution to see whether the playback and delay is normal. 4K is often an issue.

Regards,
Libin

>>
>> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
>> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
>> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 52c207e..0542031 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc
>*intel_crtc, enum port port,
>>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>>
>> -	if (nm) {
>> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>>  		tmp &= ~AUD_CONFIG_N_MASK;
>>  		tmp |= AUD_CONFIG_N(nm->n);
>>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
>> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc 
>> *intel_crtc, enum port port,
>>
>>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>>
>> +	if (IS_KABYLAKE(dev_priv))
>> +		return;
>> +
>
>The debug logging near the top of the function will be wrong for KBL, 
>and you now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.
>
>Seems to me the simplest would be to do
>
>	if (IS_KABYLAKE(dev_priv))
>        	nm = NULL;
>
>*but* this still needs better rationale, especially why this is specific to KBL.
>
>BR,
>Jani.
>
>
>>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>>  	tmp &= ~AUD_CONFIG_M_MASK;
>>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
>
>--
>Jani Nikula, Intel Open Source Technology Center
Wang, Quanxian May 26, 2017, 1:12 a.m. UTC | #7
Sorry, I will have a new update based on your suggestion. And do more testing on that. After that, I will resend the patch.

Quanxian

-----Original Message-----
From: Wang, Quanxian 
Sent: Wednesday, May 17, 2017 10:45 AM
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org; Yang, Libin <libin.yang@intel.com>
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.

Hi, Jani

After testing on 4K monitor. It is fine to get audio with our patch on KBL platform. We have tested with 'speaker' command and "play mp3/mp4 directly", not found delay for DP audio.

Libin is fine with this patch.

Any comment, please let me know.

Thanks

Quanxian Wang


-----Original Message-----
From: Wang, Quanxian
Sent: Wednesday, April 5, 2017 10:36 AM
To: Yang, Libin <libin.yang@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>; intel-gfx@lists.freedesktop.org; Cui, YuepingX <yuepingx.cui@intel.com>; Wang, Quanxian <quanxian.wang@intel.com>
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.

Hi, Libin

We don't have 4K resolution monitor. We will double check others resolutions.

-----Original Message-----
From: Yang, Libin
Sent: Wednesday, April 5, 2017 10:22 AM
To: Jani Nikula <jani.nikula@linux.intel.com>; Wang, Quanxian <quanxian.wang@intel.com>; intel-gfx@lists.freedesktop.org
Subject: RE: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value manually for KBL.


>-----Original Message-----
>From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>Sent: Tuesday, April 4, 2017 6:55 PM
>To: Wang, Quanxian <quanxian.wang@intel.com>; intel- 
>gfx@lists.freedesktop.org
>Cc: Yang, Libin <libin.yang@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915/audio: not to set N/M value 
>manually for KBL.
>
>On Sat, 01 Apr 2017, Quanxian Wang <quanxian.wang@intel.com> wrote:
>> It doesn't work on KBL. Just using automatic N/M.
>
>Please provide a more elaborate commit message. In particular, have a 
>look at
>
>commit 6014ac122ed081feca99217bc57b2e15c7fc1a51
>Author: Libin Yang <libin.yang@linux.intel.com>
>Date:   Tue Oct 25 17:54:18 2016 +0300
>
>    drm/i915/audio: set proper N/M in modeset
>
>and explain why that doesn't apply to KBL. And why just KBL, why not others?
>
>> According to the bspec, when set N/M, should disable and enable 
>> transcoder which attaching DP audio. but there is no such code to do 
>> that.
>> without this implementation except KBL platforms, seems work well.

Is this a mandatory requirement on the new platform?
[Wang, Quanxian] yes. At least bspec said that with 'NOTE'.
We saw "disable and enable transcoder" requirement on old platforms.
But it will dramatically impact on the user experience. After discussion, we skipped this step and did a lot of test on the old platforms. They all works.
[Wang, Quanxian] Seems to be in old platforms.

I suggested that we can talk with silicon team to figure out a proper solution, because on the new platform we may also meet the same situations like old platforms that some resolution will not work properly.

BTW: please test the playback on 4K resolution to see whether the playback and delay is normal. 4K is often an issue.

Regards,
Libin

>>
>> Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
>> Tested-By: Wang Zhijun<zhijunx.wang@intel.com>
>> Tested-By: Cui Yueping<yuepingx.cui@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_audio.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_audio.c
>> b/drivers/gpu/drm/i915/intel_audio.c
>> index 52c207e..0542031 100644
>> --- a/drivers/gpu/drm/i915/intel_audio.c
>> +++ b/drivers/gpu/drm/i915/intel_audio.c
>> @@ -300,7 +300,7 @@ hsw_dp_audio_config_update(struct intel_crtc
>*intel_crtc, enum port port,
>>  	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
>>  	tmp |= AUD_CONFIG_N_VALUE_INDEX;
>>
>> -	if (nm) {
>> +	if (!IS_KABYLAKE(dev_priv) && nm) {
>>  		tmp &= ~AUD_CONFIG_N_MASK;
>>  		tmp |= AUD_CONFIG_N(nm->n);
>>  		tmp |= AUD_CONFIG_N_PROG_ENABLE;
>> @@ -308,6 +308,9 @@ hsw_dp_audio_config_update(struct intel_crtc 
>> *intel_crtc, enum port port,
>>
>>  	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
>>
>> +	if (IS_KABYLAKE(dev_priv))
>> +		return;
>> +
>
>The debug logging near the top of the function will be wrong for KBL, 
>and you now bypass HSW_AUD_M_CTS_ENABLE() setting for the automatic values.
>
>Seems to me the simplest would be to do
>
>	if (IS_KABYLAKE(dev_priv))
>        	nm = NULL;
>
>*but* this still needs better rationale, especially why this is specific to KBL.
>
>BR,
>Jani.
>
>
>>  	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
>>  	tmp &= ~AUD_CONFIG_M_MASK;
>>  	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;
>
>--
>Jani Nikula, Intel Open Source Technology Center
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 52c207e..0542031 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -300,7 +300,7 @@  hsw_dp_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 	tmp &= ~AUD_CONFIG_N_PROG_ENABLE;
 	tmp |= AUD_CONFIG_N_VALUE_INDEX;
 
-	if (nm) {
+	if (!IS_KABYLAKE(dev_priv) && nm) {
 		tmp &= ~AUD_CONFIG_N_MASK;
 		tmp |= AUD_CONFIG_N(nm->n);
 		tmp |= AUD_CONFIG_N_PROG_ENABLE;
@@ -308,6 +308,9 @@  hsw_dp_audio_config_update(struct intel_crtc *intel_crtc, enum port port,
 
 	I915_WRITE(HSW_AUD_CFG(pipe), tmp);
 
+	if (IS_KABYLAKE(dev_priv))
+		return;
+
 	tmp = I915_READ(HSW_AUD_M_CTS_ENABLE(pipe));
 	tmp &= ~AUD_CONFIG_M_MASK;
 	tmp &= ~AUD_M_CTS_M_VALUE_INDEX;