<div dir="ltr">Although i know it also happens in windows, the one particular thing i am 'fiddling' with is that when i try the receiver with an nvidia or amd apu (ion, e-450 trough hdmi) with my pioneer receiver audio works fine with 44100hz at the 1080p@50/60 modes. Only with intel i need to force upstreaming to 48000hz.<div>
<div><br></div><div>So are we really sure this is a bug with the receiver or still something wrong with the driver / pixel clock issue?</div></div><div><br></div><div>Is there anything else we i do to help ?</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Oct 16, 2013 at 11:34 AM, Jani Nikula <span dir="ltr"><<a href="mailto:jani.nikula@intel.com" target="_blank">jani.nikula@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The HDMI audio expects HDMI pixel clock to be set in the audio<br>
configuration. We've currently just set 0, using 25.2 / 1.001 kHz<br>
frequency, which fails with some modes.<br>
<br>
v2: Now with a commit message.<br>
<br>
Reference: <a href="http://mid.gmane.org/CAGpEb3Ep1LRZETPxHGRfBDqr5Ts2tAc8gCukWwugUf1U5NYv1g@mail.gmail.com" target="_blank">http://mid.gmane.org/CAGpEb3Ep1LRZETPxHGRfBDqr5Ts2tAc8gCukWwugUf1U5NYv1g@mail.gmail.com</a><br>
Reference: <a href="http://mid.gmane.org/20130206213533.GA16367@hardeman.nu
Reported-by" target="_blank">http://mid.gmane.org/20130206213533.GA16367@hardeman.nu<br>
Reported-by</a>: David Härdeman <<a href="mailto:david@hardeman.nu">david@hardeman.nu</a>><br>
Reported-by: Jasper Smet <<a href="mailto:josbeir@gmail.com">josbeir@gmail.com</a>><br>
Tested-by: Jasper Smet <<a href="mailto:josbeir@gmail.com">josbeir@gmail.com</a>><br>
Signed-off-by: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
---<br>
drivers/gpu/drm/i915/i915_reg.h | 12 ++++++++-<br>
drivers/gpu/drm/i915/intel_display.c | 48 +++++++++++++++++++++++++++++++---<br>
2 files changed, 55 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h<br>
index 13153c3..3266819 100644<br>
--- a/drivers/gpu/drm/i915/i915_reg.h<br>
+++ b/drivers/gpu/drm/i915/i915_reg.h<br>
@@ -4875,7 +4875,17 @@<br>
#define AUD_CONFIG_LOWER_N_SHIFT 4<br>
#define AUD_CONFIG_LOWER_N_VALUE (0xfff << 4)<br>
#define AUD_CONFIG_PIXEL_CLOCK_HDMI_SHIFT 16<br>
-#define AUD_CONFIG_PIXEL_CLOCK_HDMI (0xf << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_MASK (0xf << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_25175 (0 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_25200 (1 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 (2 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 (3 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_54000 (4 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_54054 (5 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_74176 (6 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 (7 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 (8 << 16)<br>
+#define AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 (9 << 16)<br>
#define AUD_CONFIG_DISABLE_NCTS (1 << 3)<br>
<br>
/* HSW Audio */<br>
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c<br>
index 55740f2..a097f84 100644<br>
--- a/drivers/gpu/drm/i915/intel_display.c<br>
+++ b/drivers/gpu/drm/i915/intel_display.c<br>
@@ -6722,6 +6722,44 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,<br>
return 0;<br>
}<br>
<br>
+static struct {<br>
+ int clock;<br>
+ u32 config;<br>
+} hdmi_audio_clock[] = {<br>
+ { DIV_ROUND_UP(25200 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_25175 },<br>
+ { 25200, AUD_CONFIG_PIXEL_CLOCK_HDMI_25200 }, /* default per bspec */<br>
+ { 27000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27000 },<br>
+ { 27000 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_27027 },<br>
+ { 54000, AUD_CONFIG_PIXEL_CLOCK_HDMI_54000 },<br>
+ { 54000 * 1001 / 1000, AUD_CONFIG_PIXEL_CLOCK_HDMI_54054 },<br>
+ { DIV_ROUND_UP(74250 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_74176 },<br>
+ { 74250, AUD_CONFIG_PIXEL_CLOCK_HDMI_74250 },<br>
+ { DIV_ROUND_UP(148500 * 1000, 1001), AUD_CONFIG_PIXEL_CLOCK_HDMI_148352 },<br>
+ { 148500, AUD_CONFIG_PIXEL_CLOCK_HDMI_148500 },<br>
+};<br>
+<br>
+/* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */<br>
+static u32 audio_config_hdmi_pixel_clock(struct drm_display_mode *mode)<br>
+{<br>
+ int i;<br>
+<br>
+ for (i = 0; i < ARRAY_SIZE(hdmi_audio_clock); i++) {<br>
+ if (mode->clock == hdmi_audio_clock[i].clock)<br>
+ break;<br>
+ }<br>
+<br>
+ if (i == ARRAY_SIZE(hdmi_audio_clock)) {<br>
+ DRM_DEBUG_KMS("HDMI audio pixel clock setting for %d not found, falling back to defaults\n", mode->clock);<br>
+ i = 1;<br>
+ }<br>
+<br>
+ DRM_DEBUG_KMS("Configuring HDMI audio for pixel clock %d (0x%08x)\n",<br>
+ hdmi_audio_clock[i].clock,<br>
+ hdmi_audio_clock[i].config);<br>
+<br>
+ return hdmi_audio_clock[i].config;<br>
+}<br>
+<br>
static bool intel_eld_uptodate(struct drm_connector *connector,<br>
int reg_eldv, uint32_t bits_eldv,<br>
int reg_elda, uint32_t bits_elda,<br>
@@ -6847,8 +6885,9 @@ static void haswell_write_eld(struct drm_connector *connector,<br>
DRM_DEBUG_DRIVER("ELD: DisplayPort detected\n");<br>
eld[5] |= (1 << 2); /* Conn_Type, 0x1 = DisplayPort */<br>
I915_WRITE(aud_config, AUD_CONFIG_N_VALUE_INDEX); /* 0x1 = DP */<br>
- } else<br>
- I915_WRITE(aud_config, 0);<br>
+ } else {<br>
+ I915_WRITE(aud_config, audio_config_hdmi_pixel_clock(mode));<br>
+ }<br>
<br>
if (intel_eld_uptodate(connector,<br>
aud_cntrl_st2, eldv,<br>
@@ -6926,8 +6965,9 @@ static void ironlake_write_eld(struct drm_connector *connector,<br>
DRM_DEBUG_DRIVER("ELD: DisplayPort detected\n");<br>
eld[5] |= (1 << 2); /* Conn_Type, 0x1 = DisplayPort */<br>
I915_WRITE(aud_config, AUD_CONFIG_N_VALUE_INDEX); /* 0x1 = DP */<br>
- } else<br>
- I915_WRITE(aud_config, 0);<br>
+ } else {<br>
+ I915_WRITE(aud_config, audio_config_hdmi_pixel_clock(mode));<br>
+ }<br>
<br>
if (intel_eld_uptodate(connector,<br>
aud_cntrl_st2, eldv,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Met Vriendelijke Groeten<br><br>Jasper Smet<br>Developer<br><br>Twitter: josbeir<br>E-mail: <a href="mailto:josbeir@gmail.com">josbeir@gmail.com</a><br>
Mobile: 0486/41.75.45
</div></div>