All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer
@ 2019-11-20 13:11 Patrice Chotard
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis() Patrice Chotard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Patrice Chotard @ 2019-11-20 13:11 UTC (permalink / raw)
  To: u-boot


This series is fixing 2 issues found when trying to decode BMP
bigger than the framebuffer:
 - Convert panel_picture_delta from unsigned long to long to insure
   to store correctly the difference between panel_size and picture_size
   in case the panel_size is smaller than picture_size.
 - Don't rely on BMP's width and height but in width and height
   value computed by video_bmp_display().


Changes in v2:
     - Convert panel_picture_delta from unsigned long to long

Patrice Chotard (2):
  video: bmp: Fix video_splash_align_axis()
  video: bmp: Fix video_display_rle8_bitmap()

 drivers/video/video_bmp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis()
  2019-11-20 13:11 [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice Chotard
@ 2019-11-20 13:11 ` Patrice Chotard
  2019-12-10 10:21   ` Anatolij Gustschin
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap() Patrice Chotard
  2019-12-02  8:23 ` [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice CHOTARD
  2 siblings, 1 reply; 6+ messages in thread
From: Patrice Chotard @ 2019-11-20 13:11 UTC (permalink / raw)
  To: u-boot

Convert panel_picture_delta from unsigned long to long to insure
to store correctly the difference between panel_size and picture_size
in case the panel_size is smaller than picture_size.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
CC: Yannick Fertré <yannick.fertre@st.com>

---

Changes in v2:
     - Convert panel_picture_delta from unsigned long to long

 drivers/video/video_bmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index 193f37d275..92847a8088 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -157,7 +157,7 @@ __weak void fb_put_word(uchar **fb, uchar **from)
 static void video_splash_align_axis(int *axis, unsigned long panel_size,
 				    unsigned long picture_size)
 {
-	unsigned long panel_picture_delta = panel_size - picture_size;
+	long panel_picture_delta = panel_size - picture_size;
 	unsigned long axis_alignment;
 
 	if (*axis == BMP_ALIGN_CENTER)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap()
  2019-11-20 13:11 [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice Chotard
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis() Patrice Chotard
@ 2019-11-20 13:11 ` Patrice Chotard
  2019-12-10 10:22   ` Anatolij Gustschin
  2019-12-02  8:23 ` [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice CHOTARD
  2 siblings, 1 reply; 6+ messages in thread
From: Patrice Chotard @ 2019-11-20 13:11 UTC (permalink / raw)
  To: u-boot

In case the BMP size is bigger than the frame buffer, don't use
the BMP's width and height in video_display_rle8_bitmap, but the
one's checked in video_bmp_display() as parameters to
video_display_rle8_bitmap().

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
CC: Yannick Fertré <yannick.fertre@st.com>


---

Changes in v2: None

 drivers/video/video_bmp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index 92847a8088..0e7b6b20ad 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -40,18 +40,16 @@ static void draw_encoded_bitmap(ushort **fbp, ushort col, int cnt)
 
 static void video_display_rle8_bitmap(struct udevice *dev,
 				      struct bmp_image *bmp, ushort *cmap,
-				      uchar *fb, int x_off, int y_off)
+				      uchar *fb, int x_off, int y_off,
+				      ulong width, ulong height)
 {
 	struct video_priv *priv = dev_get_uclass_priv(dev);
 	uchar *bmap;
-	ulong width, height;
 	ulong cnt, runlen;
 	int x, y;
 	int decode = 1;
 
 	debug("%s\n", __func__);
-	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;
@@ -277,7 +275,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 				return -EPROTONOSUPPORT;
 			}
 			video_display_rle8_bitmap(dev, bmp, cmap_base, fb, x,
-						  y);
+						  y, width, height);
 			break;
 		}
 #endif
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer
  2019-11-20 13:11 [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice Chotard
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis() Patrice Chotard
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap() Patrice Chotard
@ 2019-12-02  8:23 ` Patrice CHOTARD
  2 siblings, 0 replies; 6+ messages in thread
From: Patrice CHOTARD @ 2019-12-02  8:23 UTC (permalink / raw)
  To: u-boot

Hi Anatolij

Just a reminder for this series which fixes stm32f746-disco boot when trying to display a splashcreen.

Thanks

Patrice

On 11/20/19 2:11 PM, Patrice Chotard wrote:
> This series is fixing 2 issues found when trying to decode BMP
> bigger than the framebuffer:
>  - Convert panel_picture_delta from unsigned long to long to insure
>    to store correctly the difference between panel_size and picture_size
>    in case the panel_size is smaller than picture_size.
>  - Don't rely on BMP's width and height but in width and height
>    value computed by video_bmp_display().
>
>
> Changes in v2:
>      - Convert panel_picture_delta from unsigned long to long
>
> Patrice Chotard (2):
>   video: bmp: Fix video_splash_align_axis()
>   video: bmp: Fix video_display_rle8_bitmap()
>
>  drivers/video/video_bmp.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis()
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis() Patrice Chotard
@ 2019-12-10 10:21   ` Anatolij Gustschin
  0 siblings, 0 replies; 6+ messages in thread
From: Anatolij Gustschin @ 2019-12-10 10:21 UTC (permalink / raw)
  To: u-boot

On Wed, 20 Nov 2019 14:11:15 +0100
Patrice Chotard patrice.chotard at st.com wrote:
...
> Changes in v2:
>      - Convert panel_picture_delta from unsigned long to long
> 
>  drivers/video/video_bmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Also changed 'axis_alignment' to long and applied to u-boot-video/master,
thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap()
  2019-11-20 13:11 ` [U-Boot] [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap() Patrice Chotard
@ 2019-12-10 10:22   ` Anatolij Gustschin
  0 siblings, 0 replies; 6+ messages in thread
From: Anatolij Gustschin @ 2019-12-10 10:22 UTC (permalink / raw)
  To: u-boot

On Wed, 20 Nov 2019 14:11:16 +0100
Patrice Chotard patrice.chotard at st.com wrote:
... 
> Changes in v2: None
> 
>  drivers/video/video_bmp.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-10 10:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 13:11 [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice Chotard
2019-11-20 13:11 ` [U-Boot] [PATCH v2 1/2] video: bmp: Fix video_splash_align_axis() Patrice Chotard
2019-12-10 10:21   ` Anatolij Gustschin
2019-11-20 13:11 ` [U-Boot] [PATCH v2 2/2] video: bmp: Fix video_display_rle8_bitmap() Patrice Chotard
2019-12-10 10:22   ` Anatolij Gustschin
2019-12-02  8:23 ` [U-Boot] [PATCH v2 0/2] Fix BMP decode when BMP size is bigger than framebuffer Patrice CHOTARD

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.