Skip to contentSkip to conversation

drm/i915/chv: Enable HDMI Clock recovery for Pipe C

PATCH In review [email protected] 5 participants 12 messages Dec 3, 2014 – Dec 5, 2014

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

PATCH 1/1 drm/i915/chv: Enable HDMI Clock recovery for Pipe C

From: Clint Taylor <[email protected]>

Added PIPE C register support for CHV audio programming.

---
 drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -6
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
 #define _VLV_HDMIW_HDMIEDID_A		(VLV_DISPLAY_BASE + 0x62050)
 #define _VLV_HDMIW_HDMIEDID_B		(VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C		(VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
 					_VLV_HDMIW_HDMIEDID_A, \
-					_VLV_HDMIW_HDMIEDID_B)
+					_VLV_HDMIW_HDMIEDID_B, \
+					_CHV_HDMIW_HDMIEDID_C)
 #define _VLV_AUD_CNTL_ST_A		(VLV_DISPLAY_BASE + 0x620B4)
 #define _VLV_AUD_CNTL_ST_B		(VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C		(VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
 					_VLV_AUD_CNTL_ST_A, \
-					_VLV_AUD_CNTL_ST_B)
+					_VLV_AUD_CNTL_ST_B, \
+					_CHV_AUD_CNTL_ST_C)
 #define VLV_AUD_CNTL_ST2		(VLV_DISPLAY_BASE + 0x620C0)
 
 /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
 					_CPT_AUD_CONFIG_B)
 #define _VLV_AUD_CONFIG_A		(VLV_DISPLAY_BASE + 0x62000)
 #define _VLV_AUD_CONFIG_B		(VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C		(VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
 					_VLV_AUD_CONFIG_A, \
-					_VLV_AUD_CONFIG_B)
+					_VLV_AUD_CONFIG_B, \
+					_CHV_AUD_CONFIG_C)
 
 #define   AUD_CONFIG_N_VALUE_INDEX		(1 << 29)
 #define   AUD_CONFIG_N_PROG_ENABLE		(1 << 28)
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 3 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Quoted 54 lines
---
 drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -6
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
 #define _VLV_HDMIW_HDMIEDID_A		(VLV_DISPLAY_BASE + 0x62050)
 #define _VLV_HDMIW_HDMIEDID_B		(VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C		(VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
 					_VLV_HDMIW_HDMIEDID_A, \
-					_VLV_HDMIW_HDMIEDID_B)
+					_VLV_HDMIW_HDMIEDID_B, \
+					_CHV_HDMIW_HDMIEDID_C)
 #define _VLV_AUD_CNTL_ST_A		(VLV_DISPLAY_BASE + 0x620B4)
 #define _VLV_AUD_CNTL_ST_B		(VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C		(VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
 					_VLV_AUD_CNTL_ST_A, \
-					_VLV_AUD_CNTL_ST_B)
+					_VLV_AUD_CNTL_ST_B, \
+					_CHV_AUD_CNTL_ST_C)
 #define VLV_AUD_CNTL_ST2		(VLV_DISPLAY_BASE + 0x620C0)
 
 /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
 					_CPT_AUD_CONFIG_B)
 #define _VLV_AUD_CONFIG_A		(VLV_DISPLAY_BASE + 0x62000)
 #define _VLV_AUD_CONFIG_B		(VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C		(VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
 					_VLV_AUD_CONFIG_A, \
-					_VLV_AUD_CONFIG_B)
+					_VLV_AUD_CONFIG_B, \
+					_CHV_AUD_CONFIG_C)
 
 #define   AUD_CONFIG_N_VALUE_INDEX		(1 << 29)
 #define   AUD_CONFIG_N_PROG_ENABLE		(1 << 28)
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 7 lines · Ville Syrjälä
Quoted 3 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

-Clint

Quoted 51 lines
Quoted 51 lines
---
  drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
  1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
  #define _VLV_HDMIW_HDMIEDID_A		(VLV_DISPLAY_BASE + 0x62050)
  #define _VLV_HDMIW_HDMIEDID_B		(VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C		(VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
  					_VLV_HDMIW_HDMIEDID_A, \
-					_VLV_HDMIW_HDMIEDID_B)
+					_VLV_HDMIW_HDMIEDID_B, \
+					_CHV_HDMIW_HDMIEDID_C)
  #define _VLV_AUD_CNTL_ST_A		(VLV_DISPLAY_BASE + 0x620B4)
  #define _VLV_AUD_CNTL_ST_B		(VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C		(VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
  					_VLV_AUD_CNTL_ST_A, \
-					_VLV_AUD_CNTL_ST_B)
+					_VLV_AUD_CNTL_ST_B, \
+					_CHV_AUD_CNTL_ST_C)
  #define VLV_AUD_CNTL_ST2		(VLV_DISPLAY_BASE + 0x620C0)
 
  /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
  					_CPT_AUD_CONFIG_B)
  #define _VLV_AUD_CONFIG_A		(VLV_DISPLAY_BASE + 0x62000)
  #define _VLV_AUD_CONFIG_B		(VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C		(VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
  					_VLV_AUD_CONFIG_A, \
-					_VLV_AUD_CONFIG_B)
+					_VLV_AUD_CONFIG_B, \
+					_CHV_AUD_CONFIG_C)
 
  #define   AUD_CONFIG_N_VALUE_INDEX		(1 << 29)
  #define   AUD_CONFIG_N_PROG_ENABLE		(1 << 28)
--

1.7.9.5

Quoted 5 lines
Quoted 4 lines

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

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

maintainer
#3 lore raw
Quoted 11 lines · Clint Taylor
Quoted 7 lines · Ville Syrjälä
Quoted 3 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

Quoted 64 lines

-Clint

Quoted 51 lines
Quoted 51 lines
---
  drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
  1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
  #define _VLV_HDMIW_HDMIEDID_A		(VLV_DISPLAY_BASE + 0x62050)
  #define _VLV_HDMIW_HDMIEDID_B		(VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C		(VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
  					_VLV_HDMIW_HDMIEDID_A, \
-					_VLV_HDMIW_HDMIEDID_B)
+					_VLV_HDMIW_HDMIEDID_B, \
+					_CHV_HDMIW_HDMIEDID_C)
  #define _VLV_AUD_CNTL_ST_A		(VLV_DISPLAY_BASE + 0x620B4)
  #define _VLV_AUD_CNTL_ST_B		(VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C		(VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
  					_VLV_AUD_CNTL_ST_A, \
-					_VLV_AUD_CNTL_ST_B)
+					_VLV_AUD_CNTL_ST_B, \
+					_CHV_AUD_CNTL_ST_C)
  #define VLV_AUD_CNTL_ST2		(VLV_DISPLAY_BASE + 0x620C0)
 
  /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
  					_CPT_AUD_CONFIG_B)
  #define _VLV_AUD_CONFIG_A		(VLV_DISPLAY_BASE + 0x62000)
  #define _VLV_AUD_CONFIG_B		(VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C		(VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
  					_VLV_AUD_CONFIG_A, \
-					_VLV_AUD_CONFIG_B)
+					_VLV_AUD_CONFIG_B, \
+					_CHV_AUD_CONFIG_C)
 
  #define   AUD_CONFIG_N_VALUE_INDEX		(1 << 29)
  #define   AUD_CONFIG_N_PROG_ENABLE		(1 << 28)
--

1.7.9.5

Quoted 5 lines
Quoted 4 lines

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

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 13 lines · Jani Nikula
Quoted 11 lines · Clint Taylor
Quoted 7 lines · Ville Syrjälä
Quoted 3 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Most likely candidate right now is an ordering issue with snd_hda
during boot.

[    8.607022] [drm:intel_audio_codec_enable] ELD on [CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on [CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on [CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on [CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 63 lines
Quoted 63 lines

-Clint

Quoted 56 lines
Quoted 55 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A		(VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B		(VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C		(VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
   					_VLV_HDMIW_HDMIEDID_A, \
-					_VLV_HDMIW_HDMIEDID_B)
+					_VLV_HDMIW_HDMIEDID_B, \
+					_CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A		(VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B		(VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C		(VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
   					_VLV_AUD_CNTL_ST_A, \
-					_VLV_AUD_CNTL_ST_B)
+					_VLV_AUD_CNTL_ST_B, \
+					_CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2		(VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
   					_CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A		(VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B		(VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C		(VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
   					_VLV_AUD_CONFIG_A, \
-					_VLV_AUD_CONFIG_B)
+					_VLV_AUD_CONFIG_B, \
+					_CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX		(1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE		(1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

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

#5 lore raw
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

-clint

Quoted 100 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 64 lines
Quoted 64 lines

-Clint

Quoted 57 lines
Quoted 56 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                       _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                       _CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

Quoted 4 lines

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

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

maintainer
#6 lore raw
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 7 lines
Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

Maybe it needs some power domain/well we fail to get? Similar to what DDI based platforms do before and after calls to intel_audio_codec_enable and intel_audio_codec_disable in intel_ddi.c.

Not really my area, maybe Imre and Ville know better?

BR,
Jani.

Quoted 109 lines

-clint

Quoted 104 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 64 lines
Quoted 64 lines

-Clint

Quoted 57 lines
Quoted 56 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                       _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                       _CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 43 lines · Jani Nikula
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 7 lines
Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

Quoted 5 lines

Maybe it needs some power domain/well we fail to get? Similar to what DDI based platforms do before and after calls to intel_audio_codec_enable and intel_audio_codec_disable in intel_ddi.c.

Not really my area, maybe Imre and Ville know better?

The audio power domain->power well mapping is mapped correctly in the i915 driver (HDA belongs to the display aka pipe-A power well there). But AFAICS the intel_hda driver doesn't ask for this power domain on VLV/CHV, AZX_DCAPS_I915_POWERWELL is not included in the relevant hda device capability flags. CC'ing Takashi for this.

Still, I'm not sure why the register gets zeroed, if there is no power well off->on transition. You could first check if this is really true, via the debug print intel_display_power_get() and intel_display_power_put() emits.

Another idea would be to trace writes to this register through I915_WRITE.

--Imre

Quoted 117 lines

BR,
Jani.

Quoted 109 lines

-clint

Quoted 104 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 64 lines
Quoted 64 lines

-Clint

Quoted 57 lines
Quoted 56 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                       _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                       _CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

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

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

maintainer
#8 lore raw
Quoted 48 lines · Imre Deak
Quoted 47 lines · Jani Nikula
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 7 lines
Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

Maybe it needs some power domain/well we fail to get? Similar to what DDI based platforms do before and after calls to intel_audio_codec_enable and intel_audio_codec_disable in intel_ddi.c.

Quoted 7 lines
Quoted 1 line

Not really my area, maybe Imre and Ville know better?

The audio power domain->power well mapping is mapped correctly in the i915 driver (HDA belongs to the display aka pipe-A power well there). But AFAICS the intel_hda driver doesn't ask for this power domain on VLV/CHV, AZX_DCAPS_I915_POWERWELL is not included in the relevant hda device capability flags. CC'ing Takashi for this.

Imre, i915_request_power_well() only works for hsw/bdw.

BR,
Jani.

Quoted 130 lines

Still, I'm not sure why the register gets zeroed, if there is no power well off->on transition. You could first check if this is really true, via the debug print intel_display_power_get() and intel_display_power_put() emits.

Another idea would be to trace writes to this register through I915_WRITE.

--Imre

Quoted 117 lines

BR,
Jani.

Quoted 109 lines

-clint

Quoted 104 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 64 lines
Quoted 64 lines

-Clint

Quoted 57 lines
Quoted 56 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                       _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                       _CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 51 lines · Jani Nikula
Quoted 50 lines · Imre Deak
Quoted 48 lines · Jani Nikula
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 7 lines
Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

Maybe it needs some power domain/well we fail to get? Similar to what DDI based platforms do before and after calls to intel_audio_codec_enable and intel_audio_codec_disable in intel_ddi.c.

Not really my area, maybe Imre and Ville know better?

Quoted 7 lines
Quoted 5 lines

The audio power domain->power well mapping is mapped correctly in the i915 driver (HDA belongs to the display aka pipe-A power well there). But AFAICS the intel_hda driver doesn't ask for this power domain on VLV/CHV, AZX_DCAPS_I915_POWERWELL is not included in the relevant hda device capability flags. CC'ing Takashi for this.

Imre, i915_request_power_well() only works for hsw/bdw.

Hm, right I should have checked that first. And it could be also the reason why AZX_DCAPS_I915_POWERWELL was left out for everything but HSW/BDW. I will send a patch to fix that in i915.

Thanks,
Imre

Quoted 135 lines

BR,
Jani.

Quoted 130 lines

Still, I'm not sure why the register gets zeroed, if there is no power well off->on transition. You could first check if this is really true, via the debug print intel_display_power_get() and intel_display_power_put() emits.

Another idea would be to trace writes to this register through I915_WRITE.

--Imre

Quoted 117 lines

BR,
Jani.

Quoted 109 lines

-clint

Quoted 104 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 64 lines
Quoted 64 lines

-Clint

Quoted 57 lines
Quoted 56 lines
---
   drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
   1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
   #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
   #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                       _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
   #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
   #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
   #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
   /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                       _CPT_AUD_CONFIG_B)
   #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
   #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                       _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
   #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
   #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

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

Quoted 5 lines
Quoted 4 lines

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

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

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

#10 lore raw
Quoted 3 lines · Imre Deak

Hm, right I should have checked that first. And it could be also the reason why AZX_DCAPS_I915_POWERWELL was left out for everything but HSW/BDW. I will send a patch to fix that in i915.

Not terribly in favour of perpetuing that hack. It's proven sufficient trouble imo already.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw
In reply to Imre Deak
Quoted 58 lines · Imre Deak
Quoted 57 lines · Jani Nikula
Quoted 55 lines · Imre Deak
Quoted 43 lines · Jani Nikula
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Clint Taylor
Quoted 14 lines · Jani Nikula
Quoted 5 lines · Clint Taylor
Quoted 4 lines · Ville Syrjälä
Quoted 2 lines · On Wed, Dec 03, 2014 at 10:10:30AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Added PIPE C register support for CHV audio programming.

nak. The offset between the pipes looks constant so it should work just fine with _PIPE().

Correct. Now I just need to figure out why AUD_CONFIG_C is cleared after ChromeOS boot.

Quoted 9 lines

"after boot" is a long time! ;)

Do your logs show that ilk_audio_codec_disable (see intel_audio.c) gets called? With drm.debug=14 you should see "Disable audio codec on port %c, pipe %c\n".

BR,
Jani.

I've actually instrumented the driver with more logging and at 22.43 in the dmesg log the last call to audio_codec_enable() is called and is setting the Pixel_Clock bits of AUD_CONFIG_C to 0x9 which is correct for 1080p60. Sometime after 22.436 and before the ChromeOS login screen appears the register is being cleared to 0x0 without knowledge/action of the i915 driver. Mode change and power state change seem to restore the programming correctly.

Quoted 7 lines
Quoted 3 lines

Most likely candidate right now is an ordering issue with snd_hda
during boot.

Ok, removing snd_hda drivers from the boot process did not change the result. Any ideas about what could reset the HD_AUDIO registers to their default?

Quoted 5 lines

Maybe it needs some power domain/well we fail to get? Similar to what DDI based platforms do before and after calls to intel_audio_codec_enable and intel_audio_codec_disable in intel_ddi.c.

Not really my area, maybe Imre and Ville know better?

The audio power domain->power well mapping is mapped correctly in the i915 driver (HDA belongs to the display aka pipe-A power well there). But AFAICS the intel_hda driver doesn't ask for this power domain on VLV/CHV, AZX_DCAPS_I915_POWERWELL is not included in the relevant hda device capability flags. CC'ing Takashi for this.

Quoted 9 lines
Quoted 1 line

Imre, i915_request_power_well() only works for hsw/bdw.

Hm, right I should have checked that first. And it could be also the reason why AZX_DCAPS_I915_POWERWELL was left out for everything but HSW/BDW. I will send a patch to fix that in i915.

Thanks,
Imre

I have applied Imre's request_power_well patch, and tried setting intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO) directly when the audio codec is enabled and the register is still not accepting pixel clock programming updates during boot.

I have found that the register will not accept the value until after snd_hda_intel initializes the PCI device. Unfortunately time wise this occurs after the last attempt made by the i915 driver.

I will continue to investigate next week.

[   25.993784]  *** CAT display power get
[   25.998016]  *** CAT enable aud_config_c read = 0x00000000
[   31.825282] snd_hda_intel 0000:00:1b.0: irq 403 for MSI/MSI-X

-Clint

Quoted 126 lines
Quoted 126 lines

BR,
Jani.

Quoted 122 lines

Still, I'm not sure why the register gets zeroed, if there is no power well off->on transition. You could first check if this is really true, via the debug print intel_display_power_get() and intel_display_power_put() emits.

Another idea would be to trace writes to this register through I915_WRITE.

--Imre

Quoted 111 lines

BR,
Jani.

Quoted 104 lines

-clint

Quoted 100 lines
[    8.607022] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[    8.607027] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[    8.607044]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   14.741047] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   14.741055]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   15.773618] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   15.773624] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   15.779315]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   19.936767] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   19.936778]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   20.292920] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   20.292928] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   20.298615]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
[   20.389110] [drm:ilk_audio_codec_disable] Disable audio codec on port
D, pipe C
[   20.389121]  *** CAT disable aud_config reg 0x001E2200 = 0x10000000
[   22.430931] [drm:intel_audio_codec_enable] ELD on
[CONNECTOR:37:HDMI-A-3], [ENCODER:36:TMDS-36]
[   22.430940] [drm:ilk_audio_codec_enable] Enable audio codec on port
D, pipe C, 8 bytes ELD
[   22.436627]  *** CAT enable aud_config reg 0x001E2200 = 0x00090000
Quoted 69 lines
Quoted 68 lines

-Clint

Quoted 52 lines
Quoted 52 lines
---
    drivers/gpu/drm/i915/i915_reg.h |   18 ++++++++++++------
    1 file changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +12 -7
index dc03fac..3d5813a 100644
@@ -6189,14 +6189,18 @@ enum punit_power_well {
 
    #define _VLV_HDMIW_HDMIEDID_A        (VLV_DISPLAY_BASE + 0x62050)
    #define _VLV_HDMIW_HDMIEDID_B        (VLV_DISPLAY_BASE + 0x62150)
-#define VLV_HDMIW_HDMIEDID(pipe) _PIPE(pipe, \
+#define _CHV_HDMIW_HDMIEDID_C        (VLV_DISPLAY_BASE + 0x62250)
+#define VLV_HDMIW_HDMIEDID(pipe) _PIPE3(pipe, \
                        _VLV_HDMIW_HDMIEDID_A, \
-                    _VLV_HDMIW_HDMIEDID_B)
+                    _VLV_HDMIW_HDMIEDID_B, \
+                    _CHV_HDMIW_HDMIEDID_C)
    #define _VLV_AUD_CNTL_ST_A        (VLV_DISPLAY_BASE + 0x620B4)
    #define _VLV_AUD_CNTL_ST_B        (VLV_DISPLAY_BASE + 0x621B4)
