summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci_rom.c1
-rw-r--r--drivers/video/video-uclass.c4
-rw-r--r--include/video.h4
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index eaacd4066e..7d9b75c2c4 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -331,6 +331,7 @@ int vbe_setup_video_priv(struct vesa_mode_info *vesa,
return log_msg_ret("No x resolution", -ENXIO);
uc_priv->xsize = vesa->x_resolution;
uc_priv->ysize = vesa->y_resolution;
+ uc_priv->line_length = vesa->bytes_per_scanline;
switch (vesa->bits_per_pixel) {
case 32:
case 24:
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index b6551b69d3..f307cf243b 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -226,7 +226,9 @@ static int video_post_probe(struct udevice *dev)
/* Set up the line and display size */
priv->fb = map_sysmem(plat->base, plat->size);
- priv->line_length = priv->xsize * VNBYTES(priv->bpix);
+ if (!priv->line_length)
+ priv->line_length = priv->xsize * VNBYTES(priv->bpix);
+
priv->fb_size = priv->line_length * priv->ysize;
/* Set up colors */
diff --git a/include/video.h b/include/video.h
index 3f9139eea4..1d57b48b17 100644
--- a/include/video.h
+++ b/include/video.h
@@ -61,7 +61,9 @@ enum video_log2_bpp {
* @font_size: Font size in pixels (0 to use a default value)
* @fb: Frame buffer
* @fb_size: Frame buffer size
- * @line_length: Length of each frame buffer line, in bytes
+ * @line_length: Length of each frame buffer line, in bytes. This can be
+ * set by the driver, but if not, the uclass will set it after
+ * probing
* @colour_fg: Foreground colour (pixel value)
* @colour_bg: Background colour (pixel value)
* @flush_dcache: true to enable flushing of the data cache after