From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 243FEC433EF for ; Fri, 19 Nov 2021 20:27:28 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EA47613C8 for ; Fri, 19 Nov 2021 20:27:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8EA47613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 66549837BB; Fri, 19 Nov 2021 21:26:00 +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="atHMhMtR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7503A83420; Fri, 19 Nov 2021 21:25:12 +0100 (CET) Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 E976C83770 for ; Fri, 19 Nov 2021 21:24:31 +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-x32f.google.com with SMTP id u18-20020a9d7212000000b00560cb1dc10bso18403967otj.11 for ; Fri, 19 Nov 2021 12:24:31 -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=AJR4UulDx1e6ESgN59Uf8xYSPfev53+N0LTyjlPXOVM=; b=atHMhMtRYBymakfx2vBEtGKz7EgXQNxmFD2xjxNEyz8ZNuO805qxRWOdM+IFIulStL FW3mIGzS+kaBAvQYqcdaBZLKPI2QTHaF+uvvEY4Dc18D+MylI0IhhS+vh+gI/OlUvLFy h6R6eTKRiYKVRjkZBT0JMqiMtbYjsBbhVWNOw= 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=AJR4UulDx1e6ESgN59Uf8xYSPfev53+N0LTyjlPXOVM=; b=YLm7j/trtkmmx4NxtXtw8UbBYF6Al3k3lMZ0ngc5W2xxpY+Nv9bUU/DJdQBZr1nMus r1L78mPOFs3/lIfYkUVHkdh6jp1upoWj3CxNKs3wRxklLoE6eUNe5PNw1hbkX5NzlelM DqrECsZSB0pN3b7lYT9UvEpsnMaXLVBfJEy4vOAUhYmVSy0wFXhmwpAG2stELwuXg/sq 8jLecMUMcHI5r6OEUAzCAQ3pUzwTFllB1hwTXlHVBMx8xr7B3M+AiMpIhrjtIGw3YRZ/ a+gDp9kzzlXqL/juPTKjPsJPMpRbWIWnVv2wULfeQGLwzpkYsAnhUsF9ZjDIaGyrwN27 Ejcg== X-Gm-Message-State: AOAM533iaRiSqkOSlH4YH+onlpvcPK/CHhOhSfNNTzEQzlcBtvefwe+A qBK2L7+qII9YCENENAR0wvlTiPdlHkgTyw== X-Google-Smtp-Source: ABdhPJye29CSZ+dlSexESUyHVjQkLIQvsdwhjS5y3P01ZEMGmR9TpL4ZY8aBogR7cWiuVVoth6RoWQ== X-Received: by 2002:a9d:64d4:: with SMTP id n20mr6951427otl.328.1637353470352; Fri, 19 Nov 2021 12:24:30 -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 bl33sm197093oib.47.2021.11.19.12.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 12:24:30 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Anatolij Gustschin , Tom Rini , Simon Glass Subject: [PATCH 12/23] video: Drop the uclass colour map Date: Fri, 19 Nov 2021 13:23:56 -0700 Message-Id: <20211119202408.1815506-13-sjg@chromium.org> X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog In-Reply-To: <20211119202408.1815506-1-sjg@chromium.org> References: <20211119202408.1815506-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 We don't need this anymore since we use the BMP palette directly. Drop it. Signed-off-by: Simon Glass --- drivers/video/video-uclass.c | 23 ----------------------- drivers/video/video_bmp.c | 22 ---------------------- include/video.h | 2 -- 3 files changed, 47 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 2435a29b556..fafd05e373f 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -305,27 +305,6 @@ int video_sync_copy_all(struct udevice *dev) #endif -/* Set up the colour map */ -static int video_pre_probe(struct udevice *dev) -{ - struct video_priv *priv = dev_get_uclass_priv(dev); - - priv->cmap = calloc(256, sizeof(ushort)); - if (!priv->cmap) - return -ENOMEM; - - return 0; -} - -static int video_pre_remove(struct udevice *dev) -{ - struct video_priv *priv = dev_get_uclass_priv(dev); - - free(priv->cmap); - - return 0; -} - /* Set up the display ready for use */ static int video_post_probe(struct udevice *dev) { @@ -433,9 +412,7 @@ UCLASS_DRIVER(video) = { .name = "video", .flags = DM_UC_FLAG_SEQ_ALIAS, .post_bind = video_post_bind, - .pre_probe = video_pre_probe, .post_probe = video_post_probe, - .pre_remove = video_pre_remove, .priv_auto = sizeof(struct video_uc_priv), .per_device_auto = sizeof(struct video_priv), .per_device_plat_auto = sizeof(struct video_uc_plat), diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index 2a3536c7907..466c0f54363 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -214,28 +214,10 @@ static void video_splash_align_axis(int *axis, unsigned long panel_size, *axis = max(0, (int)axis_alignment); } -static void video_set_cmap(struct udevice *dev, - struct bmp_color_table_entry *cte, unsigned colours) -{ - struct video_priv *priv = dev_get_uclass_priv(dev); - int i; - ushort *cmap = priv->cmap; - - debug("%s: colours=%d\n", __func__, colours); - for (i = 0; i < colours; ++i) { - *cmap = ((cte->red << 8) & 0xf800) | - ((cte->green << 3) & 0x07e0) | - ((cte->blue >> 3) & 0x001f); - cmap++; - cte++; - } -} - int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, bool align) { struct video_priv *priv = dev_get_uclass_priv(dev); - ushort *cmap_base = NULL; int i, j; uchar *start, *fb; struct bmp_image *bmp = map_sysmem(bmp_image, 0); @@ -291,9 +273,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, debug("Display-bmp: %d x %d with %d colours, display %d\n", (int)width, (int)height, (int)colours, 1 << bpix); - if (bmp_bpix == 8) - video_set_cmap(dev, palette, colours); - padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width); if (align) { @@ -316,7 +295,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, switch (bmp_bpix) { case 1: case 8: { - cmap_base = priv->cmap; #ifdef CONFIG_VIDEO_BMP_RLE8 u32 compression = get_unaligned_le32(&bmp->header.compression); debug("compressed %d %d\n", compression, BMP_BI_RLE8); diff --git a/include/video.h b/include/video.h index f14fb15f84f..6948cdf5796 100644 --- a/include/video.h +++ b/include/video.h @@ -93,7 +93,6 @@ enum video_format { * @colour_bg: Background colour (pixel value) * @flush_dcache: true to enable flushing of the data cache after * the LCD is updated - * @cmap: Colour map for 8-bit-per-pixel displays * @fg_col_idx: Foreground color code (bit 3 = bold, bit 0-2 = color) * @bg_col_idx: Background color code (bit 3 = bold, bit 0-2 = color) */ @@ -118,7 +117,6 @@ struct video_priv { u32 colour_fg; u32 colour_bg; bool flush_dcache; - ushort *cmap; u8 fg_col_idx; u8 bg_col_idx; }; -- 2.34.0.rc2.393.gf8c9666880-goog