diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2012-09-28 15:11:17 +0000 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2012-11-07 00:57:27 +0100 |
commit | d484b52e6fcb28dc011ce45718294496c6ea83d0 (patch) | |
tree | fce605b5e5a41a56b5c0546a5956805980afa87b /drivers | |
parent | 45d7f52511f43b71b623a502fdf31feb905f70a1 (diff) | |
download | u-boot-imx-d484b52e6fcb28dc011ce45718294496c6ea83d0.zip u-boot-imx-d484b52e6fcb28dc011ce45718294496c6ea83d0.tar.gz u-boot-imx-d484b52e6fcb28dc011ce45718294496c6ea83d0.tar.bz2 |
video: Skip bitmaps which do not fit into the screen in cfb_console
The cfb console driver is trying to prevent bitmaps to spill over the
screen, but the calculations assume that at least part of the bitmap
fits into the screen area. In reality there could be bitmap elements
which are completely out of the screen area, they just need to be
discarded.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/cfb_console.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 6f5d4f2..9388859 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1515,6 +1515,13 @@ int video_display_bitmap(ulong bmp_image, int x, int y) padded_line = (((width * bpp + 7) / 8) + 3) & ~0x3; + /* + * Just ignore elements which are completely beyond screen + * dimensions. + */ + if ((x >= VIDEO_VISIBLE_COLS) || (y >= VIDEO_VISIBLE_ROWS)) + return 0; + #ifdef CONFIG_SPLASH_SCREEN_ALIGN if (x == BMP_ALIGN_CENTER) x = max(0, (VIDEO_VISIBLE_COLS - width) / 2); |