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

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