Patchwork [U-Boot,V2,2/7] omap3: allow dynamic selection of gfx_format

login
register
mail settings
Submitter Nikita Kiryanov
Date Jan. 29, 2013, 12:42 p.m.
Message ID <1359463349-11649-3-git-send-email-nikita@compulab.co.il>
Download mbox | patch
Permalink /patch/216517/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Nikita Kiryanov - Jan. 29, 2013, 12:42 p.m.
Currently the value of gfx_format is hardcoded into
omap3_dss_panel_config(). Make it a field in struct panel_config, and
update existing structs to set this field to the value that was originally hard
coded.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
NOTE: New patch in the series; no V1.

 arch/arm/include/asm/arch-omap3/dss.h |    1 +
 board/htkw/mcx/mcx.c                  |    1 +
 board/teejet/mt_ventoux/mt_ventoux.c  |    2 ++
 board/ti/beagle/beagle.h              |    6 ++++--
 drivers/video/omap3_dss.c             |    2 +-
 5 files changed, 9 insertions(+), 3 deletions(-)
Wolfgang Denk - Jan. 29, 2013, 1:52 p.m.
Dear Nikita Kiryanov,

In message <1359463349-11649-3-git-send-email-nikita@compulab.co.il> you wrote:
> Currently the value of gfx_format is hardcoded into
> omap3_dss_panel_config(). Make it a field in struct panel_config, and
> update existing structs to set this field to the value that was originally hard
> coded.

It is not exactly clear to me what exactly this is needed for?  Are
you just adding dead code?  if not, then please explain this in the
commit message.

Best regards,

Wolfgang Denk
Nikita Kiryanov - Jan. 29, 2013, 2:22 p.m.
Hi Wolfgang Denk,

On 01/29/2013 03:52 PM, Wolfgang Denk wrote:
> Dear Nikita Kiryanov,
>
> In message <1359463349-11649-3-git-send-email-nikita@compulab.co.il> you wrote:
>> Currently the value of gfx_format is hardcoded into
>> omap3_dss_panel_config(). Make it a field in struct panel_config, and
>> update existing structs to set this field to the value that was originally hard
>> coded.
>
> It is not exactly clear to me what exactly this is needed for?  Are
> you just adding dead code?  if not, then please explain this in the
> commit message.

Currently if you want to use a gfx format other than what
omap3_dss_panel_config() sets, you have to change it manually.
It was suggested in the review of V1 that it would be better if this
value could simply be passed to omap3_dss_panel_config() so that
there wouldn't be a need for adjustments.

I'll try to rephrase the commit message to explain the benefits of this.

>
> Best regards,
>
> Wolfgang Denk
>

Patch

diff --git a/arch/arm/include/asm/arch-omap3/dss.h b/arch/arm/include/asm/arch-omap3/dss.h
index 74321ae..ad5a73e 100644
--- a/arch/arm/include/asm/arch-omap3/dss.h
+++ b/arch/arm/include/asm/arch-omap3/dss.h
@@ -213,6 +213,7 @@  struct panel_config {
 	u32 data_lines;
 	u32 load_mode;
 	u32 panel_color;
+	u32 gfx_format;
 	void *frame_buffer;
 };
 
diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c
index 9fe6408..5eda6c4 100644
--- a/board/htkw/mcx/mcx.c
+++ b/board/htkw/mcx/mcx.c
@@ -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)
diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c
index c516c75..78d81d6 100644
--- a/board/teejet/mt_ventoux/mt_ventoux.c
+++ b/board/teejet/mt_ventoux/mt_ventoux.c
@@ -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
diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
index c0a94a9..6d71bbc 100644
--- a/board/ti/beagle/beagle.h
+++ b/board/ti/beagle/beagle.h
@@ -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
diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c
index b1424bf..6efba12 100644
--- a/drivers/video/omap3_dss.c
+++ b/drivers/video/omap3_dss.c
@@ -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);