[PATCH 06/11] efi: Support copy framebuffer

Simon Glass sjg at chromium.org
Sun Feb 5 20:46:22 CET 2023


Add support for this to EFI in case it becomes useful. At present it just
slows things down. Enable CONFIG_VIDEO_COPY to turn it on.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/dts/efi-x86_app.dts |  1 +
 drivers/video/efi.c          | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/arch/x86/dts/efi-x86_app.dts b/arch/x86/dts/efi-x86_app.dts
index a5316e2a1a7..7afa3d72d57 100644
--- a/arch/x86/dts/efi-x86_app.dts
+++ b/arch/x86/dts/efi-x86_app.dts
@@ -27,6 +27,7 @@
 	};
 	efi-fb {
 		compatible = "efi-fb";
+		u-boot,dm-pre-reloc;
 	};
 
 };
diff --git a/drivers/video/efi.c b/drivers/video/efi.c
index 169637c2882..9135a8e8187 100644
--- a/drivers/video/efi.c
+++ b/drivers/video/efi.c
@@ -207,6 +207,16 @@ err:
 	return ret;
 }
 
+static int efi_video_bind(struct udevice *dev)
+{
+	struct video_uc_plat *plat = dev_get_uclass_plat(dev);
+
+	/* Use a 16MB frame buffer in case VIDEO_COPY is enabled */
+	plat->copy_size = 16 << 20;
+
+	return 0;
+}
+
 static const struct udevice_id efi_video_ids[] = {
 	{ .compatible = "efi-fb" },
 	{ }
@@ -216,5 +226,6 @@ U_BOOT_DRIVER(efi_video) = {
 	.name	= "efi_video",
 	.id	= UCLASS_VIDEO,
 	.of_match = efi_video_ids,
+	.bind	= efi_video_bind,
 	.probe	= efi_video_probe,
 };
-- 
2.39.1.519.gcb327c4b5f-goog



More information about the U-Boot mailing list