Blame SOURCES/0180-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Alexander Graf <agraf@suse.de>
d9d99f
Date: Wed, 1 Feb 2017 23:10:45 +0100
d9d99f
Subject: [PATCH] grub-core/video/efi_gop.c: Add support for BLT_ONLY adapters
d9d99f
d9d99f
EFI GOP has support for multiple different bitness types of frame buffers
d9d99f
and for a special "BLT only" type which is always defined to be RGBx.
d9d99f
d9d99f
Because grub2 doesn't ever directly access the frame buffer but instead
d9d99f
only renders graphics via the BLT interface anyway, we can easily support
d9d99f
these adapters.
d9d99f
d9d99f
The reason this has come up now is the emerging support for virtio-gpu
d9d99f
in OVMF. That adapter does not have the notion of a memory mapped frame
d9d99f
buffer and thus is BLT only.
d9d99f
d9d99f
Signed-off-by: Alexander Graf <agraf@suse.de>
d9d99f
---
d9d99f
 grub-core/video/efi_gop.c          | 2 ++
d9d99f
 include/grub/efi/graphics_output.h | 3 ++-
d9d99f
 2 files changed, 4 insertions(+), 1 deletion(-)
d9d99f
d9d99f
diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
b71686
index 7f9d1c2df..c9e40e8d4 100644
d9d99f
--- a/grub-core/video/efi_gop.c
d9d99f
+++ b/grub-core/video/efi_gop.c
d9d99f
@@ -121,6 +121,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in)
d9d99f
     {
d9d99f
     case GRUB_EFI_GOT_BGRA8:
d9d99f
     case GRUB_EFI_GOT_RGBA8:
d9d99f
+    case GRUB_EFI_GOT_BLT_ONLY:
d9d99f
       return 32;
d9d99f
 
d9d99f
     case GRUB_EFI_GOT_BITMASK:
d9d99f
@@ -187,6 +188,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode,
d9d99f
   switch (in->pixel_format)
d9d99f
     {
d9d99f
     case GRUB_EFI_GOT_RGBA8:
d9d99f
+    case GRUB_EFI_GOT_BLT_ONLY:
d9d99f
       out->red_mask_size = 8;
d9d99f
       out->red_field_pos = 0;
d9d99f
       out->green_mask_size = 8;
d9d99f
diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics_output.h
b71686
index 129777411..e4388127c 100644
d9d99f
--- a/include/grub/efi/graphics_output.h
d9d99f
+++ b/include/grub/efi/graphics_output.h
d9d99f
@@ -28,7 +28,8 @@ typedef enum
d9d99f
   {
d9d99f
     GRUB_EFI_GOT_RGBA8,
d9d99f
     GRUB_EFI_GOT_BGRA8,
d9d99f
-    GRUB_EFI_GOT_BITMASK
d9d99f
+    GRUB_EFI_GOT_BITMASK,
d9d99f
+    GRUB_EFI_GOT_BLT_ONLY,
d9d99f
   }
d9d99f
   grub_efi_gop_pixel_format_t;
d9d99f