From nobody Fri May 17 10:13:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106744+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106744+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=posteo.net ARC-Seal: i=1; a=rsa-sha256; t=1688753061; cv=none; d=zohomail.com; s=zohoarc; b=AnzKXJju6RLb9PP1F9zbkNGJ7WOsl/nUx2NI3kNoGnrknb6UPkBxhxxL2OO+XJw44l3oPa26C8ArUG+pdMH0gKDvg3qByYyJRJc0D0xkOq9pl1zTo93f2kVThxmlKjJ9+ApH3hCFx1wO2OojdatKd/w34b95qdC3BNYOKu4DWps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688753061; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fIZvgKcHOFCN2Y8FRFy5lV+T/PJUJ3bbJs7qr4QwqYk=; b=XGiag6gswtoPnWkPW3KFVC10EJRC0myj1JpQ1WqPzpZ5m5I1gskcf/L24vZhtIPvsO1XKpb6b8g2TmcPzVsChOdN1nTWZqiZ0hTbjo2L3ojiU7OQUjDRWnxjWRWl/O7zCw2lDvtXufsrtKKhL5Q+HHcIcbPOUlUXQoa8rQZsYQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106744+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1688753061501484.29400614223664; Fri, 7 Jul 2023 11:04:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id L46FYY1788612xwewOE18gB0; Fri, 07 Jul 2023 11:04:21 -0700 X-Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web11.8675.1688721687130179105 for ; Fri, 07 Jul 2023 02:21:27 -0700 X-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5B867240027 for ; Fri, 7 Jul 2023 11:21:25 +0200 (CEST) X-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qy7F05gqtz6txj for ; Fri, 7 Jul 2023 11:21:24 +0200 (CEST) From: =?UTF-8?B?TWljaGFlbCBCw7xjaGxlcg==?= To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Match BAR if framebuffer is at an offset Date: Fri, 7 Jul 2023 09:20:45 +0000 Message-Id: <6deb621a0ab0123cf533876f2d2ff7037e2becca.1688720660.git.michael.buechler@posteo.net> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.buechler@posteo.net X-Gm-Message-State: ULZbmwxG0qpOXILs0HerlgkOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1688753061; bh=Y4iz941FKJg0SufEAaGPnGR1MnRvfZ5NOfnA9mhQaw4=; h=Content-Type:Date:From:Reply-To:Subject:To; b=iDgQ6zTeopRi5vKVLRIdSRNl1NRY+lxwKWm0Hg3kQRK7LUpacqnH6C0qJx4+tdAlyTr vZIIw6mmQPGvS7hrzK8+eefQk/zZzUwfVMVYsrPAJCXDV3PNuP17JEf5NHKRQ8UrplQv3 iBDrPqpcZ1CEjLyKBYiZP1Hsw3UFwDL69FE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1688753063420100003 Content-Type: text/plain; charset="utf-8" When the framebuffer region (starting address and address range) from the GraphicsInfo HOB is fully enclosed within a BAR region, but does not start on the same address as the BAR, it does not get matched to that BAR. The driver fails to bind to the graphics device and no graphics output is possible until the OS initializes its own driver. This was encountered on a PC with an Intel DQ67SW mainboard and a discrete GPU (Nvidia GTX 670) that is running coreboot with UefiPayload from the 'mrchromebox' or 'starlabsltd' fork of EDK II. coreboot runs the VGA BIOS which reports an address range for the framebuffer to coreboot. It is within one of its BAR regions, but not at the starting address (BAR2 at 0xE8000000 vs framebuffer at 0xE9000000). EDK II finds the framebuffer information provided by coreboot and later fails to find the correspondig BAR due to the behavior described above. With this patch, graphics output is working. Signed-off-by: Michael B=C3=BCchler --- UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c b/UefiPayloa= dPkg/GraphicsOutputDxe/GraphicsOutput.c index 39ad03fe32..eb657b46b5 100644 --- a/UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c +++ b/UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c @@ -435,9 +435,12 @@ GraphicsOutputDriverBindingStart ( } =20 if (DeviceInfo->BarIndex =3D=3D MAX_UINT8) { - if (Resources->AddrRangeMin =3D=3D GraphicsInfo->FrameBuffer= Base) { - FrameBufferBase =3D Resources->AddrRangeMin; - break; + if (GraphicsInfo->FrameBufferBase >=3D Resources->AddrRangeM= in) { + if ((GraphicsInfo->FrameBufferBase + GraphicsInfo->FrameBu= fferSize) <=3D (Resources->AddrRangeMin + Resources->AddrLen)) + { + FrameBufferBase =3D GraphicsInfo->FrameBufferBase; + break; + } } } else { break; --=20 2.39.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106744): https://edk2.groups.io/g/devel/message/106744 Mute This Topic: https://groups.io/mt/100011247/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-