summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Wai-Hong Tam <waihong@chromium.org>2012-09-28 15:11:14 +0000
committerAnatolij Gustschin <agust@denx.de>2012-11-07 00:57:22 +0100
commitfecac46cf8757dc4f00a7812310e060f3b0c6eb4 (patch)
tree0f7b1409237a4cfdd473ef62a658f2810ba5b69c /common
parent395166cffbb427bfb0da051ac044118a592e5c0b (diff)
downloadu-boot-imx-fecac46cf8757dc4f00a7812310e060f3b0c6eb4.zip
u-boot-imx-fecac46cf8757dc4f00a7812310e060f3b0c6eb4.tar.gz
u-boot-imx-fecac46cf8757dc4f00a7812310e060f3b0c6eb4.tar.bz2
lcd: Fix BMP decode bug that skips the wrong padded row
This change fixed 2 things: - Rename padded_line to padded_width since it is (width + padded_row) not line. - When finished a line, should skip the padded_row that is (padded_width - width) instead of (width - padded_width). Reference: http://en.wikipedia.org/wiki/BMP_file_format Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/lcd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/lcd.c b/common/lcd.c
index 4cea04e..7c6cb09 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -675,7 +675,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
uchar *fb;
bmp_image_t *bmp=(bmp_image_t *)bmp_image;
uchar *bmap;
- ushort padded_line;
+ ushort padded_width;
unsigned long width, height, byte_width;
unsigned long pwidth = panel_info.vl_col;
unsigned colors, bpix, bmp_bpix;
@@ -762,7 +762,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
}
#endif
- padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
+ padded_width = (width&0x3) ? ((width&~0x3)+4) : (width);
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
splash_align_axis(&x, pwidth, width);
@@ -796,7 +796,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
fb += sizeof(uint16_t) / sizeof(*fb);
}
}
- bmap += (width - padded_line);
+ bmap += (padded_width - width);
fb -= (byte_width + lcd_line_length);
}
break;
@@ -808,7 +808,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
for (j = 0; j < width; j++)
fb_put_word(&fb, &bmap);
- bmap += (padded_line - width) * 2;
+ bmap += (padded_width - width) * 2;
fb -= (width * 2 + lcd_line_length);
}
break;