video: Fix line padding calculation for 16 and 24 BPP bitmaps
A message that is not in the archive (sent off-list or not yet received): CGME20201201113117eucas1p18b5d1379afd4146731a26b9cb922dbc1@eucas1p1.samsung.com
PATCH 1/1 video: Fix line padding calculation for 16 and 24 BPP bitmaps
Each row in the pixel array in the bitmap file is padded if necessary so the row size is always a multiple of 4 bytes. In current code the complement of row size to a multiple of 4 bytes is further unnecessarily multiplied by the pixel size. This results in incorrect displaying of bitmaps having row size that is not a multiple of 4 bytes. Fix this by removing the unnecessary multiplication.
Tested with 24BPP bitmap and XRGB32 display.
--- drivers/video/video_bmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/video_bmp.c +2 -2
@@ -328,7 +328,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,for (j =0 ; j < width; j++)fb_put_word (&fb, &bmap); - bmap += (padded_width - width) *2 ; + bmap += (padded_width - width); fb -= width *2 + priv->line_length; }break ;
@@ -352,7 +352,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, } } fb -= priv->line_length + width * (bpix /8 ); - bmap += (padded_width - width) *3 ; + bmap += (padded_width - width); }break ;#endif /* CONFIG_BMP_24BPP */
Signature · 1 line
2.17.1
PATCH 1/1 video: Fix line padding calculation for 16 and 24 BPP bitmaps
Quoted 11 lines · Sylwester Nawrocki
Each row in the pixel array in the bitmap file is padded if necessary so the row size is always a multiple of 4 bytes. In current code the complement of row size to a multiple of 4 bytes is further unnecessarily multiplied by the pixel size. This results in incorrect displaying of bitmaps having row size that is not a multiple of 4 bytes. Fix this by removing the unnecessary multiplication.
Tested with 24BPP bitmap and XRGB32 display.
Signed-off-by Sylwester Nawrocki <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 27 lines
--- drivers/video/video_bmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/video/video_bmp.c +2
-2@@ -328,7 +328,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,for (j =0 ; j < width; j++)fb_put_word (&fb, &bmap); - bmap += (padded_width - width) *2 ; + bmap += (padded_width - width); fb -= width *2 + priv->line_length; }break ;@@ -352,7 +352,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, } } fb -= priv->line_length + width * (bpix /8 ); - bmap += (padded_width - width) *3 ; + bmap += (padded_width - width); }break ;#endif /* CONFIG_BMP_24BPP */
PATCH 1/1 video: Fix line padding calculation for 16 and 24 BPP bitmaps
In reply to Sylwester NawrockiQuoted 8 lines · On Tue, 1 Dec 2020 12:30:50 +0100 Sylwester Nawrocki s.nawrocki at…
Each row in the pixel array in the bitmap file is padded if necessary so the row size is always a multiple of 4 bytes. In current code the complement of row size to a multiple of 4 bytes is further unnecessarily multiplied by the pixel size. This results in incorrect displaying of bitmaps having row size that is not a multiple of 4 bytes. Fix this by removing the unnecessary multiplication.
Quoted 6 lines
Tested with 24BPP bitmap and XRGB32 display.
Signed-off-by Sylwester Nawrocki <[email protected]>--- drivers/video/video_bmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
applied to u-boot-video/master, thanks!
--
Anatolij