mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
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. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
This commit is contained in:
parent
131c224168
commit
38e18d6392
@ -328,7 +328,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
|
|||||||
for (j = 0; j < width; j++)
|
for (j = 0; j < width; j++)
|
||||||
fb_put_word(&fb, &bmap);
|
fb_put_word(&fb, &bmap);
|
||||||
|
|
||||||
bmap += (padded_width - width) * 2;
|
bmap += (padded_width - width);
|
||||||
fb -= width * 2 + priv->line_length;
|
fb -= width * 2 + priv->line_length;
|
||||||
}
|
}
|
||||||
break;
|
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);
|
fb -= priv->line_length + width * (bpix / 8);
|
||||||
bmap += (padded_width - width) * 3;
|
bmap += (padded_width - width);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_BMP_24BPP */
|
#endif /* CONFIG_BMP_24BPP */
|
||||||
|
Loading…
Reference in New Issue
Block a user