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://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> Reviewed-by:
Andrei Warkentin <awarkentin@vmware.com>
Loading
Please register or sign in to comment