From patchwork Wed Nov 24 16:26:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1559169 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IJn5roaW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hzmf34nQ9z9s5P for ; Thu, 25 Nov 2021 03:28:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6C00B83679; Wed, 24 Nov 2021 17:28:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="IJn5roaW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E5CB836BD; Wed, 24 Nov 2021 17:27:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F2016836C9 for ; Wed, 24 Nov 2021 17:27:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x330.google.com with SMTP id a23-20020a9d4717000000b0056c15d6d0caso5048295otf.12 for ; Wed, 24 Nov 2021 08:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lUY4JUA1LVxOYi+gsC69ekVy8fzDlN4EpGQLl0je+rc=; b=IJn5roaWLlVmQoKCS8mHaL/++QNNlkEcVVGMsAGHRWpfh9v0iDGPann3bWUvwugmz5 9PnMFa7hhsEL1/++s6ym0Z3K+iQLraPkgyPPFPPvgdPNqwXynKZz8760kS0PF1E1Xqzt UOKGgFPU93UF5bx8X+NaIT7pVBo+ETj99Er3g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lUY4JUA1LVxOYi+gsC69ekVy8fzDlN4EpGQLl0je+rc=; b=bHckPNSaf7CBpgeuI3/Ou+Y9nve4LzBArrmFqhPAVWRIygEwLzzogh0yQcCrU+TZQU J+lWdKu3AZwe94Mm4B/MhB1zngQUDDp1DEaY2sSMv91rvATqQcq4HlcWFwv4VSF40uc9 tEPi/5D+gB+QDOZwTSn7xL/FAG8sZaDACCXzZ3JdwIB4e0oUvBmYPicSL53vMTu14K5r NCzwAbZsu/QTPc1h0Bu5n+qpZRludCxsQwu5Au3kbRkwXCshYJm7Dqrq0nCj4s9h2r9/ af9WASLp1PPg5ds6ykdiCdzvOAdrbY8RU5moy6hehj84nnlsDijk17unxBh9HpUqiFus MXxQ== X-Gm-Message-State: AOAM533vAHbpDpeW6k83smJbQH6bTf2PEzU3houqQ5mpIdjHCCtgaTuv Q+faIrscJryYqH5jiB07MXHAxwxPrBx2aw== X-Google-Smtp-Source: ABdhPJwN1NSiXGTNi+T9WS+T++w/ltAQHg09i+ZumFcb4tpid6IYldi1h4r4+d6XbS52ilwPH6hTIA== X-Received: by 2002:a05:6830:2a8f:: with SMTP id s15mr14539125otu.33.1637771226147; Wed, 24 Nov 2021 08:27:06 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id w10sm43068ott.46.2021.11.24.08.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 08:27:05 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass , Anatolij Gustschin , =?utf-8?q?Marek_Beh=C3=BAn?= , Mario Six , Patrick Delaunay , Priyanka Jain , Rasmus Villemoes , Stefan Roese Subject: [PATCH v2 05/11] sandbox: video: Drop CONFIG_LCD_BMP_RLE8 Date: Wed, 24 Nov 2021 09:26:43 -0700 Message-Id: <20211124162649.846156-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211124162649.846156-1-sjg@chromium.org> References: <20211124162649.846156-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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.2 at phobos.denx.de X-Virus-Status: Clean This is not defined by any board except sandbox. Even sandbox doesn't actually use it since it has migrated to DM_VIDEO. Drop this option. Remove the dead code also, for completeness, even though the whole lcd.c file will be dropped soon. Signed-off-by: Simon Glass --- (no changes since v1) README | 4 - common/lcd.c | 142 ----------------------------------- include/configs/sandbox.h | 3 - scripts/config_whitelist.txt | 1 - 4 files changed, 150 deletions(-) diff --git a/README b/README index a324f82c44c..7b03cf28c99 100644 --- a/README +++ b/README @@ -1181,10 +1181,6 @@ The following options need to be configured: If CONFIG_LCD_ROTATION is not defined, the console will be initialized with 0degree rotation. - CONFIG_LCD_BMP_RLE8 - - Support drawing of RLE8-compressed bitmaps on the LCD. - - MII/PHY support: CONFIG_PHY_CLOCK_FREQ (ppc4xx) diff --git a/common/lcd.c b/common/lcd.c index 16a0a7cea8f..02973721051 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -399,135 +399,6 @@ static void splash_align_axis(int *axis, unsigned long panel_size, } #endif -#ifdef CONFIG_LCD_BMP_RLE8 -#define BMP_RLE8_ESCAPE 0 -#define BMP_RLE8_EOL 0 -#define BMP_RLE8_EOBMP 1 -#define BMP_RLE8_DELTA 2 - -static void draw_unencoded_bitmap(ushort **fbp, uchar *bmap, ushort *cmap, - int cnt) -{ - while (cnt > 0) { - *(*fbp)++ = cmap[*bmap++]; - cnt--; - } -} - -static void draw_encoded_bitmap(ushort **fbp, ushort c, int cnt) -{ - ushort *fb = *fbp; - int cnt_8copy = cnt >> 3; - - cnt -= cnt_8copy << 3; - while (cnt_8copy > 0) { - *fb++ = c; - *fb++ = c; - *fb++ = c; - *fb++ = c; - *fb++ = c; - *fb++ = c; - *fb++ = c; - *fb++ = c; - cnt_8copy--; - } - while (cnt > 0) { - *fb++ = c; - cnt--; - } - *fbp = fb; -} - -/* - * Do not call this function directly, must be called from lcd_display_bitmap. - */ -static void lcd_display_rle8_bitmap(struct bmp_image *bmp, ushort *cmap, - uchar *fb, int x_off, int y_off) -{ - uchar *bmap; - ulong width, height; - ulong cnt, runlen; - int x, y; - int decode = 1; - - width = get_unaligned_le32(&bmp->header.width); - height = get_unaligned_le32(&bmp->header.height); - bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset); - - x = 0; - y = height - 1; - - while (decode) { - if (bmap[0] == BMP_RLE8_ESCAPE) { - switch (bmap[1]) { - case BMP_RLE8_EOL: - /* end of line */ - bmap += 2; - x = 0; - y--; - /* 16bpix, 2-byte per pixel, width should *2 */ - fb -= (width * 2 + lcd_line_length); - break; - case BMP_RLE8_EOBMP: - /* end of bitmap */ - decode = 0; - break; - case BMP_RLE8_DELTA: - /* delta run */ - x += bmap[2]; - y -= bmap[3]; - /* 16bpix, 2-byte per pixel, x should *2 */ - fb = (uchar *) (lcd_base + (y + y_off - 1) - * lcd_line_length + (x + x_off) * 2); - bmap += 4; - break; - default: - /* unencoded run */ - runlen = bmap[1]; - bmap += 2; - if (y < height) { - if (x < width) { - if (x + runlen > width) - cnt = width - x; - else - cnt = runlen; - draw_unencoded_bitmap( - (ushort **)&fb, - bmap, cmap, cnt); - } - x += runlen; - } - bmap += runlen; - if (runlen & 1) - bmap++; - } - } else { - /* encoded run */ - if (y < height) { - runlen = bmap[0]; - if (x < width) { - /* aggregate the same code */ - while (bmap[0] == 0xff && - bmap[2] != BMP_RLE8_ESCAPE && - bmap[1] == bmap[3]) { - runlen += bmap[2]; - bmap += 2; - } - if (x + runlen > width) - cnt = width - x; - else - cnt = runlen; - draw_encoded_bitmap((ushort **)&fb, - cmap[bmap[1]], cnt); - } - x += runlen; - } - bmap += 2; - } - } -} -#endif - __weak void fb_put_byte(uchar **fb, uchar **from) { *(*fb)++ = *(*from)++; @@ -633,19 +504,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) case 1: case 8: { cmap_base = configuration_get_cmap(); -#ifdef CONFIG_LCD_BMP_RLE8 - u32 compression = get_unaligned_le32(&bmp->header.compression); - debug("compressed %d %d\n", compression, BMP_BI_RLE8); - if (compression == BMP_BI_RLE8) { - if (bpix != 16) { - /* TODO implement render code for bpix != 16 */ - printf("Error: only support 16 bpix"); - return 1; - } - lcd_display_rle8_bitmap(bmp, cmap_base, fb, x, y); - break; - } -#endif if (bpix != 16) byte_width = width; diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index d1e47ed0b61..53dc696e689 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -40,9 +40,6 @@ /* LCD and keyboard require SDL support */ #ifdef CONFIG_SANDBOX_SDL -#define LCD_BPP LCD_COLOR16 -#define CONFIG_LCD_BMP_RLE8 - #define CONFIG_KEYBOARD #endif diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 72391d4c456..cca9f074868 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -697,7 +697,6 @@ CONFIG_LAYERSCAPE_NS_ACCESS CONFIG_LBA48 CONFIG_LBDAF CONFIG_LCD_ALIGNMENT -CONFIG_LCD_BMP_RLE8 CONFIG_LCD_DT_SIMPLEFB CONFIG_LCD_INFO CONFIG_LCD_INFO_BELOW_LOGO