Skip to contentSkip to conversation

EXYNOS: display 32bpp bitmap TIZEN logo

PATCH Superseded Donghwa Lee 3 participants 3 messages Apr 26, 2012 – Apr 30, 2012

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/3 EXYNOS: display 32bpp bitmap TIZEN logo

This patches support drawing 32bpp bitmap TIZEN logo in exynos fb. trats_logo.h data is compressed from trats_logo.bmp to trats_logo.bmp.gz by gzip and converted to trats_logo.h header file format by some application. And then it is decomressed at the exynos fb driver by gunzip_bmp().

change of v1:
- set CONFIG_SYS_VIDEO_LOGO_MAX_SIZE bigger than BMP header file size.
- drawing logo when boot_logo_on variable sets in board file.
- move trats_logo* header file to another patch.
- set RGB order depending on file format in board file.
- and so on.

---
 board/samsung/trats/trats.c |   12 ++++++++++++
 drivers/video/exynos_fb.c   |   33 +++++++++++++++++++++++++++++++++
 drivers/video/exynos_fb.h   |    7 -------
 drivers/video/exynos_fimd.c |    2 +-
 include/configs/trats.h     |    5 ++++-
 include/lcd.h               |    4 ++++
 6 files changed, 54 insertions(+), 9 deletions(-)
board/samsung/trats/trats.c +12 -0
index 084b67a..9d75b8f 100644
@@ -37,6 +37,7 @@
 #include <pmic.h>
 #include <usb/s3c_udc.h>
 #include <max8997_pmic.h>
+#include <tizen_logo_data.h>
 
 #include "setup.h"
 
@@ -455,6 +456,13 @@ static int mipi_power(void)
 	return 0;
 }
 
+enum exynos_fb_rgb_mode_t {
+	MODE_RGB_P = 0,
+	MODE_BGR_P = 1,
+	MODE_RGB_S = 2,
+	MODE_BGR_S = 3,
+};
+
 vidinfo_t panel_info = {
 	.vl_freq	= 60,
 	.vl_col		= 720,
@@ -489,6 +497,10 @@ vidinfo_t panel_info = {
 	.reset_delay	= 0,
 	.interface_mode = FIMD_RGB_INTERFACE,
 	.mipi_enabled	= 1,
+	.boot_logo_on	= 1,
+	.rgb_mode	= MODE_BGR_P,
+	.logo_height = TIZEN_LOGO_HEIGHT,
+	.logo_width = TIZEN_LOGO_WIDTH,
 };
 
 void init_panel_info(vidinfo_t *vid)
drivers/video/exynos_fb.c +33 -0
index 96a8ec1..f669b65 100644
@@ -32,6 +32,10 @@
 
 #include "exynos_fb.h"
 
+#ifdef CONFIG_TRATS
+#include <tizen_logo.h>
+#endif
+
 int lcd_line_length;
 int lcd_color_fg;
 int lcd_color_bg;
@@ -64,6 +68,29 @@ static void exynos_lcd_init(vidinfo_t *vid)
 	exynos_fimd_lcd_init(vid);
 }
 
