Skip to contentSkip to conversation

drm/i915: 4K audio N value incorrect at 29.97 and 23.98 refresh rate

PATCH In review [email protected] 3 participants 6 messages Oct 7, 2015 – Oct 8, 2015

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

PATCH 1/1 drm/i915: 4K audio N value incorrect at 29.97 and 23.98 refresh rate

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

---
 drivers/gpu/drm/i915/intel_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +1 -1
index 56c2f54..419c979 100644
@@ -75,7 +75,7 @@ static const struct {
 
 /* HDMI N/CTS table */
 #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700
 static const struct {
 	int sample_rate;
 	int clock;
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 17 lines · On Wed, Oct 07, 2015 at 02:38:29PM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

---
 drivers/gpu/drm/i915/intel_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index 56c2f54..419c979 100644

drivers/gpu/drm/i915/intel_audio.c static const struct { · line 78

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
@@ -75,7 +75,7 @@ static const struct {
 
 /* HDMI N/CTS table */
 #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700

Hmm. I think we might want to fix up the mode instead. Let me post a few patches, and let's see what people think...

Quoted 10 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 static const struct {
 	int sample_rate;
 	int clock;
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
maintainer
#2 lore raw
Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · On Wed, Oct 07, 2015 at 02:38:29PM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

---
 drivers/gpu/drm/i915/intel_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index 56c2f54..419c979 100644
@@ -75,7 +75,7 @@ static const struct {
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_audio.c static const struct { · line 78

Quoted 4 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
 /* HDMI N/CTS table */
 #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700

Hmm. I think we might want to fix up the mode instead. Let me post a few patches, and let's see what people think...

We might actually want to queue this up for v4.3 as the immediate fix, as I feel it's doubtful your other patches will make it to v4.3.

If Someone(tm) provided their r-b that is.

BR,
Jani.

Quoted 19 lines
Quoted 11 lines
drivers/gpu/drm/i915/intel_audio.c +0 -0
 static const struct {
 	int sample_rate;
 	int clock;
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
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 28 lines · Jani Nikula
Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · On Wed, Oct 07, 2015 at 02:38:29PM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

---
 drivers/gpu/drm/i915/intel_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index 56c2f54..419c979 100644
@@ -75,7 +75,7 @@ static const struct {
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_audio.c static const struct { · line 78

Quoted 4 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
 /* HDMI N/CTS table */
 #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700

Hmm. I think we might want to fix up the mode instead. Let me post a few patches, and let's see what people think...

Quoted 4 lines

We might actually want to queue this up for v4.3 as the immediate fix, as I feel it's doubtful your other patches will make it to v4.3.

If Someone(tm) provided their r-b that is.

Except this is wrong if the mode came from the CEA/HDMI mode list as opposed from the EDID detailed timings.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Jani Nikula
Quoted 26 lines · Ville Syrjälä
Quoted 17 lines · On Wed, Oct 07, 2015 at 02:38:29PM -0700, [email protected] wrote:

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

---
  drivers/gpu/drm/i915/intel_audio.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +0 -0
index 56c2f54..419c979 100644

drivers/gpu/drm/i915/intel_audio.c static const struct { · line 78

Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +1 -1
@@ -75,7 +75,7 @@ static const struct {
 
  /* HDMI N/CTS table */
  #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700

Hmm. I think we might want to fix up the mode instead. Let me post a few patches, and let's see what people think...

Quoted 8 lines
Quoted 4 lines

We might actually want to queue this up for v4.3 as the immediate fix, as I feel it's doubtful your other patches will make it to v4.3.

If Someone(tm) provided their r-b that is.

Except this is wrong if the mode came from the CEA/HDMI mode list as opposed from the EDID detailed timings.

The original patch was generated from a monitor with 296700 in the DTD. Ville's approach is more sane for the long term. We could also just add a third check in the 4K audio fixup for the DTD based pixel clock.

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

maintainer
#5 lore raw
In reply to [email protected]
Quoted 6 lines · On Thu, 08 Oct 2015, [email protected] wrote:

From: Clint Taylor <[email protected]>

The TMDS_296M define was computing as 296704 but the mode->clock is 296700 as defined by EDID. Adjusted define to allow correct detection of the need to program the correct N value for 29.97 and 23.98 refresh rate.

<insert bad commit id here>

Quoted 26 lines
---
 drivers/gpu/drm/i915/intel_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_audio.c +1 -1
index 56c2f54..419c979 100644
@@ -75,7 +75,7 @@ static const struct {
 
 /* HDMI N/CTS table */
 #define TMDS_297M 297000
-#define TMDS_296M DIV_ROUND_UP(297000 * 1000, 1001)
+#define TMDS_296M 296700
 static const struct {
 	int sample_rate;
 	int clock;
Signature · 6 lines
1.7.9.5

_______________________________________________
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