Skip to content

Commit

Permalink
3.8: hdmi fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information
koenkooi committed May 20, 2013
1 parent d2a887d commit 872a37b
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 14 deletions.
@@ -1,7 +1,7 @@
From 8691d0e44b9f127ef03b7eae5e8f98e7b1f82dd0 Mon Sep 17 00:00:00 2001
From e61958bd20fc1e1a0c92aa6d30d07673f26a2ca4 Mon Sep 17 00:00:00 2001
From: Thierry Reding <thierry.reding@avionic-design.de>
Date: Fri, 22 Feb 2013 07:03:26 +0000
Subject: [PATCH 1/7] video: Add generic HDMI infoframe helpers
Subject: [PATCH 01/10] video: Add generic HDMI infoframe helpers

Add generic helpers to pack HDMI infoframes into binary buffers.

Expand Down
@@ -1,7 +1,7 @@
From aeaee686f73ee6b388735988db0c578211faa1b0 Mon Sep 17 00:00:00 2001
From 0b3de58adf1e37ac28ebb536225ae2a70ed9b8d4 Mon Sep 17 00:00:00 2001
From: Darren Etheridge <detheridge@ti.com>
Date: Fri, 19 Apr 2013 12:37:37 -0500
Subject: [PATCH 2/7] BeagleBone Black TDA998x Initial HDMI Audio support
Subject: [PATCH 02/10] BeagleBone Black TDA998x Initial HDMI Audio support

commit 5e166deffcfe438f57ec334e288e068e42fb05bb
Author: Darren Etheridge <detheridge@ti.com>
Expand Down
@@ -1,7 +1,8 @@
From 91b8259dd6d148c08f4bfefd0fbca4fc757dbe90 Mon Sep 17 00:00:00 2001
From f24e7c6385bbce8082f3959966a5728ade9e9ecf Mon Sep 17 00:00:00 2001
From: Darren Etheridge <detheridge@ti.com>
Date: Fri, 19 Apr 2013 13:18:14 -0500
Subject: [PATCH 3/7] Clean up some formating and debug in Davinci MCASP driver
Subject: [PATCH 03/10] Clean up some formating and debug in Davinci MCASP
driver

---
sound/soc/davinci/davinci-mcasp.c | 15 +++++----------
Expand Down
@@ -1,7 +1,7 @@
From 4903797fe1c5b9e5f37077223902d5066f4b8dc7 Mon Sep 17 00:00:00 2001
From 0daeb312b2c15797328a644781381d76439cd690 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Fri, 3 May 2013 16:11:53 +0300
Subject: [PATCH 4/7] tilcdc: Prune modes that can't support audio.
Subject: [PATCH 04/10] tilcdc: Prune modes that can't support audio.

If the connector supports audio, prune all the display modes that
don't support it.
Expand Down
@@ -1,7 +1,7 @@
From 42626e61bc9513cc0f9579f1a6460e1c3d303057 Mon Sep 17 00:00:00 2001
From a292b125ddda06c88bfa97547932c4c98e2e60af Mon Sep 17 00:00:00 2001
From: Darren Etheridge <detheridge@ti.com>
Date: Tue, 7 May 2013 21:22:27 -0500
Subject: [PATCH 5/7] Enable output of correct AVI Infoframe type hdmi
Subject: [PATCH 05/10] Enable output of correct AVI Infoframe type hdmi

---
drivers/gpu/drm/i2c/tda998x_drv.c | 4 ++--
Expand Down
@@ -1,7 +1,7 @@
From b49eaecd879542b368c5a10cdf84da472fd24dc0 Mon Sep 17 00:00:00 2001
From e0c23e19d8481dde47305b9e49ace226c5ecdf60 Mon Sep 17 00:00:00 2001
From: Darren Etheridge <detheridge@ti.com>
Date: Wed, 8 May 2013 16:15:40 -0500
Subject: [PATCH 6/7] drm: am335x: add support for 2048 lines vertical
Subject: [PATCH 06/10] drm: am335x: add support for 2048 lines vertical

Add extra mode that enables 1920x1080@24, this now works
with 2048 lines vertical support and EMIF setting of
Expand Down
@@ -1,7 +1,7 @@
From 92b49a8d661a1602e2bea6cb7dd213479afa2a91 Mon Sep 17 00:00:00 2001
From bc7049c5fcbe3302bea142bf1fddacc5905b2e81 Mon Sep 17 00:00:00 2001
From: Darren Etheridge <detheridge@ti.com>
Date: Wed, 8 May 2013 16:39:28 -0500
Subject: [PATCH 7/7] drm: tda998x Adding extra CEA mode for 1920x1080@24
Subject: [PATCH 07/10] drm: tda998x Adding extra CEA mode for 1920x1080@24

---
drivers/gpu/drm/i2c/tda998x_drv.c | 8 ++++----
Expand Down
@@ -0,0 +1,67 @@
From f392231247dfcd14be688e572c84da9573fd1454 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Mon, 20 May 2013 13:54:21 +0300
Subject: [PATCH 08/10] tilcdc: Remove superfluous newlines from DBG messages

DBGs supply their own newlines, don't add them.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 966b59b..900c710 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -469,7 +469,7 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode,
is_cea_mode ? "true" : "false");

if (audio && has_audio && !is_cea_mode) {
- DBG("Pruning mode : Does not support audio\n");
+ DBG("Pruning mode : Does not support audio");
return MODE_BAD;
}

@@ -481,32 +481,32 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode,
vsw = mode->vsync_end - mode->vsync_start;

if (hbp & ~0x3ff) {
- DBG("Pruning mode : Horizontal Back Porch out of range\n");
+ DBG("Pruning mode : Horizontal Back Porch out of range");
return MODE_BAD;
}

if (hfp & ~0x3ff) {
- DBG("Pruning mode : Horizontal Front Porch out of range\n");
+ DBG("Pruning mode : Horizontal Front Porch out of range");
return MODE_BAD;
}

if (hsw & ~0x3ff) {
- DBG("Pruning mode : Horizontal Sync Width out of range\n");
+ DBG("Pruning mode : Horizontal Sync Width out of range");
return MODE_BAD;
}

if (vbp & ~0xff) {
- DBG("Pruning mode : Vertical Back Porch out of range\n");
+ DBG("Pruning mode : Vertical Back Porch out of range");
return MODE_BAD;
}

if (vfp & ~0xff) {
- DBG("Pruning mode : Vertical Front Porch out of range\n");
+ DBG("Pruning mode : Vertical Front Porch out of range");
return MODE_BAD;
}

if (vsw & ~0x3f) {
- DBG("Pruning mode : Vertical Sync Width out of range\n");
+ DBG("Pruning mode : Vertical Sync Width out of range");
return MODE_BAD;
}

--
1.8.1.4

47 changes: 47 additions & 0 deletions patches/hdmi/0009-tilcdc-1280x1024x60-bw-1920x1080x24-bw.patch
@@ -0,0 +1,47 @@
From 166a5e83b56f5e1d99b64835b29fd872ceff42ab Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Mon, 20 May 2013 15:16:55 +0300
Subject: [PATCH 09/10] tilcdc: 1280x1024x60 bw > 1920x1080x24 bw

The lower resolution modes do infact need more bandwidth.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +-
drivers/gpu/drm/tilcdc/tilcdc_drv.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 900c710..c86da03 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -468,7 +468,7 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode,
has_audio ? "true" : "false",
is_cea_mode ? "true" : "false");

- if (audio && has_audio && !is_cea_mode) {
+ if (edid && audio && has_audio && !is_cea_mode) {
DBG("Pruning mode : Does not support audio");
return MODE_BAD;
}
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 6b2c7ea..f3861e4 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -40,10 +40,11 @@
#define TILCDC_DEFAULT_MAX_WIDTH 2048
/*
* This may need some tweaking, but want to allow at least 1280x1024@60
- * with optimized DDR & EMIF settings tweaked 1920x1080@24 appears to
+ * with optimized DDR & EMIF settings tweaked 1920x1080@25 appears to
* be supportable
+ * Note: 1920x1080x25=49766400 < 1280x1024x60=78643200
*/
-#define TILCDC_DEFAULT_MAX_BANDWIDTH (1920*1080*25)
+#define TILCDC_DEFAULT_MAX_BANDWIDTH (1280*1024*60)

struct tilcdc_drm_private {
void __iomem *mmio;
--
1.8.1.4

@@ -0,0 +1,66 @@
From 378bab743b7f9c5084e4c4b49f57d1b3d53a7e08 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Mon, 20 May 2013 16:01:07 +0300
Subject: [PATCH 10/10] tilcdc: Only support Audio on 50 & 60 Hz modes

Apparently anything other fails to work (at least for me).

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index c86da03..779f31f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -310,7 +310,7 @@ static int tilcdc_crtc_mode_set(struct drm_crtc *crtc,
reg |= (((mode->hdisplay >> 4) - 1) & 0x40) >> 3;

tilcdc_write(dev, LCDC_RASTER_TIMING_0_REG, reg);
-
+
/* only the vertical sync width maps 0 as 1 so only subtract 1 from vsw */
reg = ((mode->vdisplay - 1) & 0x3ff) |
((vbp & 0xff) << 24) |
@@ -440,7 +440,7 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct tilcdc_drm_private *priv = crtc->dev->dev_private;
unsigned int bandwidth;
uint32_t hbp, hfp, hsw, vbp, vfp, vsw;
- int has_audio, is_cea_mode;
+ int has_audio, is_cea_mode, can_output_audio, refresh;

int rb;

@@ -459,16 +459,24 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode,
/* set if there's audio capability */
has_audio = edid && drm_detect_monitor_audio(edid);

+ /* only 50 & 60Hz modes reliably support audio */
+ refresh = drm_mode_vrefresh(mode);
+
/* set if it's a cea mode */
is_cea_mode = drm_match_cea_mode(mode) > 0;

- DBG("mode %dx%d@%d pixel-clock %d audio %s cea %s",
- mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode),
+ /* set if we can output audio */
+ can_output_audio = edid && has_audio && is_cea_mode &&
+ (refresh == 50 || refresh == 60);
+
+ DBG("mode %dx%d@%d pixel-clock %d audio %s cea %s can_output %s",
+ mode->hdisplay, mode->vdisplay,refresh,
mode->clock,
has_audio ? "true" : "false",
- is_cea_mode ? "true" : "false");
+ is_cea_mode ? "true" : "false",
+ can_output_audio ? "true" : "false" );

- if (edid && audio && has_audio && !is_cea_mode) {
+ if (edid && has_audio && !can_output_audio) {
DBG("Pruning mode : Does not support audio");
return MODE_BAD;
}
--
1.8.1.4

0 comments on commit 872a37b

Please sign in to comment.