linux-omap 2.6.29: add more DSS2 patches
authorKoen Kooi <koen@openembedded.org>
Tue, 14 Apr 2009 11:44:23 +0000 (13:44 +0200)
committerKoen Kooi <koen@openembedded.org>
Tue, 14 Apr 2009 11:44:23 +0000 (13:44 +0200)
conf/machine/include/omap3.inc
recipes/linux/linux-omap-2.6.29/dss2/0005-DSS2-Add-panel-drivers.patch
recipes/linux/linux-omap-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch [new file with mode: 0644]
recipes/linux/linux-omap_2.6.29.bb

index 3b06e8f..fdf4daf 100644 (file)
@@ -1,7 +1,7 @@
 require conf/machine/include/tune-cortexa8.inc
 PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
 # Increase this everytime you change something in the kernel
-MACHINE_KERNEL_PR = "r25
+MACHINE_KERNEL_PR = "r26
 
 KERNEL_IMAGETYPE = "uImage"
 
index 835298f..d12586c 100644 (file)
@@ -254,7 +254,7 @@ index 0000000..e4bb781
 +              .vfp            = 4,
 +              .vbp            = 12-10,
 +      },
-+
++      .recommended_bpp = 16,
 +      .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS,
 +};
 +
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch b/recipes/linux/linux-omap-2.6.29/dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch
new file mode 100644 (file)
index 0000000..daa95ca
--- /dev/null
@@ -0,0 +1,183 @@
+From 67f3fc050ab4e2006d5b7ec6ec341896627181ab Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:04 +0200
+Subject: [PATCH] DSS2: Check fclk limits when configuring video planes
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Check that the currect functional clock is fast enough to support
+the requested scaling ratios. Also check if 5-tap filtering can be
+used even though the downscaling ratio is less than 1:2 since the
+functional clock rate required for 5-tap filtering can be less than
+the requirement for 3-tap filtering, and 5-tap filtering should look
+better.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c |  104 ++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 97 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 41734f3..61861d8 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1026,11 +1026,11 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
+ static void _dispc_set_scaling(enum omap_plane plane,
+               u16 orig_width, u16 orig_height,
+               u16 out_width, u16 out_height,
+-              bool ilace)
++              bool ilace, bool five_taps)
+ {
+       int fir_hinc;
+       int fir_vinc;
+-      int hscaleup, vscaleup, five_taps;
++      int hscaleup, vscaleup;
+       int fieldmode = 0;
+       int accu0 = 0;
+       int accu1 = 0;
+@@ -1040,7 +1040,6 @@ static void _dispc_set_scaling(enum omap_plane plane,
+       hscaleup = orig_width <= out_width;
+       vscaleup = orig_height <= out_height;
+-      five_taps = orig_height > out_height * 2;
+       _dispc_set_scale_coef(plane, hscaleup, vscaleup, five_taps);
+@@ -1283,6 +1282,73 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
+       }
+ }
++static unsigned long calc_fclk_five_taps(u16 width, u16 height,
++              u16 out_width, u16 out_height, enum omap_color_mode color_mode)
++{
++      u32 fclk = 0;
++      /* FIXME venc pclk? */
++      u64 tmp, pclk = dispc_pclk_rate();
++
++      if (height > out_height) {
++              /* FIXME get real display PPL */
++              unsigned int ppl = 800;
++
++              tmp = pclk * height * out_width;
++              do_div(tmp, 2 * out_height * ppl);
++              fclk = tmp;
++
++              if (height > 2 * out_height) {
++                      tmp = pclk * (height - 2 * out_height) * out_width;
++                      do_div(tmp, 2 * out_height * (ppl - out_width));
++                      fclk = max(fclk, (u32) tmp);
++              }
++      }
++
++      if (width > out_width) {
++              tmp = pclk * width;
++              do_div(tmp, out_width);
++              fclk = max(fclk, (u32) tmp);
++
++              if (color_mode == OMAP_DSS_COLOR_RGB24U)
++                      fclk <<= 1;
++      }
++
++      return fclk;
++}
++
++static unsigned long calc_fclk(u16 width, u16 height,
++              u16 out_width, u16 out_height,
++              enum omap_color_mode color_mode, bool five_taps)
++{
++      unsigned int hf, vf;
++
++      if (five_taps)
++              return calc_fclk_five_taps(width, height,
++                              out_width, out_height, color_mode);
++
++      /*
++       * FIXME how to determine the 'A' factor
++       * for the no downscaling case ?
++       */
++
++      if (width > 3 * out_width)
++              hf = 4;
++      else if (width > 2 * out_width)
++              hf = 3;
++      else if (width > out_width)
++              hf = 2;
++      else
++              hf = 1;
++
++      if (height > out_height)
++              vf = 2;
++      else
++              vf = 1;
++
++      /* FIXME venc pclk? */
++      return dispc_pclk_rate() * vf * hf;
++}
++
+ static int _dispc_setup_plane(enum omap_plane plane,
+               enum omap_channel channel_out,
+               u32 paddr, u16 screen_width,
+@@ -1294,7 +1360,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+               u8 rotation, int mirror)
+ {
+       const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
+-      bool five_taps = height > out_height * 2;
++      bool five_taps = 0;
+       bool fieldmode = 0;
+       int cconv = 0;
+       unsigned offset0, offset1;
+@@ -1323,8 +1389,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
+               }
+       } else {
+               /* video plane */
+-              if (width > (2048 >> five_taps))
+-                      return -EINVAL;
++
++              unsigned long fclk;
+               if (out_width < width / maxdownscale ||
+                  out_width > width * 8)
+@@ -1356,6 +1422,30 @@ static int _dispc_setup_plane(enum omap_plane plane,
+               default:
+                       return -EINVAL;
+               }
++
++              /* Must use 5-tap filter? */
++              five_taps = height > out_height * 2;
++
++              /* Try to use 5-tap filter whenever possible. */
++              if (cpu_is_omap34xx() && !five_taps &&
++                  height > out_height && width <= 1024) {
++                      fclk = calc_fclk_five_taps(width, height,
++                                      out_width, out_height, color_mode);
++                      if (fclk <= dispc_fclk_rate())
++                              five_taps = true;
++              }
++
++              if (width > (2048 >> five_taps))
++                      return -EINVAL;
++
++              fclk = calc_fclk(width, height, out_width, out_height,
++                              color_mode, five_taps);
++
++              DSSDBG("required fclk rate = %lu Hz\n", fclk);
++              DSSDBG("current fclk rate = %lu Hz\n", dispc_fclk_rate());
++
++              if (fclk > dispc_fclk_rate())
++                      return -EINVAL;
+       }
+       if (ilace && height >= out_height)
+@@ -1399,7 +1489,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
+       if (plane != OMAP_DSS_GFX) {
+               _dispc_set_scaling(plane, width, height,
+                                  out_width, out_height,
+-                                 ilace);
++                                 ilace, five_taps);
+               _dispc_set_vid_size(plane, out_width, out_height);
+               _dispc_set_vid_color_conv(plane, cconv);
+       }
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch b/recipes/linux/linux-omap-2.6.29/dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch
new file mode 100644 (file)
index 0000000..b324852
--- /dev/null
@@ -0,0 +1,79 @@
+From 9f8f1613253656f155b3844c8255a560f86e0acd Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:05 +0200
+Subject: [PATCH] DSS2: Check scaling limits against proper values
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Move the ilace and fieldmode related height adjustments to be performed
+before checking the scaling limits.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/dispc.c |   31 ++++++++++++++++---------------
+ 1 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index 61861d8..ae7be3d 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1366,10 +1366,25 @@ static int _dispc_setup_plane(enum omap_plane plane,
+       unsigned offset0, offset1;
+       s32 row_inc;
+       s32 pix_inc;
++      u16 frame_height = height;
+       if (paddr == 0)
+               return -EINVAL;
++      if (ilace && height >= out_height)
++              fieldmode = 1;
++
++      if (ilace) {
++              if (fieldmode)
++                      height /= 2;
++              pos_y /= 2;
++              out_height /= 2;
++
++              DSSDBG("adjusting for ilace: height %d, pos_y %d, "
++                              "out_height %d\n",
++                              height, pos_y, out_height);
++      }
++
+       if (plane == OMAP_DSS_GFX) {
+               if (width != out_width || height != out_height)
+                       return -EINVAL;
+@@ -1448,28 +1463,14 @@ static int _dispc_setup_plane(enum omap_plane plane,
+                       return -EINVAL;
+       }
+-      if (ilace && height >= out_height)
+-              fieldmode = 1;
+-
+       calc_rotation_offset(rotation, mirror,
+-                      screen_width, width, height, color_mode,
++                      screen_width, width, frame_height, color_mode,
+                       fieldmode,
+                       &offset0, &offset1, &row_inc, &pix_inc);
+       DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
+                       offset0, offset1, row_inc, pix_inc);
+-      if (ilace) {
+-              if (fieldmode)
+-                      height /= 2;
+-              pos_y /= 2;
+-              out_height /= 2;
+-
+-              DSSDBG("adjusting for ilace: height %d, pos_y %d, "
+-                              "out_height %d\n",
+-                              height, pos_y, out_height);
+-      }
+-
+       _dispc_set_channel_out(plane, channel_out);
+       _dispc_set_color_mode(plane, color_mode);
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch b/recipes/linux/linux-omap-2.6.29/dss2/0021-DSS2-Add-venc-register-dump.patch
new file mode 100644 (file)
index 0000000..31ff180
--- /dev/null
@@ -0,0 +1,96 @@
+From c5e71be877e71c7df329205307e830f158c403bf Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
+Date: Mon, 6 Apr 2009 17:32:06 +0200
+Subject: [PATCH] DSS2: Add venc register dump
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Add a new file to debugfs to dump the VENC registers. The function
+prototype was already there but the implementation was missing.
+
+Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
+---
+ drivers/video/omap2/dss/venc.c |   55 ++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 55 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index aceed9f..b655df4 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -30,6 +30,7 @@
+ #include <linux/completion.h>
+ #include <linux/delay.h>
+ #include <linux/string.h>
++#include <linux/seq_file.h>
+ #include <mach/display.h>
+ #include <mach/cpu.h>
+@@ -81,6 +82,7 @@
+ #define VENC_TVDETGP_INT_START_STOP_Y         0xB4
+ #define VENC_GEN_CTRL                         0xB8
+ #define VENC_OUTPUT_CONTROL                   0xC4
++#define VENC_OUTPUT_TEST                      0xC8
+ #define VENC_DAC_B__DAC_C                     0xC8
+ struct venc_config {
+@@ -598,3 +600,56 @@ void venc_init_display(struct omap_display *display)
+       display->set_timings = venc_set_timings;
+       display->check_timings = venc_check_timings;
+ }
++
++void venc_dump_regs(struct seq_file *s)
++{
++#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))
++
++      venc_enable_clocks(1);
++
++      DUMPREG(VENC_F_CONTROL);
++      DUMPREG(VENC_VIDOUT_CTRL);
++      DUMPREG(VENC_SYNC_CTRL);
++      DUMPREG(VENC_LLEN);
++      DUMPREG(VENC_FLENS);
++      DUMPREG(VENC_HFLTR_CTRL);
++      DUMPREG(VENC_CC_CARR_WSS_CARR);
++      DUMPREG(VENC_C_PHASE);
++      DUMPREG(VENC_GAIN_U);
++      DUMPREG(VENC_GAIN_V);
++      DUMPREG(VENC_GAIN_Y);
++      DUMPREG(VENC_BLACK_LEVEL);
++      DUMPREG(VENC_BLANK_LEVEL);
++      DUMPREG(VENC_X_COLOR);
++      DUMPREG(VENC_M_CONTROL);
++      DUMPREG(VENC_BSTAMP_WSS_DATA);
++      DUMPREG(VENC_S_CARR);
++      DUMPREG(VENC_LINE21);
++      DUMPREG(VENC_LN_SEL);
++      DUMPREG(VENC_L21__WC_CTL);
++      DUMPREG(VENC_HTRIGGER_VTRIGGER);
++      DUMPREG(VENC_SAVID__EAVID);
++      DUMPREG(VENC_FLEN__FAL);
++      DUMPREG(VENC_LAL__PHASE_RESET);
++      DUMPREG(VENC_HS_INT_START_STOP_X);
++      DUMPREG(VENC_HS_EXT_START_STOP_X);
++      DUMPREG(VENC_VS_INT_START_X);
++      DUMPREG(VENC_VS_INT_STOP_X__VS_INT_START_Y);
++      DUMPREG(VENC_VS_INT_STOP_Y__VS_EXT_START_X);
++      DUMPREG(VENC_VS_EXT_STOP_X__VS_EXT_START_Y);
++      DUMPREG(VENC_VS_EXT_STOP_Y);
++      DUMPREG(VENC_AVID_START_STOP_X);
++      DUMPREG(VENC_AVID_START_STOP_Y);
++      DUMPREG(VENC_FID_INT_START_X__FID_INT_START_Y);
++      DUMPREG(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X);
++      DUMPREG(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y);
++      DUMPREG(VENC_TVDETGP_INT_START_STOP_X);
++      DUMPREG(VENC_TVDETGP_INT_START_STOP_Y);
++      DUMPREG(VENC_GEN_CTRL);
++      DUMPREG(VENC_OUTPUT_CONTROL);
++      DUMPREG(VENC_OUTPUT_TEST);
++
++      venc_enable_clocks(0);
++
++#undef DUMPREG
++}
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch b/recipes/linux/linux-omap-2.6.29/dss2/0022-DSS2-FB-remove-unused-var-warning.patch
new file mode 100644 (file)
index 0000000..d4fb327
--- /dev/null
@@ -0,0 +1,27 @@
+From facfd479bb6efad76eec1e74048cb7a31da7287d Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Mon, 6 Apr 2009 22:26:04 +0200
+Subject: [PATCH] DSS2: FB: remove unused var warning
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index afe40a9..12ce0c3 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -1246,7 +1246,9 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+               display->get_resolution(display, &w, &h);
+               if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
++#ifdef DEBUG
+                       int oldw = w, oldh = h;
++#endif
+                       omap_vrfb_adjust_size(&w, &h, bytespp);
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch b/recipes/linux/linux-omap-2.6.29/dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch
new file mode 100644 (file)
index 0000000..6492905
--- /dev/null
@@ -0,0 +1,214 @@
+From c02b843c2732bc7b15a3e35b5dd715d68225bbd1 Mon Sep 17 00:00:00 2001
+From: Imre Deak <imre.deak@nokia.com>
+Date: Wed, 8 Apr 2009 12:51:46 +0200
+Subject: [PATCH] DSS2: pass the default FB color format through board info
+
+Add a field to the FB memory region platform data, so that board
+init code can pass a default color format to the driver. Set this
+format as an initial setting for the given FB.
+
+This is needed for an upcoming patch that adds detection of the
+color format set by the bootloader.
+
+Signed-off-by: Imre Deak <imre.deak@nokia.com>
+---
+ drivers/video/omap2/omapfb/omapfb-main.c |  121 +++++++++++++++++++++++++++---
+ drivers/video/omap2/omapfb/omapfb.h      |    2 +
+ include/linux/omapfb.h                   |    5 +
+ 3 files changed, 117 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 12ce0c3..67c67c2 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -370,6 +370,21 @@ static enum omap_color_mode fb_mode_to_dss_mode(struct fb_var_screeninfo *var)
+       return -EINVAL;
+ }
++static int dss_mode_to_fb_mode(enum omap_color_mode dssmode,
++                             struct fb_var_screeninfo *var)
++{
++      int i;
++
++      for (i = 0; i < ARRAY_SIZE(omapfb_colormodes); ++i) {
++              struct omapfb_colormode *mode = &omapfb_colormodes[i];
++              if (dssmode == mode->dssmode) {
++                      assign_colormode_to_var(var, mode);
++                      return 0;
++              }
++      }
++      return -ENOENT;
++}
++
+ void set_fb_fix(struct fb_info *fbi)
+ {
+       struct fb_fix_screeninfo *fix = &fbi->fix;
+@@ -1267,6 +1282,60 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
+       return omapfb_alloc_fbmem(fbi, size, paddr);
+ }
++static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format format)
++{
++      enum omap_color_mode mode;
++
++      switch (format) {
++      case OMAPFB_COLOR_RGB565:
++              mode = OMAP_DSS_COLOR_RGB16;
++              break;
++      case OMAPFB_COLOR_YUV422:
++              mode = OMAP_DSS_COLOR_YUV2;
++              break;
++      case OMAPFB_COLOR_CLUT_8BPP:
++              mode = OMAP_DSS_COLOR_CLUT8;
++              break;
++      case OMAPFB_COLOR_CLUT_4BPP:
++              mode = OMAP_DSS_COLOR_CLUT4;
++              break;
++      case OMAPFB_COLOR_CLUT_2BPP:
++              mode = OMAP_DSS_COLOR_CLUT2;
++              break;
++      case OMAPFB_COLOR_CLUT_1BPP:
++              mode = OMAP_DSS_COLOR_CLUT1;
++              break;
++      case OMAPFB_COLOR_RGB444:
++              mode = OMAP_DSS_COLOR_RGB12U;
++              break;
++      case OMAPFB_COLOR_YUY422:
++              mode = OMAP_DSS_COLOR_UYVY;
++              break;
++      case OMAPFB_COLOR_ARGB16:
++              mode = OMAP_DSS_COLOR_ARGB16;
++              break;
++      case OMAPFB_COLOR_RGB24U:
++              mode = OMAP_DSS_COLOR_RGB24U;
++              break;
++      case OMAPFB_COLOR_RGB24P:
++              mode = OMAP_DSS_COLOR_RGB24P;
++              break;
++      case OMAPFB_COLOR_ARGB32:
++              mode = OMAP_DSS_COLOR_ARGB32;
++              break;
++      case OMAPFB_COLOR_RGBA32:
++              mode = OMAP_DSS_COLOR_RGBA32;
++              break;
++      case OMAPFB_COLOR_RGBX32:
++              mode = OMAP_DSS_COLOR_RGBX32;
++              break;
++      default:
++              mode = -EINVAL;
++      }
++
++      return mode;
++}
++
+ static int omapfb_parse_vram_param(const char *param, int max_entries,
+               unsigned long *sizes, unsigned long *paddrs)
+ {
+@@ -1483,9 +1552,36 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+       }
+       var->nonstd = 0;
++      var->bits_per_pixel = 0;
+       var->rotate = ofbi->rotation;
++      /*
++       * Check if there is a default color format set in the board file,
++       * and use this format instead the default deducted from the
++       * display bpp.
++       */
++      if (fbdev->dev->platform_data) {
++              struct omapfb_platform_data *opd;
++              int id = ofbi->id;
++
++              opd = fbdev->dev->platform_data;
++              if (opd->mem_desc.region[id].format_used) {
++                      enum omap_color_mode mode;
++                      enum omapfb_color_format format;
++
++                      format = opd->mem_desc.region[id].format;
++                      mode = fb_format_to_dss_mode(format);
++                      if (mode < 0) {
++                              r = mode;
++                              goto err;
++                      }
++                      r = dss_mode_to_fb_mode(mode, var);
++                      if (r < 0)
++                              goto err;
++              }
++      }
++
+       if (display) {
+               u16 w, h;
+               display->get_resolution(display, &w, &h);
+@@ -1502,16 +1598,18 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+               var->xres_virtual = var->xres;
+               var->yres_virtual = var->yres;
+-              switch (display->get_recommended_bpp(display)) {
+-              case 16:
+-                      var->bits_per_pixel = 16;
+-                      break;
+-              case 24:
+-                      var->bits_per_pixel = 32;
+-                      break;
+-              default:
+-                      dev_err(fbdev->dev, "illegal display bpp\n");
+-                      return -EINVAL;
++              if (!var->bits_per_pixel) {
++                      switch (display->get_recommended_bpp(display)) {
++                              case 16:
++                                      var->bits_per_pixel = 16;
++                                      break;
++                              case 24:
++                                      var->bits_per_pixel = 32;
++                                      break;
++                              default:
++                                      dev_err(fbdev->dev, "illegal display bpp\n");
++                                      return -EINVAL;
++                      }
+               }
+       } else {
+               /* if there's no display, let's just guess some basic values */
+@@ -1519,7 +1617,8 @@ int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
+               var->yres = 240;
+               var->xres_virtual = var->xres;
+               var->yres_virtual = var->yres;
+-              var->bits_per_pixel = 16;
++              if (!var->bits_per_pixel)
++                      var->bits_per_pixel = 16;
+       }
+       r = check_fb_var(fbi, var);
+diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
+index 65e9e6e..2607def 100644
+--- a/drivers/video/omap2/omapfb/omapfb.h
++++ b/drivers/video/omap2/omapfb/omapfb.h
+@@ -27,6 +27,8 @@
+ #define DEBUG
+ #endif
++#include <mach/display.h>
++
+ #ifdef DEBUG
+ extern unsigned int omapfb_debug;
+ #define DBG(format, ...) \
+diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
+index 96190b2..7a34f22 100644
+--- a/include/linux/omapfb.h
++++ b/include/linux/omapfb.h
+@@ -298,6 +298,11 @@ struct omapfb_mem_region {
+       void __iomem    *vaddr;
+       unsigned long   size;
+       u8              type;           /* OMAPFB_PLANE_MEM_* */
++      enum omapfb_color_format format;/* OMAPFB_COLOR_* */
++      unsigned        format_used:1;  /* Must be set when format is set.
++                                       * Needed b/c of the badly chosen 0
++                                       * base for OMAPFB_COLOR_* values
++                                       */
+       unsigned        alloc:1;        /* allocated by the driver */
+       unsigned        map:1;          /* kernel mapped by the driver */
+ };
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch b/recipes/linux/linux-omap-2.6.29/dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch
new file mode 100644 (file)
index 0000000..559e49f
--- /dev/null
@@ -0,0 +1,48 @@
+From 2710416c43572652cb5355a5eaf68038c95659e8 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
+Date: Thu, 9 Apr 2009 12:10:46 +0300
+Subject: [PATCH] DSS2: Beagle: Use gpio_set_value
+
+---
+ arch/arm/mach-omap2/board-omap3beagle.c |   10 +++++++---
+ 1 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index b67e7a5..8c1961d 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -372,7 +372,7 @@ static struct platform_device keys_gpio = {
+ static int beagle_enable_dvi(struct omap_display *display)
+ {
+       if (display->hw_config.panel_reset_gpio != -1)
+-              gpio_direction_output(display->hw_config.panel_reset_gpio, 1);
++              gpio_set_value(display->hw_config.panel_reset_gpio, 1);
+       return 0;
+ }
+@@ -380,7 +380,7 @@ static int beagle_enable_dvi(struct omap_display *display)
+ static void beagle_disable_dvi(struct omap_display *display)
+ {
+       if (display->hw_config.panel_reset_gpio != -1)
+-              gpio_direction_output(display->hw_config.panel_reset_gpio, 0);
++              gpio_set_value(display->hw_config.panel_reset_gpio, 0);
+ }
+ static struct omap_dss_display_config beagle_display_data_dvi = {
+@@ -445,8 +445,12 @@ static void __init beagle_display_init(void)
+       int r;
+       r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
+-      if (r < 0)
++      if (r < 0) {
+               printk(KERN_ERR "Unable to get DVI reset GPIO\n");
++              return;
++      }
++
++      gpio_direction_output(beagle_display_data_dvi.panel_reset_gpio, 0);
+ }
+ static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
+-- 
+1.5.6.5
+
diff --git a/recipes/linux/linux-omap-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch b/recipes/linux/linux-omap-2.6.29/dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.patch
new file mode 100644 (file)
index 0000000..e81b133
--- /dev/null
@@ -0,0 +1,28 @@
+From 990f3160d33361c135ee72e91f202e05a8c378fc Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Mon, 13 Apr 2009 18:50:24 +0530
+Subject: [PATCH] DSS2: VRFB: Macro for calculating base address of the VRFB context was faulty
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ arch/arm/plat-omap/vrfb.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
+index 7e0f8fc..d68065f 100644
+--- a/arch/arm/plat-omap/vrfb.c
++++ b/arch/arm/plat-omap/vrfb.c
+@@ -16,8 +16,8 @@
+ #define SMS_ROT_VIRT_BASE(context, rot) \
+       (((context >= 4) ? 0xD0000000 : 0x70000000) \
+-       | 0x4000000 * (context) \
+-       | 0x1000000 * (rot))
++       + (0x4000000 * (context)) \
++       + (0x1000000 * (rot)))
+ #define OMAP_VRFB_SIZE                        (2048 * 2048 * 4)
+-- 
+1.5.6.5
+
index 0948e46..a580a43 100644 (file)
@@ -39,6 +39,13 @@ SRC_URI_append = " \
            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://dss2/0019-DSS2-Check-fclk-limits-when-configuring-video-plane.patch;patch=1 \
+           file://dss2/0020-DSS2-Check-scaling-limits-against-proper-values.patch;patch=1 \
+           file://dss2/0021-DSS2-Add-venc-register-dump.patch;patch=1 \
+           file://dss2/0022-DSS2-FB-remove-unused-var-warning.patch;patch=1 \
+           file://dss2/0023-DSS2-pass-the-default-FB-color-format-through-board.patch;patch=1 \
+           file://dss2/0024-DSS2-Beagle-Use-gpio_set_value.patch;patch=1 \
+           file://dss2/0025-DSS2-VRFB-Macro-for-calculating-base-address-of-th.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 \