linux-omap 2.6.29: add patches to fix some bugs in the display driver, XV now works...
authorKoen Kooi <koen@openembedded.org>
Tue, 7 Apr 2009 07:46:06 +0000 (09:46 +0200)
committerKoen Kooi <koen@openembedded.org>
Tue, 7 Apr 2009 07:46:06 +0000 (09:46 +0200)
conf/machine/include/omap3.inc
recipes/linux/linux-omap-2.6.29/dss2/0007-DSS2-Add-DSS2-support-for-SDP-Beagle-Overo-EVM.patch
recipes/linux/linux-omap-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch [new file with mode: 0644]
recipes/linux/linux-omap_2.6.29.bb

index 4e95fb1..a0ec5fd 100644 (file)
@@ -1,6 +1,6 @@
 require conf/machine/include/tune-cortexa8.inc
 PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
-MACHINE_KERNEL_PR = "r21
+MACHINE_KERNEL_PR = "r22
 
 KERNEL_IMAGETYPE = "uImage"
 
index 9282964..26d21d8 100644 (file)
@@ -5668,7 +5668,7 @@ index 071f4b0..267bb6b 100644
 +
 +static struct omap_dss_display_config overo_display_data_lcd = {
 +      .type = OMAP_DISPLAY_TYPE_DPI,
-+      .name = "lcd",
++      .name = "lcd43",
 +      .panel_name = "samsung-lte430wq-f0c",
 +      .u.dpi.data_lines = 24,
 +      .panel_enable = overo_panel_enable_lcd,
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch b/recipes/linux/linux-omap-2.6.29/dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch
new file mode 100644 (file)
index 0000000..3b3fd77
--- /dev/null
@@ -0,0 +1,51 @@
+From 832b763db235da8e62f7b6ab02bcb8ad6bcb7a01 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 16:48:41 +0300
+Subject: [PATCH] DSS2: Add function to get DSS logic clock rate
+
+---
+ drivers/video/omap2/dss/dispc.c |   15 +++++++++++++++
+ drivers/video/omap2/dss/dss.h   |    1 +
+ 2 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 2480a03..1bc23f7 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1850,6 +1850,21 @@ unsigned long dispc_fclk_rate(void)
+       return r;
+ }
++unsigned long dispc_lclk_rate(void)
++{
++      int lcd;
++      unsigned long r;
++      u32 l;
++
++      l = dispc_read_reg(DISPC_DIVISOR);
++
++      lcd = FLD_GET(l, 23, 16);
++
++      r = dispc_fclk_rate();
++
++      return r / lcd;
++}
++
+ unsigned long dispc_pclk_rate(void)
+ {
+       int lcd, pcd;
+diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
+index bac5ece..0be42b6 100644
+--- a/drivers/video/omap2/dss/dss.h
++++ b/drivers/video/omap2/dss/dss.h
+@@ -294,6 +294,7 @@ bool dispc_trans_key_enabled(enum omap_channel ch);
+ void dispc_set_lcd_timings(struct omap_video_timings *timings);
+ unsigned long dispc_fclk_rate(void);
++unsigned long dispc_lclk_rate(void);
+ unsigned long dispc_pclk_rate(void);
+ void dispc_set_pol_freq(struct omap_panel *panel);
+ void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch b/recipes/linux/linux-omap-2.6.29/dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch
new file mode 100644 (file)
index 0000000..d6b0cbb
--- /dev/null
@@ -0,0 +1,68 @@
+From a5c235a6f0094494ae1fc1a1ba4728e0d33dfd3b Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 16:49:27 +0300
+Subject: [PATCH] DSS2: DSI: calculate VP_CLK_RATIO properly
+
+---
+ drivers/video/omap2/dss/dsi.c |   17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 4442931..aecb89d 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1104,7 +1104,10 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+       enable_clocks(1);
+       dsi_enable_pll_clock(1);
+-      /* configure dispc fck and pixel clock to something sane */
++      /* XXX this should be calculated depending on the screen size,
++       * required framerate and DSI speed.
++       * For now 48MHz is enough for 864x480@60 with 360Mbps/lane
++       * with two lanes */
+       r = dispc_calc_clock_div(1, 48 * 1000 * 1000, &cinfo);
+       if (r)
+               goto err0;
+@@ -1119,7 +1122,7 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+       if (r)
+               goto err0;
+-      /* PLL does not come out of reset without this... */
++      /* XXX PLL does not come out of reset without this... */
+       dispc_pck_free_enable(1);
+       if (wait_for_bit_change(DSI_PLL_STATUS, 0, 1) != 1) {
+@@ -1128,8 +1131,8 @@ int dsi_pll_init(bool enable_hsclk, bool enable_hsdiv)
+               goto err1;
+       }
+-      /* ... but if left on, we get problems when planes do not
+-       * fill the whole display. No idea about this XXX */
++      /* XXX ... but if left on, we get problems when planes do not
++       * fill the whole display. No idea about this */
+       dispc_pck_free_enable(0);
+       if (enable_hsclk && enable_hsdiv)
+@@ -2214,6 +2217,7 @@ static int dsi_proto_config(struct omap_display *display)
+ {
+       u32 r;
+       int buswidth = 0;
++      int div;
+       dsi_config_tx_fifo(DSI_FIFO_SIZE_128,
+                       DSI_FIFO_SIZE_0,
+@@ -2254,8 +2258,9 @@ static int dsi_proto_config(struct omap_display *display)
+       r = FLD_MOD(r, 1, 1, 1);        /* CS_RX_EN */
+       r = FLD_MOD(r, 1, 2, 2);        /* ECC_RX_EN */
+       r = FLD_MOD(r, 1, 3, 3);        /* TX_FIFO_ARBITRATION */
+-      /* XXX what should the ratio be */
+-      r = FLD_MOD(r, 0, 4, 4);        /* VP_CLK_RATIO, VP_PCLK = VP_CLK/2 */
++
++      div = dispc_lclk_rate() / dispc_pclk_rate();
++      r = FLD_MOD(r, div == 2 ? 0 : 1, 4, 4); /* VP_CLK_RATIO */
+       r = FLD_MOD(r, buswidth, 7, 6); /* VP_DATA_BUS_WIDTH */
+       r = FLD_MOD(r, 0, 8, 8);        /* VP_CLK_POL */
+       r = FLD_MOD(r, 2, 13, 12);      /* LINE_BUFFER, 2 lines */
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch b/recipes/linux/linux-omap-2.6.29/dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch
new file mode 100644 (file)
index 0000000..bca449f
--- /dev/null
@@ -0,0 +1,58 @@
+From 6b2c9d84c7accdfe1067fcdc8a00e50674aab4bb Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 2 Apr 2009 17:42:26 +0300
+Subject: [PATCH] DSS2: DSI: improve packet len calculation
+
+---
+ drivers/video/omap2/dss/dsi.c |   21 ++++++++++++++++-----
+ 1 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index aecb89d..66ac6ea 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -2624,17 +2624,28 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+               u16 x, u16 y, u16 w, u16 h)
+ {
+       int bytespp = 3;
++      int len;
+       int total_len;
+-      int line_packet_len;
++      int packet_payload;
++      int packet_len;
+       u32 l;
+       if (dsi.update_mode == OMAP_DSS_UPDATE_MANUAL)
+               DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n",
+                               x, y, w, h);
+-      /* TODO: one packet could be longer, I think? Max is the line buffer */
+-      line_packet_len = w * bytespp + 1;      /* 1 byte for DCS cmd */
+-      total_len = line_packet_len * h;
++      len = w * h * bytespp;
++
++      /* XXX: one packet could be longer, I think? Line buffer is
++       * 1024 x 24bits, but we have to put DCS cmd there also.
++       * 1023 * 3 should work, but causes strange color effects. */
++      packet_payload = min(w, (u16)1020) * bytespp;
++
++      packet_len = packet_payload + 1;        /* 1 byte for DCS cmd */
++      total_len = (len / packet_payload) * packet_len;
++
++      if (len % packet_payload)
++              total_len += (len % packet_payload) + 1;
+       display->ctrl->setup_update(display, x, y, w, h);
+@@ -2646,7 +2657,7 @@ static void dsi_update_screen_dispc(struct omap_display *display,
+       l = FLD_VAL(total_len, 23, 0); /* TE_SIZE */
+       dsi_write_reg(DSI_VC_TE(1), l);
+-      dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, line_packet_len, 0);
++      dsi_vc_write_long_header(1, DSI_DT_DCS_LONG_WRITE, packet_len, 0);
+       if (dsi.use_te)
+               l = FLD_MOD(l, 1, 30, 30); /* TE_EN */
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch b/recipes/linux/linux-omap-2.6.29/dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch
new file mode 100644 (file)
index 0000000..5b68b57
--- /dev/null
@@ -0,0 +1,103 @@
+From 85848d329ca3a2d6ee6841cdc11cc5951d187931 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Fri, 3 Apr 2009 19:09:20 +0200
+Subject: [PATCH] DSS2: Disable video planes on sync lost error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+When encountering the sync lost error disable the display and all video
+planes on the affected manager. Afterwards re-enable the display.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c |   50 +++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 50 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 1bc23f7..41734f3 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -2518,29 +2518,79 @@ static void dispc_error_worker(struct work_struct *work)
+       }
+       if (errors & DISPC_IRQ_SYNC_LOST) {
++              struct omap_overlay_manager *manager = NULL;
++              bool enable = false;
++
+               DSSERR("SYNC_LOST, disabling LCD\n");
++
+               for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
+                       struct omap_overlay_manager *mgr;
+                       mgr = omap_dss_get_overlay_manager(i);
+                       if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
++                              manager = mgr;
++                              enable = mgr->display->state ==
++                                              OMAP_DSS_DISPLAY_ACTIVE;
+                               mgr->display->disable(mgr->display);
+                               break;
+                       }
+               }
++
++              if (manager) {
++                      for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++                              struct omap_overlay *ovl;
++                              ovl = omap_dss_get_overlay(i);
++
++                              if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++                                      continue;
++
++                              if (ovl->id != 0 && ovl->manager == manager)
++                                      dispc_enable_plane(ovl->id, 0);
++                      }
++
++                      dispc_go(manager->id);
++                      mdelay(50);
++                      if (enable)
++                              manager->display->enable(manager->display);
++              }
+       }
+       if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
++              struct omap_overlay_manager *manager = NULL;
++              bool enable = false;
++
+               DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
++
+               for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
+                       struct omap_overlay_manager *mgr;
+                       mgr = omap_dss_get_overlay_manager(i);
+                       if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
++                              manager = mgr;
++                              enable = mgr->display->state ==
++                                              OMAP_DSS_DISPLAY_ACTIVE;
+                               mgr->display->disable(mgr->display);
+                               break;
+                       }
+               }
++
++              if (manager) {
++                      for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
++                              struct omap_overlay *ovl;
++                              ovl = omap_dss_get_overlay(i);
++
++                              if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
++                                      continue;
++
++                              if (ovl->id != 0 && ovl->manager == manager)
++                                      dispc_enable_plane(ovl->id, 0);
++                      }
++
++                      dispc_go(manager->id);
++                      mdelay(50);
++                      if (enable)
++                              manager->display->enable(manager->display);
++              }
+       }
+       if (errors & DISPC_IRQ_OCP_ERR) {
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch b/recipes/linux/linux-omap-2.6.29/dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch
new file mode 100644 (file)
index 0000000..088135c
--- /dev/null
@@ -0,0 +1,40 @@
+From 63e15ba8d5f95b13d3abf359da718537d769f112 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Tue, 7 Apr 2009 10:01:58 +0300
+Subject: [PATCH] DSS2: check for ovl paddr only when enabling
+
+It seems Xvideo uses SETUP_PLANE ioctl even when
+the fb memory has not been allocated. Sigh.
+---
+ drivers/video/omap2/dss/overlay.c |    8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
+index 9209acf..c047206 100644
+--- a/drivers/video/omap2/dss/overlay.c
++++ b/drivers/video/omap2/dss/overlay.c
+@@ -281,6 +281,11 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_display *display)
+       info = &ovl->info;
++      if (info->paddr == 0) {
++              DSSDBG("check_overlay failed: paddr 0\n");
++              return -EINVAL;
++      }
++
+       display->get_resolution(display, &dw, &dh);
+       DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
+@@ -331,9 +336,6 @@ static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
+       int r;
+       struct omap_overlay_info old_info;
+-      if (info->paddr == 0)
+-              return -EINVAL;
+-
+       old_info = ovl->info;
+       ovl->info = *info;
+-- 
+1.5.6.5
+
index 2376869..bb7f2a4 100644 (file)
@@ -10,6 +10,7 @@ DEFAULT_PREFERENCE_overo = "1"
 
 SRCREV = "58cf2f1425abfd3a449f9fe985e48be2d2555022"
 
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
 PR_append = "+gitr${SRCREV}"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git;protocol=git \
@@ -33,6 +34,11 @@ SRC_URI_append = " \
            file://dss2/0011-DSS2-Allocated-memory-for-Color-Look-up-table.patch;patch=1 \
            file://dss2/0012-DSS2-Fix-DMA-rotation.patch;patch=1 \
            file://dss2/0013-DSS2-Verify-that-overlay-paddr-0.patch;patch=1 \
+           file://dss2/0014-DSS2-Add-function-to-get-DSS-logic-clock-rate.patch;patch=1 \
+           file://dss2/0015-DSS2-DSI-calculate-VP_CLK_RATIO-properly.patch;patch=1 \
+           file://dss2/0016-DSS2-DSI-improve-packet-len-calculation.patch;patch=1 \
+           file://dss2/0017-DSS2-Disable-video-planes-on-sync-lost-error.patch;patch=1 \
+           file://dss2/0018-DSS2-check-for-ovl-paddr-only-when-enabling.patch;patch=1 \
            file://0001-board-ldp-add-regulator-info-to-get-the-microSD-slo.patch;patch=1 \
            file://fix-unaligned-access.diff;patch=1 \
            file://make-alignment-visible.diff;patch=1 \