public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes
@ 2020-07-22  2:01 Samer El-Haj-Mahmoud
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling Samer El-Haj-Mahmoud
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-07-22  2:01 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

This series fixes various failures reported by SCT for
EFI_GRAPHICS_OUTPUT_PROTOCOL (https://github.com/pftf/RPi4/issues/73)

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Samer El-Haj-Mahmoud (3):
  Platforms/RaspberryPi: Fix GOP parameter handling
  Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()
  Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()

 .../Drivers/DisplayDxe/DisplayDxe.c           | 22 +++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling
  2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
@ 2020-07-22  2:01 ` Samer El-Haj-Mahmoud
  2020-07-22  4:31   ` Andrei Warkentin
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode() Samer El-Haj-Mahmoud
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-07-22  2:01 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

Handle incorrect parameters passed to DisplayDxe GOP functions
QueryMode(), SetMode(), and Blt().

This fixes Blt_Conf and QueryMode_Conf failures
reported by SCT tests at:
https://github.com/pftf/RPi4/issues/73

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index b880ca827bd6..80d0f7b2cb3c 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
  *  Copyright (c) Microsoft Corporation. All rights reserved.
  *
@@ -170,7 +171,7 @@ DisplayQueryMode (
   EFI_STATUS Status;
   GOP_MODE_DATA *Mode;
 
-  if (ModeNumber > mLastMode) {
+  if (Info == NULL || SizeOfInfo == NULL || ModeNumber >= This->Mode->MaxMode) {
     return EFI_INVALID_PARAMETER;
   }
 
@@ -227,7 +228,7 @@ DisplaySetMode (
   EFI_PHYSICAL_ADDRESS FbBase;
   GOP_MODE_DATA *Mode = &mGopModeData[ModeNumber];
 
-  if (ModeNumber > mLastMode) {
+ if (ModeNumber >= This->Mode->MaxMode) {
     return EFI_UNSUPPORTED;
   }
 
@@ -299,6 +300,14 @@ DisplayBlt (
   UINT8 *VidBuf, *BltBuf, *VidBuf1;
   UINTN i;
 
+  if ((UINTN)BltOperation >= EfiGraphicsOutputBltOperationMax) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Width == 0 || Height == 0) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   switch (BltOperation) {
   case EfiBltVideoFill:
     BltBuf = (UINT8*)BltBuffer;
@@ -349,7 +358,7 @@ DisplayBlt (
     break;
 
   default:
-    ASSERT_EFI_ERROR (EFI_SUCCESS);
+    return EFI_INVALID_PARAMETER;
     break;
   }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()
  2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling Samer El-Haj-Mahmoud
@ 2020-07-22  2:01 ` Samer El-Haj-Mahmoud
  2020-07-22  4:31   ` Andrei Warkentin
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode() Samer El-Haj-Mahmoud
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-07-22  2:01 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

Return correct values of PixelInformation in QueryMode().

This fixes the QueryMode_Func failures reported by SCT tests at
https://github.com/pftf/RPi4/issues/73

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index 80d0f7b2cb3c..f50ffc816cf1 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -191,6 +191,10 @@ DisplayQueryMode (
   (*Info)->HorizontalResolution = Mode->Width;
   (*Info)->VerticalResolution = Mode->Height;
   (*Info)->PixelFormat = This->Mode->Info->PixelFormat;
+  (*Info)->PixelInformation.RedMask = This->Mode->Info->PixelInformation.RedMask;
+  (*Info)->PixelInformation.GreenMask = This->Mode->Info->PixelInformation.GreenMask;
+  (*Info)->PixelInformation.BlueMask = This->Mode->Info->PixelInformation.BlueMask;
+  (*Info)->PixelInformation.ReservedMask = This->Mode->Info->PixelInformation.ReservedMask;
   (*Info)->PixelsPerScanLine = Mode->Width;
 
   return EFI_SUCCESS;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()
  2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling Samer El-Haj-Mahmoud
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode() Samer El-Haj-Mahmoud
@ 2020-07-22  2:01 ` Samer El-Haj-Mahmoud
  2020-07-22  4:32   ` Andrei Warkentin
  2020-07-22 19:47 ` [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Andrei Warkentin
  2020-08-13 13:50 ` Ard Biesheuvel
  4 siblings, 1 reply; 9+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-07-22  2:01 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin, Ard Biesheuvel

GOP SetMode() returns the frame buffer size in FrameBufferSize.
The value is obtained from the RPi mailbox call to AllocateBuffer
(tag RPI_MBOX_ALLOC_FB), which for a native resolution of 1920 x 1080
returns 8355840 bytes. The size should be 1920 x 1080 x 4 (bytes/pixel),
or 8294400 bytes, as defined by the UEFI Spec: "FrameBufferSize :
Amount of frame buffer needed to support the active mode as defined by
PixelsPerScanLine x VerticalResolution x PixelElementSize".

This change forces the returned FrameBufferSize to match the value
required by UEFI Spec. The actual buffer allocted by the VPU is larger
due to the alignment request when calling RPI_MBOX_ALLOC_FB
(32 bytes). A vertical resolution of 1080 aligns to 1088 on 32-bytes,
resulting in the increased buffer size (1920 x 1088 x 4 = 8355840).

This fixes the SetMode_Conf failure reported by SCT tests at
https://github.com/pftf/RPi4/issues/73

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index f50ffc816cf1..a42e4d9b8a1b 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -279,7 +279,8 @@ DisplaySetMode (
   This->Mode->Info->PixelsPerScanLine = Mode->Width;
   This->Mode->SizeOfInfo = sizeof (*This->Mode->Info);
   This->Mode->FrameBufferBase = FbBase;
-  This->Mode->FrameBufferSize = FbSize;
+  This->Mode->FrameBufferSize = Mode->Width * Mode->Height * PI3_BYTES_PER_PIXEL;
+  DEBUG((DEBUG_INFO, "Reported Mode->FrameBufferSize is %u\n", This->Mode->FrameBufferSize));
 
   ClearScreen (This);
   return EFI_SUCCESS;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling Samer El-Haj-Mahmoud
@ 2020-07-22  4:31   ` Andrei Warkentin
  0 siblings, 0 replies; 9+ messages in thread
From: Andrei Warkentin @ 2020-07-22  4:31 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel@edk2.groups.io
  Cc: Leif Lindholm, Pete Batard, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 3156 bytes --]

Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>

Not using mLastMode is definitely an improvement, thanks. Esp. since mLastMode isn't a very good name for the variable (i.e. it's not the last mode set, it's the last possible/valid mode index, based on the virtual resolution modes enabled via Pcd/HII)
________________________________
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Tuesday, July 21, 2020 9:01 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling

Handle incorrect parameters passed to DisplayDxe GOP functions
QueryMode(), SetMode(), and Blt().

This fixes Blt_Conf and QueryMode_Conf failures
reported by SCT tests at:
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F73&amp;data=02%7C01%7Cawarkentin%40vmware.com%7C34c31d6924ca4f871d1b08d82de317b2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637309800678733611&amp;sdata=3BSdjglhhk%2FqRrP0mDOxV8YydE4vf0FdDkMnzabV5qY%3D&amp;reserved=0

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index b880ca827bd6..80d0f7b2cb3c 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -1,5 +1,6 @@
 /** @file
  *
+ *  Copyright (c) 2020, ARM Limited. All rights reserved.
  *  Copyright (c) 2017-2018, Andrei Warkentin <andrey.warkentin@gmail.com>
  *  Copyright (c) Microsoft Corporation. All rights reserved.
  *
@@ -170,7 +171,7 @@ DisplayQueryMode (
   EFI_STATUS Status;
   GOP_MODE_DATA *Mode;

-  if (ModeNumber > mLastMode) {
+  if (Info == NULL || SizeOfInfo == NULL || ModeNumber >= This->Mode->MaxMode) {
     return EFI_INVALID_PARAMETER;
   }

@@ -227,7 +228,7 @@ DisplaySetMode (
   EFI_PHYSICAL_ADDRESS FbBase;
   GOP_MODE_DATA *Mode = &mGopModeData[ModeNumber];

-  if (ModeNumber > mLastMode) {
+ if (ModeNumber >= This->Mode->MaxMode) {
     return EFI_UNSUPPORTED;
   }

@@ -299,6 +300,14 @@ DisplayBlt (
   UINT8 *VidBuf, *BltBuf, *VidBuf1;
   UINTN i;

+  if ((UINTN)BltOperation >= EfiGraphicsOutputBltOperationMax) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Width == 0 || Height == 0) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   switch (BltOperation) {
   case EfiBltVideoFill:
     BltBuf = (UINT8*)BltBuffer;
@@ -349,7 +358,7 @@ DisplayBlt (
     break;

   default:
-    ASSERT_EFI_ERROR (EFI_SUCCESS);
+    return EFI_INVALID_PARAMETER;
     break;
   }

--
2.17.1


[-- Attachment #2: Type: text/html, Size: 5621 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode() Samer El-Haj-Mahmoud
@ 2020-07-22  4:31   ` Andrei Warkentin
  0 siblings, 0 replies; 9+ messages in thread
From: Andrei Warkentin @ 2020-07-22  4:31 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel@edk2.groups.io
  Cc: Leif Lindholm, Pete Batard, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]

Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
________________________________
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Tuesday, July 21, 2020 9:01 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()

Return correct values of PixelInformation in QueryMode().

This fixes the QueryMode_Func failures reported by SCT tests at
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F73&amp;data=02%7C01%7Cawarkentin%40vmware.com%7C97fe0ab6da2a480623a208d82de317f2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637309800678332179&amp;sdata=wecctIMVYrU2YhzqOouRS6THUMosi%2Bu7kt2e2gH4oIY%3D&amp;reserved=0

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index 80d0f7b2cb3c..f50ffc816cf1 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -191,6 +191,10 @@ DisplayQueryMode (
   (*Info)->HorizontalResolution = Mode->Width;
   (*Info)->VerticalResolution = Mode->Height;
   (*Info)->PixelFormat = This->Mode->Info->PixelFormat;
+  (*Info)->PixelInformation.RedMask = This->Mode->Info->PixelInformation.RedMask;
+  (*Info)->PixelInformation.GreenMask = This->Mode->Info->PixelInformation.GreenMask;
+  (*Info)->PixelInformation.BlueMask = This->Mode->Info->PixelInformation.BlueMask;
+  (*Info)->PixelInformation.ReservedMask = This->Mode->Info->PixelInformation.ReservedMask;
   (*Info)->PixelsPerScanLine = Mode->Width;

   return EFI_SUCCESS;
--
2.17.1


[-- Attachment #2: Type: text/html, Size: 3615 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode() Samer El-Haj-Mahmoud
@ 2020-07-22  4:32   ` Andrei Warkentin
  0 siblings, 0 replies; 9+ messages in thread
From: Andrei Warkentin @ 2020-07-22  4:32 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel@edk2.groups.io
  Cc: Leif Lindholm, Pete Batard, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 2818 bytes --]

Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
________________________________
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Tuesday, July 21, 2020 9:01 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()

GOP SetMode() returns the frame buffer size in FrameBufferSize.
The value is obtained from the RPi mailbox call to AllocateBuffer
(tag RPI_MBOX_ALLOC_FB), which for a native resolution of 1920 x 1080
returns 8355840 bytes. The size should be 1920 x 1080 x 4 (bytes/pixel),
or 8294400 bytes, as defined by the UEFI Spec: "FrameBufferSize :
Amount of frame buffer needed to support the active mode as defined by
PixelsPerScanLine x VerticalResolution x PixelElementSize".

This change forces the returned FrameBufferSize to match the value
required by UEFI Spec. The actual buffer allocted by the VPU is larger
due to the alignment request when calling RPI_MBOX_ALLOC_FB
(32 bytes). A vertical resolution of 1080 aligns to 1088 on 32-bytes,
resulting in the increased buffer size (1920 x 1088 x 4 = 8355840).

This fixes the SetMode_Conf failure reported by SCT tests at
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F73&amp;data=02%7C01%7Cawarkentin%40vmware.com%7C48ef278196e648255b8a08d82de317fe%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637309800670078866&amp;sdata=Y3sRmqyjYpzRQ8H%2BVnXPtlKZP9yaOy%2FXqBr%2B8vNMLKM%3D&amp;reserved=0

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
index f50ffc816cf1..a42e4d9b8a1b 100644
--- a/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
+++ b/Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.c
@@ -279,7 +279,8 @@ DisplaySetMode (
   This->Mode->Info->PixelsPerScanLine = Mode->Width;
   This->Mode->SizeOfInfo = sizeof (*This->Mode->Info);
   This->Mode->FrameBufferBase = FbBase;
-  This->Mode->FrameBufferSize = FbSize;
+  This->Mode->FrameBufferSize = Mode->Width * Mode->Height * PI3_BYTES_PER_PIXEL;
+  DEBUG((DEBUG_INFO, "Reported Mode->FrameBufferSize is %u\n", This->Mode->FrameBufferSize));

   ClearScreen (This);
   return EFI_SUCCESS;
--
2.17.1


[-- Attachment #2: Type: text/html, Size: 4415 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes
  2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
                   ` (2 preceding siblings ...)
  2020-07-22  2:01 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode() Samer El-Haj-Mahmoud
@ 2020-07-22 19:47 ` Andrei Warkentin
  2020-08-13 13:50 ` Ard Biesheuvel
  4 siblings, 0 replies; 9+ messages in thread
From: Andrei Warkentin @ 2020-07-22 19:47 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel@edk2.groups.io
  Cc: Leif Lindholm, Pete Batard, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

Tested-by: Andrei Warkentin <awarkentin@vmware.com>
________________________________
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Tuesday, July 21, 2020 9:01 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes

This series fixes various failures reported by SCT for
EFI_GRAPHICS_OUTPUT_PROTOCOL (https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpftf%2FRPi4%2Fissues%2F73&amp;data=02%7C01%7Cawarkentin%40vmware.com%7C558336c4c06d4bbd608508d82de3175a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637309800663071295&amp;sdata=aCbQzuQ0S6rWxH8B2ISllUhZL2yNZgDY01wi%2FLd58J0%3D&amp;reserved=0)

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Samer El-Haj-Mahmoud (3):
  Platforms/RaspberryPi: Fix GOP parameter handling
  Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()
  Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()

 .../Drivers/DisplayDxe/DisplayDxe.c           | 22 +++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

--
2.17.1


[-- Attachment #2: Type: text/html, Size: 2770 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes
  2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
                   ` (3 preceding siblings ...)
  2020-07-22 19:47 ` [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Andrei Warkentin
@ 2020-08-13 13:50 ` Ard Biesheuvel
  4 siblings, 0 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2020-08-13 13:50 UTC (permalink / raw)
  To: Samer El-Haj-Mahmoud, devel; +Cc: Leif Lindholm, Pete Batard, Andrei Warkentin

On 7/22/20 4:01 AM, Samer El-Haj-Mahmoud wrote:
> This series fixes various failures reported by SCT for
> EFI_GRAPHICS_OUTPUT_PROTOCOL (https://github.com/pftf/RPi4/issues/73)
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Andrei Warkentin <awarkentin@vmware.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> Samer El-Haj-Mahmoud (3):
>    Platforms/RaspberryPi: Fix GOP parameter handling
>    Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode()
>    Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode()

Thanks

Pushed as f2e4f25b83bf..cf825de918f9

> 
>   .../Drivers/DisplayDxe/DisplayDxe.c           | 22 +++++++++++++++----
>   1 file changed, 18 insertions(+), 4 deletions(-)
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-13 13:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-22  2:01 [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Samer El-Haj-Mahmoud
2020-07-22  2:01 ` [edk2-platform][PATCH v1 1/3] Platforms/RaspberryPi: Fix GOP parameter handling Samer El-Haj-Mahmoud
2020-07-22  4:31   ` Andrei Warkentin
2020-07-22  2:01 ` [edk2-platform][PATCH v1 2/3] Platforms/RaspberryPi: Return GOP PixelInformation in QueryMode() Samer El-Haj-Mahmoud
2020-07-22  4:31   ` Andrei Warkentin
2020-07-22  2:01 ` [edk2-platform][PATCH v1 3/3] Platforms/RaspberryPi: Fix GOP FrameBufferSize returned by SetMode() Samer El-Haj-Mahmoud
2020-07-22  4:32   ` Andrei Warkentin
2020-07-22 19:47 ` [edk2-platform][PATCH v1 0/3] Platform/RaspberryPi : SCT EFI_GRAPHICS_OUTPUT_PROTOCOL fixes Andrei Warkentin
2020-08-13 13:50 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox