Skip to contentSkip to conversation

drm/i915: Audio N value computed for pixel doubled modes

PATCH Superseded [email protected] 3 participants 7 messages Sep 24, 2014 – Oct 13, 2014

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

PATCH 1/1 drm/i915: Audio N value computed for pixel doubled modes

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 858011d..6625eb5 100644
@@ -7872,6 +7872,8 @@ static struct {
 	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
 	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
 	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13513, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },
 };
 
 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 18 lines · On Thu, 25 Sep 2014, [email protected] wrote:

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..6625eb5 100644

drivers/gpu/drm/i915/intel_display.c static struct { · line 7876

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -7872,6 +7872,8 @@ static struct {
 	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
 	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
 	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13513, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },

Please use 13500 * 1001 / 1000 instead of 13513 like the rest of the table.

BR,
Jani.

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 };
 
 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#2 lore raw

PATCH v2 1/1 drm/i915: Audio N value computed for pixel doubled modes

In reply to [email protected]

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

ver2: Use 13500 * 1001 / 1000 instead of 13513 constant.

Cc Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
index 858011d..e76a4106 100644
@@ -7872,6 +7872,8 @@ static struct {
 	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
 	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
 	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13500 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },
 };
 
 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
Signature · 1 line
1.7.9.5
#3 lore raw
Quoted 22 lines · On Thu, Sep 25, 2014 at 09:26:36AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

ver2: Use 13500 * 1001 / 1000 instead of 13513 constant.

Cc Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..e76a4106 100644

drivers/gpu/drm/i915/intel_display.c static struct { · line 7876

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -7872,6 +7872,8 @@ static struct {
 	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
 	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
 	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13500 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },

We have double clocked modes where the non-doubled clock is already 27MHz so this seems like a bandaid for one particular case rather than a full solution.

The HDMI specification makes it clear that the N/CTS stuff depends on the TMDS clock and not the pixel clock, but BSpec just talks about pixel clock without further explaining any of this stuff. So should we look at port_clock rather than the pixel clock here?

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 };
 
 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
#4 lore raw
Quoted 33 lines · Ville Syrjälä
Quoted 22 lines · On Thu, Sep 25, 2014 at 09:26:36AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

ver2: Use 13500 * 1001 / 1000 instead of 13513 constant.

Cc Jani Nikula <jani.nikula at intel.com>
---
  drivers/gpu/drm/i915/intel_display.c |    2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..e76a4106 100644

drivers/gpu/drm/i915/intel_display.c static struct { · line 7876

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -7872,6 +7872,8 @@ static struct {
  	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
  	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
  	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13500 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },

We have double clocked modes where the non-doubled clock is already 27MHz so this seems like a bandaid for one particular case rather than a full solution.

Quoted 4 lines

The HDMI specification makes it clear that the N/CTS stuff depends on the TMDS clock and not the pixel clock, but BSpec just talks about pixel clock without further explaining any of this stuff. So should we look at port_clock rather than the pixel clock here?

No, Since we support 12bpc we still need to only worry about the pixel clock. TMDS clock and port clock will be multiplied by 1.5 in 12bpc mode, but the N value remains the same as the 8bpc clock.

-Clint

Quoted 12 lines
Quoted 11 lines
drivers/gpu/drm/i915/intel_display.c +0 -1
  };
 
  /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
--

1.7.9.5

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

#5 lore raw
Quoted 34 lines · Clint Taylor
Quoted 33 lines · Ville Syrjälä
Quoted 22 lines · On Thu, Sep 25, 2014 at 09:26:36AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

ver2: Use 13500 * 1001 / 1000 instead of 13513 constant.

Cc Jani Nikula <jani.nikula at intel.com>
---
  drivers/gpu/drm/i915/intel_display.c |    2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..e76a4106 100644

drivers/gpu/drm/i915/intel_display.c static struct { · line 7876

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -7872,6 +7872,8 @@ static struct {
  	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
  	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
  	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13500 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },

We have double clocked modes where the non-doubled clock is already 27MHz so this seems like a bandaid for one particular case rather than a full solution.

Quoted 8 lines
Quoted 4 lines

The HDMI specification makes it clear that the N/CTS stuff depends on the TMDS clock and not the pixel clock, but BSpec just talks about pixel clock without further explaining any of this stuff. So should we look at port_clock rather than the pixel clock here?

No, Since we support 12bpc we still need to only worry about the pixel clock. TMDS clock and port clock will be multiplied by 1.5 in 12bpc mode, but the N value remains the same as the 8bpc clock.

Does the hardware then have two different N value tables and it picks one based on 8bpc vs. 12bpc? Also I'm not sure what happens with different audio sample rates, but maybe we only support 48kHz? Sadly the spec is quite lacking when it comes to the audio side.

The recommended N values in the HDMI spec do differ somewhat between 8bpc and 12bpc, so either we end up using a non-recommended N value in 12bpc, or the hardware does some extra magic.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#6 lore raw
Quoted 40 lines · Ville Syrjälä
Quoted 39 lines · Clint Taylor
Quoted 37 lines · Ville Syrjälä
Quoted 22 lines · On Thu, Sep 25, 2014 at 09:26:36AM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

HDMI audio clock config was incorrectly choosing the default for pixel doubled interlaced modes. The table was missing pixel clock values 13.500 (27.000) and 13.513 (27.027). Luckily the default N value for 25.200 is the same N value for both 27MHz pixel clocks, a warning message was being printed with drm.debug set.

ver2: Use 13500 * 1001 / 1000 instead of 13513 constant.

Cc Jani Nikula <jani.nikula at intel.com>
---
   drivers/gpu/drm/i915/intel_display.c |    2 ++
   1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 858011d..e76a4106 100644

drivers/gpu/drm/i915/intel_display.c static struct { · line 7876

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -7872,6 +7872,8 @@ static struct {
   	{ 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },
   	{ DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },
   	{ 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },
+	{ 13500, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },
+	{ 13500 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },

We have double clocked modes where the non-doubled clock is already 27MHz so this seems like a bandaid for one particular case rather than a full solution.

The HDMI specification makes it clear that the N/CTS stuff depends on the TMDS clock and not the pixel clock, but BSpec just talks about pixel clock without further explaining any of this stuff. So should we look at port_clock rather than the pixel clock here?

Quoted 9 lines
Quoted 3 lines

No, Since we support 12bpc we still need to only worry about the pixel clock. TMDS clock and port clock will be multiplied by 1.5 in 12bpc mode, but the N value remains the same as the 8bpc clock.

Does the hardware then have two different N value tables and it picks one based on 8bpc vs. 12bpc? Also I'm not sure what happens with different audio sample rates, but maybe we only support 48kHz? Sadly the spec is quite lacking when it comes to the audio side.

The BSPEC also contains manual n/cts registers for non CEA modes. Hopefully the HW automatically selects 12bpc N values. The HW does select 8bpc other sample rates, so 12bpc 32 and 44.1 "should" work.

Quoted 4 lines

The recommended N values in the HDMI spec do differ somewhat between 8bpc and 12bpc, so either we end up using a non-recommended N value in 12bpc, or the hardware does some extra magic.

Just saw Appendix D in the HDMI spec..