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

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