UefiPayloadPkg/GraphicsOutputDxe: accept framebuffer BAR offsets

Some platforms place the linear framebuffer at an offset within the PCI
BAR (for example, Meteor Lake can use BAR2 + 0x800000). The existing
GraphicsOutputDxe validation requires the framebuffer base to match the
BAR base exactly, which rejects these configurations.

Relax the check to accept a framebuffer base within the BAR window, and
use the provided framebuffer base address when it falls within that
range.

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
Michał Kopeć 2024-05-02 13:21:01 +02:00 committed by Sean Rhodes
parent 27ac8fac0b
commit b77001b8ef

View file

@ -435,8 +435,11 @@ GraphicsOutputDriverBindingStart (
}
if (DeviceInfo->BarIndex == MAX_UINT8) {
if (Resources->AddrRangeMin == GraphicsInfo->FrameBufferBase) {
FrameBufferBase = Resources->AddrRangeMin;
if ( (GraphicsInfo->FrameBufferBase >= Resources->AddrRangeMin)
&& (GraphicsInfo->FrameBufferBase - Resources->AddrRangeMin <=
Resources->AddrLen - GraphicsInfo->FrameBufferSize))
{
FrameBufferBase = GraphicsInfo->FrameBufferBase;
break;
}
} else {