2012-07-28 02:41:24 +00:00
|
|
|
From 0f8b3ac2ec984de7f3437fe6a3b37ab8eb07ae71 Mon Sep 17 00:00:00 2001
|
2011-06-16 20:11:40 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Thu, 16 Jun 2011 16:10:27 -0400
|
2012-07-28 02:41:24 +00:00
|
|
|
Subject: [PATCH 6/7] Handle un-initialized GOP.
|
2011-06-16 20:11:40 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
apps/modelist.c | 27 +++++++++++++++++++++++++++
|
2012-07-28 02:41:24 +00:00
|
|
|
1 file changed, 27 insertions(+)
|
2011-06-16 20:11:40 +00:00
|
|
|
|
|
|
|
diff --git a/apps/modelist.c b/apps/modelist.c
|
|
|
|
index c4a4b1a..8d816d1 100644
|
|
|
|
--- a/apps/modelist.c
|
|
|
|
+++ b/apps/modelist.c
|
|
|
|
@@ -3,6 +3,26 @@
|
|
|
|
|
|
|
|
extern EFI_GUID GraphicsOutputProtocol;
|
|
|
|
|
|
|
|
+static int memcmp(const void *s1, const void *s2, UINTN n)
|
|
|
|
+{
|
|
|
|
+ const unsigned char *c1 = s1, *c2 = s2;
|
|
|
|
+ int d = 0;
|
|
|
|
+
|
|
|
|
+ if (!s1 && !s2)
|
|
|
|
+ return 0;
|
|
|
|
+ if (s1 && !s2)
|
|
|
|
+ return 1;
|
|
|
|
+ if (!s1 && s2)
|
|
|
|
+ return -1;
|
|
|
|
+
|
|
|
|
+ while (n--) {
|
|
|
|
+ d = (int)*c1++ - (int)*c2++;
|
|
|
|
+ if (d)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return d;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static void
|
|
|
|
print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
|
|
|
|
{
|
|
|
|
@@ -17,6 +37,13 @@ print_modes(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop)
|
|
|
|
UINTN SizeOfInfo;
|
|
|
|
rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
|
|
|
|
&info);
|
|
|
|
+ if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
|
|
|
|
+ rc = uefi_call_wrapper(gop->SetMode, 2, gop,
|
|
|
|
+ gop->Mode->Mode);
|
|
|
|
+ rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i,
|
|
|
|
+ &SizeOfInfo, &info);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (EFI_ERROR(rc)) {
|
|
|
|
CHAR16 Buffer[64];
|
|
|
|
StatusToString(Buffer, rc);
|
|
|
|
--
|
2012-07-28 02:41:24 +00:00
|
|
|
1.7.10.4
|
2011-06-16 20:11:40 +00:00
|
|
|
|