From patchwork Thu Apr 26 08:21:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donghwa Lee X-Patchwork-Id: 155187 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2D21DB6FA5 for ; Thu, 26 Apr 2012 18:22:16 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 43ACB28162; Thu, 26 Apr 2012 10:22:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sfEs2S8SoRR7; Thu, 26 Apr 2012 10:22:13 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A14EE281EE; Thu, 26 Apr 2012 10:22:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 48ABA28148 for ; Thu, 26 Apr 2012 10:21:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iWd-lwBL2Jhe for ; Thu, 26 Apr 2012 10:21:31 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by theia.denx.de (Postfix) with ESMTP id 6BEAF28334 for ; Thu, 26 Apr 2012 10:21:27 +0200 (CEST) Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M32002Z9V39AY60@mailout1.samsung.com> for u-boot@lists.denx.de; Thu, 26 Apr 2012 17:21:23 +0900 (KST) X-AuditID: cbfee61a-b7b8eae00000534b-13-4f990583a4d9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id EA.22.21323.385099F4; Thu, 26 Apr 2012 17:21:23 +0900 (KST) Received: from [165.213.219.92] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M32004SKV7N53C0@mmp1.samsung.com> for u-boot@lists.denx.de; Thu, 26 Apr 2012 17:21:23 +0900 (KST) Message-id: <4F990583.6090905@samsung.com> Date: Thu, 26 Apr 2012 17:21:23 +0900 From: Donghwa Lee User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-version: 1.0 To: u-boot@lists.denx.de, mk7.kang@samsung.com, Anatolij Gustschin , Kyungmin Park , Donghwa Lee X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No Subject: [U-Boot] [PATCH v2 3/3] EXYNOS: display 32bpp bitmap TIZEN logo X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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. Signed-off-by: Donghwa Lee Signed-off-by: Kyungmin Park --- 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(-) diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index 084b67a..9d75b8f 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -37,6 +37,7 @@ #include #include #include +#include #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) diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c index 96a8ec1..f669b65 100644 --- a/drivers/video/exynos_fb.c +++ b/drivers/video/exynos_fb.c @@ -32,6 +32,10 @@ #include "exynos_fb.h" +#ifdef CONFIG_TRATS +#include +#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); } diff --git a/drivers/video/exynos_fb.h b/drivers/video/exynos_fb.h index 66f5da6..4ff2efd 100644 --- a/drivers/video/exynos_fb.h +++ b/drivers/video/exynos_fb.h @@ -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, diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c index 6416b90..f07568a 100644 --- a/drivers/video/exynos_fimd.c +++ b/drivers/video/exynos_fimd.c @@ -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; diff --git a/include/configs/trats.h b/include/configs/trats.h index 5f913ca..e611ace 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -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 */ diff --git a/include/lcd.h b/include/lcd.h index 3d9ef16..5d09696 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -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;