aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/video-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-02 21:12:33 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-07-09 12:33:24 +0800
commit551ca0e64744324b0f337bfa4a743db24a2800ca (patch)
tree9017b10d8f4500786304cc036643887b1dd78ae7 /drivers/video/video-uclass.c
parent7812bbdc373236516b6efa13d879d35d43ca7d01 (diff)
downloadu-boot-551ca0e64744324b0f337bfa4a743db24a2800ca.zip
u-boot-551ca0e64744324b0f337bfa4a743db24a2800ca.tar.gz
u-boot-551ca0e64744324b0f337bfa4a743db24a2800ca.tar.bz2
x86: video: Support copy framebuffer with probed devices
For PCI video devices that are not mentioned in the devicetree, U-Boot does not bind a driver before relocation, since PCI is not fully probed at that point. Furthermore it is possible for the video device to be on a secondary bus which is not even scanned. This is fine if the framebuffer is allocated in fixed memory, as it normally is on x86. But when using this as a copy framebuffer, we also need U-Boot to allocate its own cached framebuffer for working in. Since the video driver is never bound before relocation, the framebuffer size is never set and U-Boot does no allocation. Add a new CONFIG option to reserve 16MB of memory for this eventuality. This allows vesa devices to use the copy framebuffer. 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/video/video-uclass.c')
-rw-r--r--drivers/video/video-uclass.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 4735a22..650891e 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -97,6 +97,11 @@ int video_reserve(ulong *addrp)
debug("%s: Reserving %lx bytes at %lx for video device '%s'\n",
__func__, size, *addrp, dev->name);
}
+
+ /* Allocate space for PCI video devices in case there were not bound */
+ if (*addrp == gd->video_top)
+ *addrp -= CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE;
+
gd->video_bottom = *addrp;
gd->fb_base = *addrp;
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,