From patchwork Mon Apr 30 11:55:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donghwa Lee X-Patchwork-Id: 155843 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 94A75B6F9A for ; Mon, 30 Apr 2012 21:56:10 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 35BB12818A; Mon, 30 Apr 2012 13:56:07 +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 mbOhcTiZpa3e; Mon, 30 Apr 2012 13:56:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B71912818E; Mon, 30 Apr 2012 13:56:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2661828187 for ; Mon, 30 Apr 2012 13:56:01 +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 moLuYALVSboE for ; Mon, 30 Apr 2012 13:55:49 +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 97FA5281A4 for ; Mon, 30 Apr 2012 13:55:42 +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 <0M3A007B5JSINHE0@mailout1.samsung.com> for u-boot@lists.denx.de; Mon, 30 Apr 2012 20:55:36 +0900 (KST) X-AuditID: cbfee61a-b7bfeae0000070f7-97-4f9e7db8799e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 11.50.28919.8BD7E9F4; Mon, 30 Apr 2012 20:55:36 +0900 (KST) Received: from [165.213.219.92] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M3A008IXJSOBV50@mmp2.samsung.com> for u-boot@lists.denx.de; Mon, 30 Apr 2012 20:55:36 +0900 (KST) Message-id: <4F9E7DB7.30609@samsung.com> Date: Mon, 30 Apr 2012 20:55:35 +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, Wolfgang Denk , mk7.kang@samsung.com, Anatolij Gustschin , Donghwa Lee , Kyungmin Park X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No Subject: [U-Boot] [PATCH v 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(). Signed-off-by: Donghwa Lee Signed-off-by: Kyungmin Park --- Changes for 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. Changes for v2: - move fb_rgb_mode_t variable to include/lcd.h - some bug fixes. - define CONFIG_TIZEN - use bmp_display() common display function board/samsung/trats/trats.c | 2 ++ drivers/video/exynos_fb.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/video/exynos_fb.h | 7 ------- drivers/video/exynos_fimd.c | 2 +- include/configs/trats.h | 6 +++++- include/lcd.h | 9 +++++++++ 6 files changed, 53 insertions(+), 9 deletions(-) diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index 084b67a..6ae15b7 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -489,6 +489,8 @@ vidinfo_t panel_info = { .reset_delay = 0, .interface_mode = FIMD_RGB_INTERFACE, .mipi_enabled = 1, + .logo_on = 1, + .rgb_mode = MODE_BGR_P, }; void init_panel_info(vidinfo_t *vid) diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c index 96a8ec1..009533e 100644 --- a/drivers/video/exynos_fb.c +++ b/drivers/video/exynos_fb.c @@ -32,6 +32,9 @@ #include "exynos_fb.h" +#ifdef CONFIG_TIZEN +#include +#endif int lcd_line_length; int lcd_color_fg; int lcd_color_bg; @@ -64,6 +67,31 @@ static void exynos_lcd_init(vidinfo_t *vid) exynos_fimd_lcd_init(vid); } +#ifdef CONFIG_TIZEN +static void draw_tizen_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 - get_tizen_logo_width()) >> 1); + y = ((panel_height - get_tizen_logo_height()) >> 1) - 4; + + addr = (ulong)get_tizen_logo_data(); + bmp = (bmp_image_t *)addr; + + if (!((bmp->header.signature[0]=='B') && + (bmp->header.signature[1]=='M'))) { + addr = (ulong)gunzip_bmp(addr, &len); + } + + bmp_display((ulong)addr, x, y); +} +#endif + static void lcd_panel_on(vidinfo_t *vid) { udelay(vid->init_delay); @@ -115,6 +143,14 @@ void lcd_ctrl_init(void *lcdbase) void lcd_enable(void) { + if (panel_info.logo_on) { + memset(lcd_base, 0, panel_width * panel_height * + (NBITS(panel_info.vl_bpix) >> 3)); +#ifdef CONFIG_TIZEN + draw_tizen_logo(); +#endif + } + 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..2f96a18 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -34,6 +34,7 @@ #define CONFIG_S5P /* which is in a S5P Family */ #define CONFIG_EXYNOS4210 /* which is in a EXYNOS4210 */ #define CONFIG_TRATS /* working with TRATS */ +#define CONFIG_TIZEN /* TIZEN lib */ #include /* get chip and board defs */ @@ -216,9 +217,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..075ebad 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -190,6 +190,13 @@ enum { FIMD_CPU_INTERFACE = 2, }; +enum exynos_fb_rgb_mode_t { + MODE_RGB_P = 0, + MODE_BGR_P = 1, + MODE_RGB_S = 2, + MODE_BGR_S = 3, +}; + typedef struct vidinfo { ushort vl_col; /* Number of columns (i.e. 640) */ ushort vl_row; /* Number of rows (i.e. 480) */ @@ -235,6 +242,8 @@ typedef struct vidinfo { unsigned int wr_setup; unsigned int wr_act; unsigned int wr_hold; + unsigned int logo_on; + unsigned int rgb_mode; /* parent clock name(MPLL, EPLL or VPLL) */ unsigned int pclk_name;