Skip to contentSkip to conversation

video: bmp: Fix compilation errors with CONFIG_BMP_xxBPP enabled

PATCH New Stefan Roese 2 participants 2 messages Nov 12, 2016 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: bmp: Fix compilation errors with CONFIG_BMP_xxBPP enabled

Compiling the 'bmp' command with DM and having one of the following macros enabled:

CONFIG_BMP_16BPP, CONFIG_BMP_24BPP ONFIG_BMP_32BPP

generates this error:

drivers/video/video_bmp.c: In function ?video_bmp_display?:
drivers/video/video_bmp.c:315:22: error: ?lcd_line_length? undeclared (first use in this function)

    fb -= width * 2 + lcd_line_length;
                          ^

This patch moves to using the correct variable instead and enables the 'bmp' command for DM again.

Cc Simon Glass <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 drivers/video/video_bmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/video_bmp.c +3 -3
index fb7943e..32a4e7f 100644
@@ -312,7 +312,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 				fb_put_word(&fb, &bmap);
 
 			bmap += (padded_width - width) * 2;
-			fb -= width * 2 + lcd_line_length;
+			fb -= width * 2 + priv->line_length;
 		}
 		break;
 #endif /* CONFIG_BMP_16BPP */
@@ -325,7 +325,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 				*(fb++) = *(bmap++);
 				*(fb++) = 0;
 			}
-			fb -= lcd_line_length + width * (bpix / 8);
+			fb -= priv->line_length + width * (bpix / 8);
 		}
 		break;
 #endif /* CONFIG_BMP_24BMP */
@@ -338,7 +338,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
 				*(fb++) = *(bmap++);
 				*(fb++) = *(bmap++);
 			}
-			fb -= lcd_line_length + width * (bpix / 8);
+			fb -= priv->line_length + width * (bpix / 8);
 		}
 		break;
 #endif /* CONFIG_BMP_32BPP */
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 video: bmp: Fix compilation errors with CONFIG_BMP_xxBPP enabled

Quoted 15 lines · On Sat, 12 Nov 2016 10:32:38 +0100 Stefan Roese sr at denx.de wrote:

Compiling the 'bmp' command with DM and having one of the following macros enabled:

CONFIG_BMP_16BPP, CONFIG_BMP_24BPP ONFIG_BMP_32BPP

generates this error:

drivers/video/video_bmp.c: In function ?video_bmp_display?:
drivers/video/video_bmp.c:315:22: error: ?lcd_line_length? undeclared (first use in this function)

    fb -= width * 2 + lcd_line_length;
                          ^

This patch moves to using the correct variable instead and enables the 'bmp' command for DM again.

Quoted 6 lines
Cc Simon Glass <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 drivers/video/video_bmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-video/master. Thanks!

--
Anatolij