]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: set correct frame buffer address
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 1 May 2026 15:05:50 +0000 (17:05 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 27 Jul 2026 16:50:27 +0000 (18:50 +0200)
If we use video copy, bit image transfers need to write to the in memory
copy of the physical frame buffer. Damage control will sync the changes
to the physical frame buffer.

Cyclic video copy will catch all changes done by EFI applications directly
accessing the frame buffer copy.

gopobj->mode.fb_base must be a valid pointer to memory and not a virtual
sandbox address.

With this change the block image transfer test works again on the sandbox.

    setenv efi_selftest block image transfer
    bootefi selftest

Fixes: a75cf70d23ac ("efi: Correct handling of frame buffer")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_gop.c

index 9403e09691e1a6e93dd35df5be1f9fede6dfea1f..ae44d14028982fd5a0da5868be470065c6ddef38 100644 (file)
@@ -471,7 +471,7 @@ efi_status_t efi_gop_register(void)
 {
        struct efi_gop_obj *gopobj;
        u32 bpix, format, col, row;
-       u64 fb_base, fb_size;
+       u64 fb_size;
        efi_status_t ret;
        struct udevice *vdev;
        struct video_priv *priv;
@@ -490,7 +490,6 @@ efi_status_t efi_gop_register(void)
        row = video_get_ysize(vdev);
 
        plat = dev_get_uclass_plat(vdev);
-       fb_base = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base;
        fb_size = plat->size;
 
        switch (bpix) {
@@ -528,7 +527,7 @@ efi_status_t efi_gop_register(void)
        gopobj->mode.info = &gopobj->info;
        gopobj->mode.info_size = sizeof(gopobj->info);
 
-       gopobj->mode.fb_base = fb_base;
+       gopobj->mode.fb_base = (uintptr_t)priv->fb;
        gopobj->mode.fb_size = fb_size;
 
        gopobj->info.version = 0;
@@ -553,7 +552,7 @@ efi_status_t efi_gop_register(void)
        }
        gopobj->info.pixels_per_scanline = col;
        gopobj->bpix = bpix;
-       gopobj->fb = map_sysmem(fb_base, fb_size);
+       gopobj->fb = priv->fb;
        gopobj->vdev = vdev;
 
        return EFI_SUCCESS;