[PATCH 06/11] efi: Support copy framebuffer
Heinrich Schuchardt
xypron.glpk at gmx.de
Fri Feb 10 13:11:06 CET 2023
On 2/5/23 20:46, Simon Glass wrote:
> 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;
This does not work with today's display sizes:
3840 * 2160 * 4 = 33177600
7680 * 4320 * 4 = 132710400
You have to determine the buffer size from the mode information.
Best regards
Heinrich
> +
> + 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,
> };
More information about the U-Boot
mailing list