From patchwork Mon Apr 10 07:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikhil Jain X-Patchwork-Id: 1767077 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=CHp9xgFa; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Pw0yt140Xz1yXv for ; Mon, 10 Apr 2023 17:31:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B93AF85E34; Mon, 10 Apr 2023 09:31:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="CHp9xgFa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 27199857D2; Mon, 10 Apr 2023 09:29:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8B6F685BD0 for ; Mon, 10 Apr 2023 09:29:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-jain1@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33A7T6In093760; Mon, 10 Apr 2023 02:29:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681111746; bh=K2UdtjnsPJRndLDSu+4dkGYVi7bRfoZ8I9zIjDD5uW4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CHp9xgFa79ICJSLp3by3JPJB/U2iaFfBWpJkIxalUpmhxQfv6VpBRZKcFfAQm1/47 w5B75VBv5NVnKUG51iCUZqLathI5IcE+ez5IV9OJKYINI1QANYHJEZTJuWphVmNrEO 59Ua2NpPALowEeRwYD1JXP0eu74pfddQ+uTPwJj4= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33A7T6pa030643 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Apr 2023 02:29:06 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 10 Apr 2023 02:29:05 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Mon, 10 Apr 2023 02:29:05 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33A7T4qw063214; Mon, 10 Apr 2023 02:29:05 -0500 From: Nikhil M Jain To: , , CC: , , , Subject: [PATCH V7 11/14] common: Enable splash functions at SPL Date: Mon, 10 Apr 2023 12:58:40 +0530 Message-ID: <20230410072843.97922-12-n-jain1@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410072843.97922-1-n-jain1@ti.com> References: <20230410072843.97922-1-n-jain1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean To support splash screen at both u-boot proper and SPL use CONFIG_IS_ENABLED and CONFIG_VAL to check for video related Kconfigs at respective stages. Replace CONFIG_CMD_BMP with CONFIG_BMP to enable splash_display function at u-boot proper and SPL. Signed-off-by: Nikhil M Jain Reviewed-by: Devarsh Thakkar Reviewed-by: Simon Glass --- V7: - Add Reviewed-by tag. V6: - Fix commit message. - Add Reviewed-by tag. V5: - Replace CONFIG_CMD_BMP with CONFIG_BMP. V4: - No change V3 (patch introduced): - Enable splash functions at SPL common/bmp.c | 12 ++++++------ common/splash.c | 10 +++++----- include/splash.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/bmp.c b/common/bmp.c index d98ba9d882..51766b3c21 100644 --- a/common/bmp.c +++ b/common/bmp.c @@ -33,7 +33,7 @@ * Returns NULL if decompression failed, or if the decompressed data * didn't contain a valid BMP signature. */ -#ifdef CONFIG_VIDEO_BMP_GZIP +#if CONFIG_IS_ENABLED(VIDEO_BMP_GZIP) struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, void **alloc_addr) { @@ -44,9 +44,9 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, /* * Decompress bmp image */ - len = CONFIG_VIDEO_LOGO_MAX_SIZE; + len = CONFIG_VAL(VIDEO_LOGO_MAX_SIZE); /* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */ - dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3); + dst = malloc(CONFIG_VAL(VIDEO_LOGO_MAX_SIZE) + 3); if (!dst) { puts("Error: malloc in gunzip failed!\n"); return NULL; @@ -55,12 +55,12 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, /* align to 32-bit-aligned-address + 2 */ bmp = dst + 2; - if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), + if (gunzip(bmp, CONFIG_VAL(VIDEO_LOGO_MAX_SIZE), map_sysmem(addr, 0), &len)) { free(dst); return NULL; } - if (len == CONFIG_VIDEO_LOGO_MAX_SIZE) + if (len == CONFIG_VAL(VIDEO_LOGO_MAX_SIZE)) puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n"); /* @@ -115,7 +115,7 @@ int bmp_info(ulong addr) if (bmp_alloc_addr) free(bmp_alloc_addr); - return 0; + return(0); } int bmp_display(ulong addr, int x, int y) diff --git a/common/splash.c b/common/splash.c index 4bc54b1bf9..a4e68b7042 100644 --- a/common/splash.c +++ b/common/splash.c @@ -89,14 +89,14 @@ static inline int splash_video_logo_load(void) { return -ENOSYS; } __weak int splash_screen_prepare(void) { - if (IS_ENABLED(CONFIG_SPLASH_SOURCE)) + if (CONFIG_IS_ENABLED(SPLASH_SOURCE)) return splash_source_load(default_splash_locations, ARRAY_SIZE(default_splash_locations)); return splash_video_logo_load(); } -#ifdef CONFIG_SPLASH_SCREEN_ALIGN +#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) void splash_get_pos(int *x, int *y) { char *s = env_get("splashpos"); @@ -119,7 +119,7 @@ void splash_get_pos(int *x, int *y) } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ -#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION) +#if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION) #ifdef CONFIG_VIDEO_LOGO #include @@ -159,7 +159,7 @@ void splash_display_banner(void) * Common function to show a splash image if env("splashimage") is set. * For additional details please refer to doc/README.splashprepare. */ -#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_CMD_BMP) +#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP) int splash_display(void) { ulong addr; @@ -183,7 +183,7 @@ int splash_display(void) if (x || y) goto end; -#if defined(CONFIG_VIDEO) && !defined(CONFIG_HIDE_LOGO_VERSION) +#if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION) splash_display_banner(); #endif end: diff --git a/include/splash.h b/include/splash.h index 33e45e6941..083c978582 100644 --- a/include/splash.h +++ b/include/splash.h @@ -78,4 +78,4 @@ static inline int splash_display(void) #define BMP_ALIGN_CENTER 0x7FFF -#endif +#endif \ No newline at end of file