All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Anatolij Gustschin <agust@denx.de>, Tom Rini <trini@konsulko.com>,
	Simon Glass <sjg@chromium.org>
Subject: [PATCH 12/23] video: Drop the uclass colour map
Date: Fri, 19 Nov 2021 13:23:56 -0700	[thread overview]
Message-ID: <20211119202408.1815506-13-sjg@chromium.org> (raw)
In-Reply-To: <20211119202408.1815506-1-sjg@chromium.org>

We don't need this anymore since we use the BMP palette directly. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 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


  parent reply	other threads:[~2021-11-19 20:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 20:23 [PATCH 00/23] video: Support a U-Boot logo more easily Simon Glass
2021-11-19 20:23 ` [PATCH 01/23] sandbox: video: Support 8bpp depth Simon Glass
2021-11-19 20:23 ` [PATCH 02/23] video: sandbox: Avoid duplicate display windows Simon Glass
2021-11-19 20:23 ` [PATCH 03/23] console: Avoid serial output before the console is running Simon Glass
2021-11-19 20:23 ` [PATCH 04/23] video: sandbox: Set a maximum frame-buffer size Simon Glass
2021-11-19 20:23 ` [PATCH 05/23] sandbox: video: Correct the address of the copy base Simon Glass
2021-11-19 20:23 ` [PATCH 06/23] sandbox: video: Add BMP tests for 32bpp and 8bpp modes Simon Glass
2021-11-19 20:23 ` [PATCH 07/23] video: Expand video debugging buffer size Simon Glass
2021-11-19 20:23 ` [PATCH 08/23] sandbox: Enable support for the gzip command Simon Glass
2021-11-19 20:23 ` [PATCH 09/23] video: Drop fb_put_byte() el at Simon Glass
2021-11-19 20:23 ` [PATCH 10/23] video: Move BMP pixel-writing into a function Simon Glass
2021-11-19 20:23 ` [PATCH 11/23] video: bmp: Update RLE8 support to use the write function Simon Glass
2021-11-19 20:23 ` Simon Glass [this message]
2021-11-19 20:23 ` [PATCH 13/23] video: Tidy up 24/32 BMP blitting Simon Glass
2021-11-19 20:23 ` [PATCH 14/23] video: Add a test for 16bpp BMP files Simon Glass
2021-11-19 20:23 ` [PATCH 15/23] video: theadorable: Use RGB565 for BMP blitting Simon Glass
2021-11-19 20:24 ` [PATCH 16/23] video: Drop #ifdefs from video_bmp Simon Glass
2021-11-19 20:24 ` [PATCH 17/23] video: Convert CONFIG_VIDEO_LOGO to Kconfig Simon Glass
2022-01-22 13:26   ` Pali Rohár
2022-01-22 15:29     ` Tom Rini
2022-01-22 15:41       ` Pali Rohár
2022-01-22 18:41         ` Tom Rini
2022-01-23 14:48           ` Pali Rohár
2022-01-23 14:54             ` Tom Rini
2022-01-23 15:11               ` Pali Rohár
2022-01-23 16:14                 ` Tom Rini
2022-01-24  9:39                 ` Merlijn Wajer
2022-01-24 14:42                   ` Tom Rini
2022-01-22 17:17     ` Simon Glass
2021-11-19 20:24 ` [PATCH 18/23] video: Drop VIDEO_LOGO from cfb_console Simon Glass
2021-11-19 20:24 ` [PATCH 19/23] video: Support showing the U-Boot logo Simon Glass
2022-03-15 16:13   ` Tim Harvey
2022-03-28  6:35     ` Simon Glass
2022-03-28 18:50       ` Tim Harvey
2022-03-28 19:00         ` Fabio Estevam
2021-11-19 20:24 ` [PATCH 20/23] video: Show the U-Boot logo by default Simon Glass
2021-11-19 20:24 ` [PATCH 21/23] video: Support virtio devices with the splash screen Simon Glass
2021-11-23  2:08   ` Jaehoon Chung
2021-11-23  3:02     ` Peng Fan (OSS)
2021-11-19 20:24 ` [PATCH 22/23] x86: coreboot: Support getting a logo from virtio Simon Glass
2021-11-19 20:24 ` [PATCH 23/23] x86: coreboot: Add a sample script to build a qemu image Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119202408.1815506-13-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=agust@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.