]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: bochs: Set the frame buffer size per configuration
authorBin Meng <bmeng@tinylab.org>
Sun, 23 Jul 2023 04:40:32 +0000 (12:40 +0800)
committerAnatolij Gustschin <agust@denx.de>
Tue, 1 Aug 2023 11:35:39 +0000 (13:35 +0200)
At present the uclass stored frame buffer size is set to a hard
coded value, but we can calculate the correct value based on what
is configured.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
drivers/video/bochs.c

index 5923ff81c658eeb735676d39d8d3ed39e42721c8..022ea38d4cfecc97403f16e2886a6fb4f7149029 100644 (file)
@@ -101,8 +101,8 @@ static int bochs_video_bind(struct udevice *dev)
 {
        struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
 
-       /* Set the maximum supported resolution */
-       uc_plat->size = 2560 * 1600 * 4;
+       /* Set the frame buffer size per configuration */
+       uc_plat->size = xsize * ysize * 32 / 8;
        log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
 
        return 0;