aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorSimon Glass2020-07-02 21:12:30 -0600
committerBin Meng2020-07-09 12:33:24 +0800
commit0938767da1782d2c5c5d1f003b8835a59271b622 (patch)
tree83cef18f07254ed897a3a9380b94afcd3992e0eb /drivers/pci
parentf578ca799eec188fc96da3a1680c78c5f924b928 (diff)
video: pci: Set up the copy framebuffer
When using a copy framebuffer we need to tell the video subsystem its address. U-Boot's normally allocated framebuffer is used as the working buffer, but nothing is displayed until it is copied to the copy framebuffer. For this to work the video driver must request that a framebuffer be allocated separately from the hardware framebuffer, so add a check for that. Also add a log category so that logging appears correctly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci_rom.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 6a9bc499781..fa29d69e859 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -22,6 +22,8 @@
* Copyright 1997 -- 1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/
+#define LOG_CATEGORY UCLASS_PCI
+
#include <common.h>
#include <bios_emul.h>
#include <bootstage.h>
@@ -344,7 +346,16 @@ int vbe_setup_video_priv(struct vesa_mode_info *vesa,
default:
return -EPROTONOSUPPORT;
}
- plat->base = vesa->phys_base_ptr;
+
+ /* Use double buffering if enabled */
+ if (IS_ENABLED(CONFIG_VIDEO_COPY)) {
+ if (!plat->base)
+ return log_msg_ret("copy", -ENFILE);
+ plat->copy_base = vesa->phys_base_ptr;
+ } else {
+ plat->base = vesa->phys_base_ptr;
+ }
+ log_debug("base = %lx, copy_base = %lx\n", plat->base, plat->copy_base);
plat->size = vesa->bytes_per_scanline * vesa->y_resolution;
return 0;
@@ -372,6 +383,15 @@ int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
ret = vbe_setup_video_priv(&mode_info.vesa, uc_priv, plat);
if (ret) {
+ if (ret == -ENFILE) {
+ /*
+ * See video-uclass.c for how to set up reserved memory
+ * in your video driver
+ */
+ log_err("CONFIG_VIDEO_COPY enabled but driver '%s' set up no reserved memory\n",
+ dev->driver->name);
+ }
+
debug("No video mode configured\n");
return ret;
}