+static void draw_logo(void)
+{
+	int x, y;
+	bmp_image_t *bmp;
+	ulong addr, len;
+	unsigned int logo_width, logo_height;
+
+	logo_width = panel_info.logo_width;
+	logo_height = panel_info.logo_height;
+	x = ((panel_width - logo_width) >> 1);
+	y = ((panel_height - logo_height) >> 1) - 4;
+
+	addr = (ulong)logo;
+	bmp = (bmp_image_t *)addr;
+
+	if (!((bmp->header.signature[0] =='B') &&
+		      (bmp->header.signature[1] =='M'))) {
+			addr = (ulong)gunzip_bmp(addr, &len);
+	}
+
+	lcd_display_bitmap((ulong)addr, x, y);
+}
+
 static void lcd_panel_on(vidinfo_t *vid)
 {
 	udelay(vid->init_delay);
@@ -115,6 +142,12 @@ void lcd_ctrl_init(void *lcdbase)
 
 void lcd_enable(void)
 {
+	if (panel_info.boot_logo_on) {
+		memset(lcd_base, 0, panel_width * panel_height *
+				(NBITS(panel_info.vl_bpix) >> 3));
+		draw_logo();
+	}
+
 	lcd_panel_on(&panel_info);
 }
 
drivers/video/exynos_fb.h +0 -7
index 66f5da6..4ff2efd 100644
@@ -27,13 +27,6 @@
 
 #define MAX_CLOCK	(86 * 1000000)
 
-enum exynos_fb_rgb_mode_t {
-	MODE_RGB_P = 0,
-	MODE_BGR_P = 1,
-	MODE_RGB_S = 2,
-	MODE_BGR_S = 3,
-};
-
 enum exynos_cpu_auto_cmd_rate {
 	DISABLE_AUTO_FRM,
 	PER_TWO_FRM,
drivers/video/exynos_fimd.c +1 -1
index 6416b90..f07568a 100644
@@ -273,7 +273,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
 	/* store panel info to global variable */
 	pvid = vid;
 
-	rgb_mode = MODE_RGB_P;
+	rgb_mode = vid->rgb_mode;
 
 	if (vid->interface_mode == FIMD_RGB_INTERFACE) {
 		cfg |= EXYNOS_VIDCON0_VIDOUT_RGB;
include/configs/trats.h +4 -1
index 5f913ca..e611ace 100644
@@ -216,9 +216,12 @@
 /* LCD */
 #define CONFIG_EXYNOS_FB
 #define CONFIG_LCD
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_32BPP
 #define CONFIG_FB_ADDR		0x52504000
 #define CONFIG_S6E8AX0
 #define CONFIG_EXYNOS_MIPI_DSIM
-#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(1280 * 720 * 4)
+#define CONFIG_VIDEO_BMP_GZIP
+#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 120 * 4) + (1 << 12))
 
 #endif	/* __CONFIG_H */
include/lcd.h +4 -0
index 3d9ef16..5d09696 100644
@@ -235,6 +235,10 @@ typedef struct vidinfo {
 	unsigned int wr_setup;
 	unsigned int wr_act;
 	unsigned int wr_hold;
+	unsigned int boot_logo_on;
+	unsigned int rgb_mode;
+	unsigned int logo_width;
+	unsigned int logo_height;
 
 	/* parent clock name(MPLL, EPLL or VPLL) */
 	unsigned int pclk_name;
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v2 3/3 EXYNOS: display 32bpp bitmap TIZEN logo

Quoted 6 lines · Donghwa Lee

This patches support drawing 32bpp bitmap TIZEN logo in exynos fb. trats_logo.h data is compressed from trats_logo.bmp to trats_logo.bmp.gz by gzip and converted to trats_logo.h header file format by some application. And then it is decomressed at the exynos fb driver by gunzip_bmp().

Quoted 6 lines

change of v1:
?- set CONFIG_SYS_VIDEO_LOGO_MAX_SIZE bigger than BMP header file size. ?- drawing logo when boot_logo_on variable sets in board file. ?- move trats_logo* header file to another patch.
?- set RGB order depending on file format in board file.
?- and so on.

This change log should be moved under the "---" line.

Quoted 25 lines

---

?board/samsung/trats/trats.c | ? 12 ++++++++++++
?drivers/video/exynos_fb.c ? | ? 33 +++++++++++++++++++++++++++++++++
?drivers/video/exynos_fb.h ? | ? ?7 -------
?drivers/video/exynos_fimd.c | ? ?2 +-
?include/configs/trats.h ? ? | ? ?5 ++++-
?include/lcd.h ? ? ? ? ? ? ? | ? ?4 ++++

?6 files changed, 54 insertions(+), 9 deletions(-)

board/samsung/trats/trats.c +0 -0
index 084b67a..9d75b8f 100644
@@ -37,6 +37,7 @@

?#include <pmic.h>
?#include <usb/s3c_udc.h>
?#include <max8997_pmic.h>
+#include <tizen_logo_data.h>

?#include "setup.h"

board/samsung/trats/trats.c static int mipi_power(void) · line 464

Quoted 9 lines
board/samsung/trats/trats.c +6 -0
@@ -455,6 +456,13 @@ static int mipi_power(void)
 ? ? ? ?return 0;
 ?}
 
+enum exynos_fb_rgb_mode_t {
+ ? ? ? MODE_RGB_P = 0,
+ ? ? ? MODE_BGR_P = 1,
+ ? ? ? MODE_RGB_S = 2,
+ ? ? ? MODE_BGR_S = 3,
+};

I think this is not a board specific.
It should be moved to lcd.h or fb.h.. somewhere.

Quoted 23 lines
board/samsung/trats/trats.c +5 -0
+
 ?vidinfo_t panel_info = {
 ? ? ? ?.vl_freq ? ? ? ?= 60,
 ? ? ? ?.vl_col ? ? ? ? = 720,
@@ -489,6 +497,10 @@ vidinfo_t panel_info = {
 ? ? ? ?.reset_delay ? ?= 0,
 ? ? ? ?.interface_mode = FIMD_RGB_INTERFACE,
 ? ? ? ?.mipi_enabled ? = 1,
+ ? ? ? .boot_logo_on ? = 1,
+ ? ? ? .rgb_mode ? ? ? = MODE_BGR_P,
+ ? ? ? .logo_height = TIZEN_LOGO_HEIGHT,
+ ? ? ? .logo_width = TIZEN_LOGO_WIDTH,
 ?};
 
 ?void init_panel_info(vidinfo_t *vid)
drivers/video/exynos_fb.c +0 -0
index 96a8ec1..f669b65 100644
@@ -32,6 +32,10 @@
 

?#include "exynos_fb.h"

drivers/video/exynos_fb.c line 36

Quoted 2 lines
drivers/video/exynos_fb.c +2 -0
+#ifdef CONFIG_TRATS
+#include <tizen_logo.h>

No, there are no relation between TZEN logo and CONFIG_TRATS. Need another define.

Quoted 12 lines
drivers/video/exynos_fb.c +2 -0
+#endif
+

?int lcd_line_length;
?int lcd_color_fg;
?int lcd_color_bg;

drivers/video/exynos_fb.c +3 -0
@@ -64,6 +68,29 @@ static void exynos_lcd_init(vidinfo_t *vid)
 ? ? ? ?exynos_fimd_lcd_init(vid);
 ?}
 
+static void draw_logo(void)
+{
+ ? ? ? int x, y;

drivers/video/exynos_fb.c static void exynos_lcd_init(vidinfo_t *vid) · line 83

Quoted 10 lines
drivers/video/exynos_fb.c +10 -0
+ ? ? ? bmp_image_t *bmp;
+ ? ? ? ulong addr, len;
+ ? ? ? unsigned int logo_width, logo_height;
+
+ ? ? ? logo_width = panel_info.logo_width;
+ ? ? ? logo_height = panel_info.logo_height;
+ ? ? ? x = ((panel_width - logo_width) >> 1);
+ ? ? ? y = ((panel_height - logo_height) >> 1) - 4;
+
+ ? ? ? addr = (ulong)logo;

If did not includes any logo, then you will be get compile errors.

Quoted 62 lines
drivers/video/exynos_fb.c +16 -0
+ ? ? ? bmp = (bmp_image_t *)addr;
+
+ ? ? ? if (!((bmp->header.signature[0] =='B') &&
+ ? ? ? ? ? ? ? ? ? ? (bmp->header.signature[1] =='M'))) {
+ ? ? ? ? ? ? ? ? ? ? ? addr = (ulong)gunzip_bmp(addr, &len);
+ ? ? ? }
+
+ ? ? ? lcd_display_bitmap((ulong)addr, x, y);
+}
+
 ?static void lcd_panel_on(vidinfo_t *vid)
 ?{
 ? ? ? ?udelay(vid->init_delay);
@@ -115,6 +142,12 @@ void lcd_ctrl_init(void *lcdbase)
 
 ?void lcd_enable(void)
 ?{
+ ? ? ? if (panel_info.boot_logo_on) {
+ ? ? ? ? ? ? ? memset(lcd_base, 0, panel_width * panel_height *
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (NBITS(panel_info.vl_bpix) >> 3));
+ ? ? ? ? ? ? ? draw_logo();
+ ? ? ? }
+
 ? ? ? ?lcd_panel_on(&panel_info);
 ?}
 
drivers/video/exynos_fb.h +0 -7
index 66f5da6..4ff2efd 100644
@@ -27,13 +27,6 @@
 
 ?#define MAX_CLOCK ? ? ?(86 * 1000000)
 
-enum exynos_fb_rgb_mode_t {
- ? ? ? MODE_RGB_P = 0,
- ? ? ? MODE_BGR_P = 1,
- ? ? ? MODE_RGB_S = 2,
- ? ? ? MODE_BGR_S = 3,
-};
-
 ?enum exynos_cpu_auto_cmd_rate {
 ? ? ? ?DISABLE_AUTO_FRM,
 ? ? ? ?PER_TWO_FRM,
drivers/video/exynos_fimd.c +0 -0
index 6416b90..f07568a 100644
@@ -273,7 +273,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)

? ? ? ?/* store panel info to global variable */
? ? ? ?pvid = vid;

- ? ? ? rgb_mode = MODE_RGB_P;
+ ? ? ? rgb_mode = vid->rgb_mode;

? ? ? ?if (vid->interface_mode == FIMD_RGB_INTERFACE) { ? ? ? ? ? ? ? ?cfg |= EXYNOS_VIDCON0_VIDOUT_RGB;

include/lcd.h +0 -0
index 3d9ef16..5d09696 100644

include/lcd.h typedef struct vidinfo { · line 241

Quoted 7 lines
include/lcd.h +4 -0
@@ -235,6 +235,10 @@ typedef struct vidinfo {
 ? ? ? ?unsigned int wr_setup;
 ? ? ? ?unsigned int wr_act;
 ? ? ? ?unsigned int wr_hold;
+ ? ? ? unsigned int boot_logo_on;
+ ? ? ? unsigned int rgb_mode;
+ ? ? ? unsigned int logo_width;
+ ? ? ? unsigned int logo_height;

boot_logo? or logo?
please fix it.

Thanks.
Minkyu Kang.

Signature · 2 lines
from. prom.
www.promsoft.net
#2 lore raw

PATCH v2 3/3 EXYNOS: display 32bpp bitmap TIZEN logo

In reply to Donghwa Lee

Hi,

On Thu, 26 Apr 2012 17:21:23 +0900
Donghwa Lee <[email protected]> wrote:
...

Quoted 4 lines
drivers/video/exynos_fb.c +0 -0
index 96a8ec1..f669b65 100644

...

Quoted 15 lines
drivers/video/exynos_fb.c +11 -0
@@ -64,6 +68,29 @@ static void exynos_lcd_init(vidinfo_t *vid)
 	exynos_fimd_lcd_init(vid);
 }
 
+static void draw_logo(void)
+{
+	int x, y;
+	bmp_image_t *bmp;
+	ulong addr, len;
+	unsigned int logo_width, logo_height;
+
+	logo_width = panel_info.logo_width;
+	logo_height = panel_info.logo_height;
+	x = ((panel_width - logo_width) >> 1);
+	y = ((panel_height - logo_height) >> 1) - 4;

drivers/video/exynos_fb.c static void exynos_lcd_init(vidinfo_t *vid) · line 91

Quoted 10 lines
drivers/video/exynos_fb.c +10 -0
+
+	addr = (ulong)logo;
+	bmp = (bmp_image_t *)addr;
+
+	if (!((bmp->header.signature[0] =='B') &&
+		      (bmp->header.signature[1] =='M'))) {
+			addr = (ulong)gunzip_bmp(addr, &len);
+	}
+
+	lcd_display_bitmap((ulong)addr, x, y);

Here freeing the buffer allocated by gunzip_bmp() is needed. But I think that we should better use bmp_display((ulong)addr, x, y) here to reuse the existing code. I've sent a patch [1] making bmp_display() non static, so please use bmp_display() here.

Thanks,
Anatolij

[1] http://patchwork.ozlabs.org/patch/155490/