]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
omap3: allow dynamic selection of gfx_format
authorNikita Kiryanov <nikita@compulab.co.il>
Wed, 30 Jan 2013 21:39:55 +0000 (21:39 +0000)
committerTom Rini <trini@ti.com>
Fri, 8 Mar 2013 21:41:13 +0000 (16:41 -0500)
Currently, omap3_dss_panel_config() sets gfx_format to a value that is hardcoded
in the code. This forces anyone who wants to use a different gfx_format to make
adjustments after calling omap3_dss_panel_config(). This could be avoided if the
value of gfx_format were parameterized as input for omap3_dss_panel_config().

Make gfx_format a field in struct panel_config, and update existing structs to
set this field to the value that was originally hard coded.

Cc: Wolfgang Denk <wd@denx.de>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
arch/arm/include/asm/arch-omap3/dss.h
board/htkw/mcx/mcx.c
board/teejet/mt_ventoux/mt_ventoux.c
board/ti/beagle/beagle.h
drivers/video/omap3_dss.c

index 0cbef8479fa0718a5eb63058e5c951a15e5d3f0d..ae0babf17c0d09028b0592dbb5e9e9f36d89b818 100644 (file)
@@ -208,6 +208,7 @@ struct panel_config {
        u32 data_lines;
        u32 load_mode;
        u32 panel_color;
+       u32 gfx_format;
        void *frame_buffer;
 };
 
index 46fa7e4cec15d1bc8edc4f655665447a0ee97865..923461a3902382dbad6e757f441a9fc1c1a6e25e 100644 (file)
@@ -130,6 +130,7 @@ static struct panel_config lcd_cfg = {
        .load_mode      = 0x02, /* Frame Mode */
        .panel_color    = 0,
        .lcd_size       = PANEL_LCD_SIZE(800, 480),
+       .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
 };
 
 int board_video_init(void)
index 2de0e817791e0fbfced38ad62a470855b9579193..d57678668be1228c7209706cc1daa00b90377479 100644 (file)
@@ -81,6 +81,7 @@ static struct panel_config lcd_cfg[] = {
        .data_lines     = 0x03, /* 24 Bit RGB */
        .load_mode      = 0x02, /* Frame Mode */
        .panel_color    = 0,
+       .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
        },
        {
        .timing_h       = PANEL_TIMING_H(20, 192, 4),
@@ -91,6 +92,7 @@ static struct panel_config lcd_cfg[] = {
        .data_lines     = 0x03, /* 24 Bit RGB */
        .load_mode      = 0x02, /* Frame Mode */
        .panel_color    = 0,
+       .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
        }
 };
 #endif
index c0a94a92c168ad72195dbd3fbffa7aac738f4b8c..6d71bbc79db671fa13dd370f054ba92166cae9cb 100644 (file)
@@ -544,7 +544,8 @@ static const struct panel_config dvid_cfg = {
        .panel_type     = 0x01, /* TFT */
        .data_lines     = 0x03, /* 24 Bit RGB */
        .load_mode      = 0x02, /* Frame Mode */
-       .panel_color    = DVI_BEAGLE_ORANGE_COL /* ORANGE */
+       .panel_color    = DVI_BEAGLE_ORANGE_COL, /* ORANGE */
+       .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
 };
 
 static const struct panel_config dvid_cfg_xm = {
@@ -556,6 +557,7 @@ static const struct panel_config dvid_cfg_xm = {
        .panel_type     = 0x01, /* TFT */
        .data_lines     = 0x03, /* 24 Bit RGB */
        .load_mode      = 0x02, /* Frame Mode */
-       .panel_color    = DVI_BEAGLE_ORANGE_COL /* ORANGE */
+       .panel_color    = DVI_BEAGLE_ORANGE_COL, /* ORANGE */
+       .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
 };
 #endif
index b1424bfd038aae79da271dd04c834832734bcad2..6efba122e7876fc24b3d8d7444be66bcc54995c8 100644 (file)
@@ -121,7 +121,7 @@ void omap3_dss_panel_config(const struct panel_config *panel_cfg)
        if (!panel_cfg->frame_buffer)
                return;
 
-       writel(8 << GFX_FORMAT_SHIFT | GFX_ENABLE, &dispc->gfx_attributes);
+       writel(panel_cfg->gfx_format | GFX_ENABLE, &dispc->gfx_attributes);
        writel(1, &dispc->gfx_row_inc);
        writel(1, &dispc->gfx_pixel_inc);
        writel(panel_cfg->lcd_size, &dispc->gfx_size);