CorebootPayloadPkg/FbGop/FbGop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
According to UEFI Spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Mode->Info->
PixelsPerScanLine may contain padding pixel elements outside the area
covered by HorizontalResolution for performance reasons or due to hardware
restrictions. CorebootPayloadPkg's FbGop driver doesn't follow this
requirement, and produces PixelsPerScanLine simply as
HorizontalResolution. This needs to be fixed to reflect the real length
of a framebuffer scanline.
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Benjamin You <benjamin.you@intel.com>
---
CorebootPayloadPkg/FbGop/FbGop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/FbGop.c
index 6790617033..ecafc95ae3 100644
--- a/CorebootPayloadPkg/FbGop/FbGop.c
+++ b/CorebootPayloadPkg/FbGop/FbGop.c
@@ -893,7 +893,7 @@ FbGopCheckForVbe (
FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution = VerticalResolution;
FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat = CurrentModeData->PixelFormat;
CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), &mPixelBitMask, sizeof (EFI_PIXEL_BITMASK));
- FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = HorizontalResolution;
+ FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = (UINT32)(BytesPerScanLine * 8 / BitsPerPixel);
FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) CurrentModeData->LinearFrameBuffer;
FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize = CurrentModeData->FrameBufferSize;
--
2.14.3.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Thanks/Ray > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Benjamin You > Sent: Tuesday, January 30, 2018 4:39 PM > To: edk2-devel@lists.01.org > Cc: Agyeman, Prince <prince.agyeman@intel.com> > Subject: [edk2] [PATCH] CorebootPayloadPkg/FbGop: Produces correct > PixelsPerScanLine > > According to UEFI Spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Mode->Info-> > PixelsPerScanLine may contain padding pixel elements outside the area covered > by HorizontalResolution for performance reasons or due to hardware > restrictions. CorebootPayloadPkg's FbGop driver doesn't follow this requirement, > and produces PixelsPerScanLine simply as HorizontalResolution. This needs to be > fixed to reflect the real length of a framebuffer scanline. > > Cc: Maurice Ma <maurice.ma@intel.com> > Cc: Prince Agyeman <prince.agyeman@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Benjamin You <benjamin.you@intel.com> > --- > CorebootPayloadPkg/FbGop/FbGop.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/CorebootPayloadPkg/FbGop/FbGop.c > b/CorebootPayloadPkg/FbGop/FbGop.c > index 6790617033..ecafc95ae3 100644 > --- a/CorebootPayloadPkg/FbGop/FbGop.c > +++ b/CorebootPayloadPkg/FbGop/FbGop.c > @@ -893,7 +893,7 @@ FbGopCheckForVbe ( > FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution = > VerticalResolution; > FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat = > CurrentModeData->PixelFormat; > CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), > &mPixelBitMask, sizeof (EFI_PIXEL_BITMASK)); > - FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = > HorizontalResolution; > + FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = > + (UINT32)(BytesPerScanLine * 8 / BitsPerPixel); > FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo = > sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); > FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase = > (EFI_PHYSICAL_ADDRESS) (UINTN) CurrentModeData->LinearFrameBuffer; > FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize = CurrentModeData- > >FrameBufferSize; > -- > 2.14.3.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
© 2016 - 2024 Red Hat, Inc.