* [PATCH] video: vidconsole: avoid multiple lines overwrite logo
@ 2020-06-10 9:52 Ye Li
2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Ye Li @ 2020-06-10 9:52 UTC (permalink / raw)
To: u-boot
Fix the bug that multiple lines wraps to overwrite logo bmp
display.
Signed-off-by: Ye Li <ye.li@nxp.com>
---
drivers/video/vidconsole-uclass.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index d30e6db..9b76154 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -622,6 +622,7 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
col *= priv->x_charsize;
row *= priv->y_charsize;
priv->xcur_frac = VID_TO_POS(min_t(short, col, vid_priv->xsize - 1));
+ priv->xstart_frac = priv->xcur_frac;
priv->ycur = min_t(short, row, vid_priv->ysize - 1);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH] splash: Fix build warning on 64 bits CPU 2020-06-10 9:52 [PATCH] video: vidconsole: avoid multiple lines overwrite logo Ye Li @ 2020-06-10 9:52 ` Ye Li 2020-06-17 7:09 ` Jagan Teki 2020-06-29 7:05 ` Anatolij Gustschin 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li ` (2 subsequent siblings) 3 siblings, 2 replies; 12+ messages in thread From: Ye Li @ 2020-06-10 9:52 UTC (permalink / raw) To: u-boot Get below warning on ARM64 platform, because the bmp_load_addr is defined to u32. common/splash.c: In function ?splash_video_logo_load?: common/splash.c:74:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 74 | memcpy((void *)bmp_load_addr, bmp_logo_bitmap, Signed-off-by: Ye Li <ye.li@nxp.com> --- common/splash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/splash.c b/common/splash.c index e7d8477..2b9313e 100644 --- a/common/splash.c +++ b/common/splash.c @@ -59,7 +59,7 @@ static struct splash_location default_splash_locations[] = { static int splash_video_logo_load(void) { char *splashimage; - u32 bmp_load_addr; + ulong bmp_load_addr; splashimage = env_get("splashimage"); if (!splashimage) -- 2.7.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] splash: Fix build warning on 64 bits CPU 2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li @ 2020-06-17 7:09 ` Jagan Teki 2020-06-29 7:05 ` Anatolij Gustschin 1 sibling, 0 replies; 12+ messages in thread From: Jagan Teki @ 2020-06-17 7:09 UTC (permalink / raw) To: u-boot On Wed, Jun 10, 2020 at 3:23 PM Ye Li <ye.li@nxp.com> wrote: > > Get below warning on ARM64 platform, because the bmp_load_addr > is defined to u32. > > common/splash.c: In function ?splash_video_logo_load?: > common/splash.c:74:9: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] > 74 | memcpy((void *)bmp_load_addr, bmp_logo_bitmap, > > Signed-off-by: Ye Li <ye.li@nxp.com> > --- Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # bpi-m1+, bpi-m64 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] splash: Fix build warning on 64 bits CPU 2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li 2020-06-17 7:09 ` Jagan Teki @ 2020-06-29 7:05 ` Anatolij Gustschin 1 sibling, 0 replies; 12+ messages in thread From: Anatolij Gustschin @ 2020-06-29 7:05 UTC (permalink / raw) To: u-boot On Wed, 10 Jun 2020 02:52:22 -0700 Ye Li ye.li at nxp.com wrote: > Get below warning on ARM64 platform, because the bmp_load_addr > is defined to u32. > > common/splash.c: In function ?splash_video_logo_load?: > common/splash.c:74:9: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] > 74 | memcpy((void *)bmp_load_addr, bmp_logo_bitmap, > > Signed-off-by: Ye Li <ye.li@nxp.com> > --- > common/splash.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to u-boot-video/master, thanks! -- Anatolij ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display 2020-06-10 9:52 [PATCH] video: vidconsole: avoid multiple lines overwrite logo Ye Li 2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li @ 2020-06-10 9:52 ` Ye Li 2020-06-17 7:10 ` Jagan Teki ` (2 more replies) 2020-06-17 7:11 ` [PATCH] video: vidconsole: avoid multiple lines overwrite logo Jagan Teki 2020-06-29 7:04 ` Anatolij Gustschin 3 siblings, 3 replies; 12+ messages in thread From: Ye Li @ 2020-06-10 9:52 UTC (permalink / raw) To: u-boot Update video bmp codes to support 8 bits BMP to 32 bits conversion so that we can display 8 bits logo on 24 bits or 32 bits display Signed-off-by: Ye Li <ye.li@nxp.com> --- drivers/video/video_bmp.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index eb96365..283e699 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -233,6 +233,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, */ if (bpix != bmp_bpix && !(bmp_bpix == 8 && bpix == 16) && + !(bmp_bpix == 8 && bpix == 24) && + !(bmp_bpix == 8 && bpix == 32) && !(bmp_bpix == 24 && bpix == 16) && !(bmp_bpix == 24 && bpix == 32)) { printf("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", @@ -265,6 +267,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, switch (bmp_bpix) { case 1: case 8: { + struct bmp_color_table_entry *cte; cmap_base = priv->cmap; #ifdef CONFIG_VIDEO_BMP_RLE8 u32 compression = get_unaligned_le32(&bmp->header.compression); @@ -281,20 +284,39 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, } #endif - if (bpix != 16) + if (bpix == 8) byte_width = width; - else + else if (bpix == 16) byte_width = width * 2; + else if (bpix == 24) + byte_width = width * 3; + else /* 32 */ + byte_width = width * 4; for (i = 0; i < height; ++i) { WATCHDOG_RESET(); for (j = 0; j < width; j++) { - if (bpix != 16) { + if (bpix == 8) { fb_put_byte(&fb, &bmap); - } else { + } else if (bpix == 16) { *(uint16_t *)fb = cmap_base[*bmap]; bmap++; fb += sizeof(uint16_t) / sizeof(*fb); + } else if (bpix == 24) { + /* Only support big endian */ + cte = &palette[*bmap]; + bmap++; + *(fb++) = cte->red; + *(fb++) = cte->green; + *(fb++) = cte->blue; + } else if (bpix == 32) { + /* Only support big endian */ + cte = &palette[*bmap]; + bmap++; + *(fb++) = cte->blue; + *(fb++) = cte->green; + *(fb++) = cte->red; + *(fb++) = 0; } } bmap += (padded_width - width); -- 2.7.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li @ 2020-06-17 7:10 ` Jagan Teki 2020-06-18 21:04 ` Fabio Estevam 2020-06-27 22:59 ` [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer Anatolij Gustschin 2 siblings, 0 replies; 12+ messages in thread From: Jagan Teki @ 2020-06-17 7:10 UTC (permalink / raw) To: u-boot On Wed, Jun 10, 2020 at 3:23 PM Ye Li <ye.li@nxp.com> wrote: > > Update video bmp codes to support 8 bits BMP to 32 bits conversion > so that we can display 8 bits logo on 24 bits or 32 bits display > > Signed-off-by: Ye Li <ye.li@nxp.com> > --- Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # bpi-m1+, bpi-m64 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li 2020-06-17 7:10 ` Jagan Teki @ 2020-06-18 21:04 ` Fabio Estevam 2020-06-23 11:51 ` Anatolij Gustschin 2020-06-27 22:59 ` [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer Anatolij Gustschin 2 siblings, 1 reply; 12+ messages in thread From: Fabio Estevam @ 2020-06-18 21:04 UTC (permalink / raw) To: u-boot Hi Anatolij, On Wed, Jun 10, 2020 at 6:53 AM Ye Li <ye.li@nxp.com> wrote: > > Update video bmp codes to support 8 bits BMP to 32 bits conversion > so that we can display 8 bits logo on 24 bits or 32 bits display > > Signed-off-by: Ye Li <ye.li@nxp.com> I haven't had a chance to test this yet, but it seems to solve an outstanding splash screen issue on mx6ul evk/mx7d sabresd boards. Maybe we should get this one and the other two from Ye Li to 2020.07? Thanks ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display 2020-06-18 21:04 ` Fabio Estevam @ 2020-06-23 11:51 ` Anatolij Gustschin 0 siblings, 0 replies; 12+ messages in thread From: Anatolij Gustschin @ 2020-06-23 11:51 UTC (permalink / raw) To: u-boot Hi Fabio, On Thu, 18 Jun 2020 18:04:40 -0300 Fabio Estevam festevam at gmail.com wrote: > Hi Anatolij, > > On Wed, Jun 10, 2020 at 6:53 AM Ye Li <ye.li@nxp.com> wrote: > > > > Update video bmp codes to support 8 bits BMP to 32 bits conversion > > so that we can display 8 bits logo on 24 bits or 32 bits display > > > > Signed-off-by: Ye Li <ye.li@nxp.com> > > I haven't had a chance to test this yet, but it seems to solve an > outstanding splash screen issue on mx6ul evk/mx7d sabresd boards. > > Maybe we should get this one and the other two from Ye Li to 2020.07? yes, we need a fix for the release, I will look later this week which patch should be merged (we have another older patch addressing this issue). -- Anatolij ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li 2020-06-17 7:10 ` Jagan Teki 2020-06-18 21:04 ` Fabio Estevam @ 2020-06-27 22:59 ` Anatolij Gustschin 2020-06-29 7:04 ` Anatolij Gustschin 2 siblings, 1 reply; 12+ messages in thread From: Anatolij Gustschin @ 2020-06-27 22:59 UTC (permalink / raw) To: u-boot From: Ye Li <ye.li@nxp.com> Update video bmp code so that we can display 8 bits logo on 24 or 32 bpp framebuffer. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # bpi-m1+, bpi-m64 --- Changes in v2: - reduce code - update commit message drivers/video/video_bmp.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index eb9636541d..7d7f37b445 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -233,6 +233,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, */ if (bpix != bmp_bpix && !(bmp_bpix == 8 && bpix == 16) && + !(bmp_bpix == 8 && bpix == 24) && + !(bmp_bpix == 8 && bpix == 32) && !(bmp_bpix == 24 && bpix == 16) && !(bmp_bpix == 24 && bpix == 32)) { printf("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", @@ -265,6 +267,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, switch (bmp_bpix) { case 1: case 8: { + struct bmp_color_table_entry *cte; cmap_base = priv->cmap; #ifdef CONFIG_VIDEO_BMP_RLE8 u32 compression = get_unaligned_le32(&bmp->header.compression); @@ -280,21 +283,33 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, break; } #endif - - if (bpix != 16) + byte_width = width * (bpix / 8); + if (!byte_width) byte_width = width; - else - byte_width = width * 2; for (i = 0; i < height; ++i) { WATCHDOG_RESET(); for (j = 0; j < width; j++) { - if (bpix != 16) { + if (bpix == 8) { fb_put_byte(&fb, &bmap); - } else { + } else if (bpix == 16) { *(uint16_t *)fb = cmap_base[*bmap]; bmap++; fb += sizeof(uint16_t) / sizeof(*fb); + } else { + /* Only support big endian */ + cte = &palette[*bmap]; + bmap++; + if (bpix == 24) { + *(fb++) = cte->red; + *(fb++) = cte->green; + *(fb++) = cte->blue; + } else { + *(fb++) = cte->blue; + *(fb++) = cte->green; + *(fb++) = cte->red; + *(fb++) = 0; + } } } bmap += (padded_width - width); -- 2.17.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer 2020-06-27 22:59 ` [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer Anatolij Gustschin @ 2020-06-29 7:04 ` Anatolij Gustschin 0 siblings, 0 replies; 12+ messages in thread From: Anatolij Gustschin @ 2020-06-29 7:04 UTC (permalink / raw) To: u-boot On Sun, 28 Jun 2020 00:59:44 +0200 Anatolij Gustschin agust at denx.de wrote: ... > Changes in v2: > - reduce code > - update commit message > > drivers/video/video_bmp.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) Applied to u-boot-video/master, thanks! -- Anatolij ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] video: vidconsole: avoid multiple lines overwrite logo 2020-06-10 9:52 [PATCH] video: vidconsole: avoid multiple lines overwrite logo Ye Li 2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li @ 2020-06-17 7:11 ` Jagan Teki 2020-06-29 7:04 ` Anatolij Gustschin 3 siblings, 0 replies; 12+ messages in thread From: Jagan Teki @ 2020-06-17 7:11 UTC (permalink / raw) To: u-boot On Wed, Jun 10, 2020 at 3:22 PM Ye Li <ye.li@nxp.com> wrote: > > Fix the bug that multiple lines wraps to overwrite logo bmp > display. > > Signed-off-by: Ye Li <ye.li@nxp.com> > --- Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # bpi-m1+, bpi-m64 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] video: vidconsole: avoid multiple lines overwrite logo 2020-06-10 9:52 [PATCH] video: vidconsole: avoid multiple lines overwrite logo Ye Li ` (2 preceding siblings ...) 2020-06-17 7:11 ` [PATCH] video: vidconsole: avoid multiple lines overwrite logo Jagan Teki @ 2020-06-29 7:04 ` Anatolij Gustschin 3 siblings, 0 replies; 12+ messages in thread From: Anatolij Gustschin @ 2020-06-29 7:04 UTC (permalink / raw) To: u-boot On Wed, 10 Jun 2020 02:52:21 -0700 Ye Li ye.li at nxp.com wrote: > Fix the bug that multiple lines wraps to overwrite logo bmp > display. > > Signed-off-by: Ye Li <ye.li@nxp.com> > --- > drivers/video/vidconsole-uclass.c | 1 + > 1 file changed, 1 insertion(+) Applied to u-boot-video/master, thanks! -- Anatolij ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-06-29 7:05 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-06-10 9:52 [PATCH] video: vidconsole: avoid multiple lines overwrite logo Ye Li 2020-06-10 9:52 ` [PATCH] splash: Fix build warning on 64 bits CPU Ye Li 2020-06-17 7:09 ` Jagan Teki 2020-06-29 7:05 ` Anatolij Gustschin 2020-06-10 9:52 ` [PATCH] video: bmp: Support 8bits BMP to 24/32 bits display Ye Li 2020-06-17 7:10 ` Jagan Teki 2020-06-18 21:04 ` Fabio Estevam 2020-06-23 11:51 ` Anatolij Gustschin 2020-06-27 22:59 ` [PATCH v2] video: bmp: support 8bits BMP drawing on 24/32 bpp framebuffer Anatolij Gustschin 2020-06-29 7:04 ` Anatolij Gustschin 2020-06-17 7:11 ` [PATCH] video: vidconsole: avoid multiple lines overwrite logo Jagan Teki 2020-06-29 7:04 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox