summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioGpuDxe/DriverBinding.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-08-17 22:45:02 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-09-01 22:55:53 +0200
commit8731debefd1f0750cd033ce88a83f1d1dce9df3c (patch)
treed3feb02e5c715345842da9e426ed7f001499e1c4 /OvmfPkg/VirtioGpuDxe/DriverBinding.c
parenta66ea3b5578ccebf22c2d1d673273f0dffc84ffa (diff)
downloadedk2-8731debefd1f0750cd033ce88a83f1d1dce9df3c.tar.gz
edk2-8731debefd1f0750cd033ce88a83f1d1dce9df3c.tar.bz2
edk2-8731debefd1f0750cd033ce88a83f1d1dce9df3c.zip
OvmfPkg/VirtioGpuDxe: implement EFI_GRAPHICS_OUTPUT_PROTOCOL
In this patch we replace our "dummy" Graphics Output Protocol interface with the real one. We exploit that EFI_GRAPHICS_OUTPUT_BLT_PIXEL and VirtioGpuFormatB8G8R8X8Unorm have identical representations; this lets us forego any pixel format conversions in the guest. For messaging the VirtIo GPU device, we use the primitives introduced in the previous patch. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=66 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/VirtioGpuDxe/DriverBinding.c')
-rw-r--r--OvmfPkg/VirtioGpuDxe/DriverBinding.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/OvmfPkg/VirtioGpuDxe/DriverBinding.c b/OvmfPkg/VirtioGpuDxe/DriverBinding.c
index bdea55ef7d..33c1ad3b31 100644
--- a/OvmfPkg/VirtioGpuDxe/DriverBinding.c
+++ b/OvmfPkg/VirtioGpuDxe/DriverBinding.c
@@ -29,16 +29,6 @@
#include "VirtioGpu.h"
//
-// Dummy Graphics Output Protocol GUID: a temporary placeholder for the EFI
-// counterpart. It will be replaced with the real thing as soon as we implement
-// the EFI GOP. Refer to VGPU_GOP.Gop.
-//
-STATIC EFI_GUID mDummyGraphicsOutputProtocolGuid = {
- 0x4983f8dc, 0x2782, 0x415b,
- { 0x91, 0xf5, 0x2c, 0xeb, 0x48, 0x4a, 0x0f, 0xe9 }
-};
-
-//
// The device path node that describes the Video Output Device Attributes for
// the single head (UEFI child handle) that we support.
//
@@ -356,9 +346,11 @@ InitVgpuGop (
//
// Initialize our Graphics Output Protocol.
//
- // This means "nothing" for now.
+ // Fill in the function members of VgpuGop->Gop from the template, then set
+ // up the rest of the GOP infrastructure by calling SetMode() right now.
//
- Status = EFI_SUCCESS;
+ CopyMem (&VgpuGop->Gop, &mGopTemplate, sizeof mGopTemplate);
+ Status = VgpuGop->Gop.SetMode (&VgpuGop->Gop, 0);
if (EFI_ERROR (Status)) {
goto CloseVirtIoByChild;
}
@@ -367,7 +359,7 @@ InitVgpuGop (
// Install the Graphics Output Protocol on the child handle.
//
Status = gBS->InstallProtocolInterface (&VgpuGop->GopHandle,
- &mDummyGraphicsOutputProtocolGuid, EFI_NATIVE_INTERFACE,
+ &gEfiGraphicsOutputProtocolGuid, EFI_NATIVE_INTERFACE,
&VgpuGop->Gop);
if (EFI_ERROR (Status)) {
goto UninitGop;
@@ -381,9 +373,7 @@ InitVgpuGop (
return EFI_SUCCESS;
UninitGop:
- //
- // Nothing, for now.
- //
+ ReleaseGopResources (VgpuGop, TRUE /* DisableHead */);
CloseVirtIoByChild:
gBS->CloseProtocol (ParentBusController, &gVirtioDeviceProtocolGuid,
@@ -439,16 +429,13 @@ UninitVgpuGop (
VgpuGop = ParentBus->Child;
Status = gBS->UninstallProtocolInterface (VgpuGop->GopHandle,
- &mDummyGraphicsOutputProtocolGuid, &VgpuGop->Gop);
+ &gEfiGraphicsOutputProtocolGuid, &VgpuGop->Gop);
ASSERT_EFI_ERROR (Status);
//
// Uninitialize VgpuGop->Gop.
//
- // Nothing, for now.
- //
- Status = EFI_SUCCESS;
- ASSERT_EFI_ERROR (Status);
+ ReleaseGopResources (VgpuGop, TRUE /* DisableHead */);
Status = gBS->CloseProtocol (ParentBusController, &gVirtioDeviceProtocolGuid,
DriverBindingHandle, VgpuGop->GopHandle);