]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
video/efi_gop: Require shadow if PixelBltOnly
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 28 Aug 2023 21:50:09 +0000 (23:50 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 31 Aug 2023 15:21:40 +0000 (17:21 +0200)
If the EFI graphics pixel format is PixelBltOnly, we cannot write directly
to the frame buffer. We need the shadow frame buffer which we copy via
the BitBlt operation to the hardware.

If the pixel format is PixelBltOnly and allocation of the shadow frame
buffer fails, we must raise an error to signal that the EFI GOP protocol
is not usable.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/video/efi_gop.c

index 7247aeea7919889190e218e1b3585d31cf01106b..9452f5e58797b60dc4389a5eeabe813c3a5710d5 100644 (file)
@@ -480,6 +480,10 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
   if (!buffer)
     {
       grub_dprintf ("video", "GOP: couldn't allocate shadow\n");
+
+      if (info->pixel_format == GRUB_EFI_GOT_BLT_ONLY)
+        return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
+
       grub_errno = 0;
       grub_video_gop_fill_mode_info (gop->mode->mode, info,
                                     &framebuffer.mode_info);