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

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