-#define VLV_AUD_CNTL_ST(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CNTL_ST_C        (VLV_DISPLAY_BASE + 0x622B4)
+#define VLV_AUD_CNTL_ST(pipe) _PIPE3(pipe, \
                        _VLV_AUD_CNTL_ST_A, \
-                    _VLV_AUD_CNTL_ST_B)
+                    _VLV_AUD_CNTL_ST_B, \
+                    _CHV_AUD_CNTL_ST_C)
    #define VLV_AUD_CNTL_ST2        (VLV_DISPLAY_BASE + 0x620C0)
 
    /* These are the 4 32-bit write offset registers for each stream
@@ -6217,9 +6221,11 @@ enum punit_power_well {
                        _CPT_AUD_CONFIG_B)
    #define _VLV_AUD_CONFIG_A        (VLV_DISPLAY_BASE + 0x62000)
    #define _VLV_AUD_CONFIG_B        (VLV_DISPLAY_BASE + 0x62100)
-#define VLV_AUD_CFG(pipe) _PIPE(pipe, \
+#define _CHV_AUD_CONFIG_C        (VLV_DISPLAY_BASE + 0x62200)
+#define VLV_AUD_CFG(pipe) _PIPE3(pipe, \
                        _VLV_AUD_CONFIG_A, \
-                    _VLV_AUD_CONFIG_B)
+                    _VLV_AUD_CONFIG_B, \
+                    _CHV_AUD_CONFIG_C)
 
    #define   AUD_CONFIG_N_VALUE_INDEX        (1 << 29)
    #define   AUD_CONFIG_N_PROG_ENABLE        (1 << 28)
--

1.7.9.5

Quoted 5 lines
Quoted 4 lines

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

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

Quoted 11 lines
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

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

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