From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.3157.1646983774813027901 for ; Thu, 10 Mar 2022 23:29:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LaT5T/Td; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646983774; x=1678519774; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=DKO+dAU68MXwEteJMyehx7EeRRaqkUzf8oBzYO/7eF4=; b=LaT5T/TdI6MzMJ0fwg8+pk3PMmzXWXWd1DpjG3kNOTCvABySqsC2J1bL HgjMzu3y7hfBCj4PIqefRBoh6nAezxUMgOXf3G9V02NxU6g2Qrc6AP4ZW uWMj0Jpc+YjusQHXJUF/4R6KOnU3EXBivIRymTXzW/I8WpLINiQmXK0Kg xqGdVomPKx2J4+OZ650ugz//5YShej6Gp7+nLLiRwEXsUJcOWu8JgPFau e392WJftFgOUlvvOin4NiRMJ8FlHZUOBKhMMOFT2ulNlFsmqTRx0VptKT hsiBAonjTNVBt0OT3he7gCeZSwaWWj+dtOzzHyN5JGo9PWpTmjwsZ+dei Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="341947609" X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="341947609" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 23:29:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208";a="633329032" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by FMSMGA003.fm.intel.com with ESMTP; 10 Mar 2022 23:29:33 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Mar 2022 23:29:33 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 10 Mar 2022 23:29:33 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Thu, 10 Mar 2022 23:29:33 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Thu, 10 Mar 2022 23:29:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dW7Zmx0Gz4P0Imffy1cA7lt+diP9D6Fo5P/EFUjxC443MIHpdeBSvS+h9p4kIZxDo8pqbAQVn+r1OF3wpiNANxyl2uqAItNtniG4OuqSR5qIcNp/IF4FwDJi77TxyoZaGmu0XEukYTSavfgcRsvSzo5K1AMBDwGVlT8KPMrYO8FwpIE8sNvii29FJeq8JyJ+C+8y/Iizr622meN5HqWYroEga6fCvQ/Eg6q5iGga5vrMNrwgRTSUVzXP9HPtGe3SMu93qqs7Yv9p8YoytUjb1FAH8Mt7cW1YdNi0sMOWNfCr61sq4XeY+WcRaW4tQ3uHGUI24BbO525Uf3UXAshV3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mcDVOcD9HSVytejjKH8UX44Nv8mwjX85sAvIXMFKftc=; b=lhEXTmlV943dBVXIlFQPL35RH+pyYv19TzgFA/b1vyqMhkxR6COoMVNBA9dLacXIab2YvfLcfaIQjTa7FVCaR+hHHeL4N5++iqtNWrTl9LoN37Zn9wmzpZ7K0T5oa50pIZ5FYB1N0QqEEpCyDC7DJ/oEfk5ggzoMuGk7f8zH5kXkb+Fx85gZeZ0d6HL88zNE+m956AN/MZuoCyf+8fRU1ZXlTXsGz0ppdO8J5LgJaNxpCYvfcWXgeu3oeysYddOLNXamUU6wns5q4aE1yon2mcMZXtxz23+KbNr2lMc30gcCoXXp6RHS3CPcX2b3neshZKXr+LFHJDcUpk75NkhZ+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by DM8PR11MB5606.namprd11.prod.outlook.com (2603:10b6:8:3c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Fri, 11 Mar 2022 07:29:29 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::99b6:d326:2925:4d2f]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::99b6:d326:2925:4d2f%3]) with mapi id 15.20.5061.024; Fri, 11 Mar 2022 07:29:29 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Jiang, Guomin" Subject: Re: [edk2-devel] [edk2-platforms Patch 3/3] OptionRomPkg: Remove all UGA support Thread-Topic: [edk2-devel] [edk2-platforms Patch 3/3] OptionRomPkg: Remove all UGA support Thread-Index: AQHYNOQyesVq84lBCk63LbihrmMnOay5yaYQ Date: Fri, 11 Mar 2022 07:29:29 +0000 Message-ID: References: <20220311010101.56-1-guomin.jiang@intel.com> <20220311010101.56-4-guomin.jiang@intel.com> In-Reply-To: <20220311010101.56-4-guomin.jiang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.401.20 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4700527b-ab4f-4c86-9e58-08da0330e0f9 x-ms-traffictypediagnostic: DM8PR11MB5606:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1aFch8O28MptTLq/7EefgCVzXTp5C2g2P8lWWOuyPDiVdlVq56T8p/sCXkQDWTyhoNyYJ2/qn2fnzGFPFYL/E3FDwexreiQed9n29Q9L4t1OBiU8ECfCxmeg3kekoNtHXuCqAk1hQyckJ5CJ5kFjRjH6WWrCtbGubz5J5HrK0KDJsK/sWReEGRf0bGnV43t9AIPrBOkWMN1VhY2m+NQYNVF7U1S00KFN2N6CFUWOlCQiNTr60Wr/wl3byMjiSQgr4WvmUJUJzTbKM9eGtC2rCoSLOdKPce4Mx2NJ6HRsLDlqjGuSEPT194fRaKQhdgVfCR2Q5I0FYdSEx1xP+52VqHjJAFI0NAetqgNhlC7EpI25HjSD0Y30BUQZ4WpcI1UpHaEVNK3M7KTBN+XU3rNtfacRm3wlJbMdN2iiq3B280UNjBD0K2PNNDFm7dFYR2g04chhTTepXlUMGdum49e/0bQCrYN1Wf5EctQ8w2JBF0PZgYAKUTe+YyoKQrOVc/gzrp4hGmVHu4FWrUuY7gBWHm43pR+2b1pNE+bIcVq+GpOKll20a/UvpWLCdhEKSo0dG8BaiPR1TZqlyYh0XwK/JVZ6biMJ6z0q+ISHzb/S3IU47UroIkKxykAHATMnNX5/4HUx6LAlaL4wVmeQ0xFwaw2phwOmJTEclg1Kt27F+4GSBWk0b830OhoFTxh0QlRSEHTPXmvwkdBAJ9GuNsxmHqMe7NMuiLqXFXijXefiy8yJwOYOs3lAqdJ2qtHYUZ3W4IiX1AY++NFbbEmxzwMFkqIGYxhTt+QSiugib9yh0Q/tbSYSRtnbY0+SfTtXn+ElRFce0WqOvYDlpdfJi1FIEqz99hvEKI72Wz8CQ2EdGJA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(966005)(45080400002)(508600001)(53546011)(71200400001)(186003)(9686003)(19627235002)(83380400001)(38070700005)(7696005)(82960400001)(52536014)(86362001)(122000001)(5660300002)(6506007)(33656002)(8936002)(8676002)(76116006)(66556008)(66946007)(66446008)(64756008)(30864003)(26005)(66476007)(55016003)(2906002)(110136005)(6636002)(316002)(38100700002)(579004)(559001)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fKiM28JQOJvonkmzi7N5KjsxeCj2amz/2xqqVEPTDufi/078nAQb+SaSDK1V?= =?us-ascii?Q?DSLATemT9ELP/O8AK6Ab8yFgYvIzFD7m6glt+7eyiAZ74tIM8K3Ycbr3Fh5r?= =?us-ascii?Q?6dZQPbNfEEGmdCs0hjBMGD2uAkDSmiSmOmySanfUzFiwHke++G3gywe27Uvy?= =?us-ascii?Q?Wr4M/3h4/57RY7AOS/iE5leAZPgPvLMRQ3X7/lLB4UjlMiW6YbkqO00b8IBq?= =?us-ascii?Q?b7PGUrkPMlVRjxpJWdDsfB2vb5rH3AH7Ek7cvvoUvsH8wkwZg9m4ZLY8Nves?= =?us-ascii?Q?PEVU9VrB0xXq1UlCkLoQVnoKkErRlc7QsAehNEzWaKp0eqgwDIarq54QNedw?= =?us-ascii?Q?YcrfDTbSXoo4OHzjb7EDkW7fzpGPJWUQ8xj+UcpQkKzgUhRIqzmjZL7yzLVA?= =?us-ascii?Q?DVTczFdTHuL4ZSX7E9D6GvUP0nMYRpYS5GT547h0COt5+VVQbsYkXmkWb0JV?= =?us-ascii?Q?6ymWkDezM1cFeGzCaSmnZ3rwv7yt3CumIwfQsmzKPgW++MvN6Oz0RPsQWSS3?= =?us-ascii?Q?nR1reLqEGinSpIJdIKNvdHewo1YxK6brFvaD+XWI0idB4TdsOBo+qzsejPYv?= =?us-ascii?Q?6QJ7JHz8y1Pwc69zPFH9uPalSseeqP62nFGU5xVlEJaCErbxIZXhFvx7bHtg?= =?us-ascii?Q?J6XrAkYkzfSh+HLuhMmAI1jyCNyxzc9oxFUL/nVfuIl3Vr2irpn0JueI8PzF?= =?us-ascii?Q?xynC6Ha//wxtSNRbAaT+cMctK0GShfaYF6WiOgscBMyYOwtAtV9nib/dqUfF?= =?us-ascii?Q?eeTl1fcSej2hCli/EbXwi19lJjnD2lIij/WuFtDchmgNEAdqXrjMLKf1jfeU?= =?us-ascii?Q?rl+L7IxSB/JQIEVp7EneKPz+mp22xAkP6chuR7z09xlKIkU2t7pJtIES92j4?= =?us-ascii?Q?idI33pVYY/sCzcdJbLLBVmYzPY/MOyHBzX6RPZ50PR0ScaqF7a1GXNYbltVT?= =?us-ascii?Q?eroTH59xXv4jt1OaXOPcRjnh+kmcwkFUKIytsFr+RfUJnnsFyOGEmTV/61Mc?= =?us-ascii?Q?NuOV1olWc3Cx4C/5c7igyquWiK2J4vHLWrlGSY2PUWWTn1a7Ac1b5IAdN0FV?= =?us-ascii?Q?AA/X5PlGIi8BK/WV2kwjVCawjB67Z+Es4eccVmMm8YRsjfKpRXMHIXET+Jts?= =?us-ascii?Q?lk3Qlh0vOdrJRiAUrCe5ZRHL/xZmkIurgfz1dpdktnsr+HcSC9DF+dhL52mX?= =?us-ascii?Q?eaWhOibBuDoABJJE6cUZb5YmklNtW93SS30uQ09b5JObXe4x5ztpOJg/mHy8?= =?us-ascii?Q?+1q1YT8A4A7VST++XZJDsKALWSv7+UqczW8x5Do88VEwK8Y6GUbYCdsIHm7O?= =?us-ascii?Q?3W6otPp213tQgclvPAZ/cON4xwGL6y0xLI1jQ7kZI1LeZYAKOG3BXvl+U4nP?= =?us-ascii?Q?ReHo6+eEzM72T2uauA9pLUFP5/2CAQF/ixVYZ1/UaKTrmNH8SFTi98X1s+RF?= =?us-ascii?Q?JK2PASGGNWYNR6CvAWBo3OLEKz29/ijUL1RUcWiG03mg67BKsmSsu9ONVFvY?= =?us-ascii?Q?UOHNeFRnfIoZ6SjsLP8su9IM0T6Hspu/XzZmTDjzx8pBfYG8lYM7L5AUWUCH?= =?us-ascii?Q?BNV4bE9PjeS7CKz1wIxEQYH1Thl98mGunIB+TSrB5firrSoXetvmnU4KUQMp?= =?us-ascii?Q?mg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4700527b-ab4f-4c86-9e58-08da0330e0f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2022 07:29:29.2865 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sATFPgWYmNKaM3df1vy6hruh/k7M9bQURixsPl58spV8Xrgg300d6O6OyV/9GILPdbDhJQXo4EP99wCuuPr+Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5606 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can you avoid changing the spaces? -----Original Message----- From: devel@edk2.groups.io On Behalf Of Guomin Jiang Sent: Friday, March 11, 2022 9:01 AM To: devel@edk2.groups.io Cc: Ni, Ray Subject: [edk2-devel] [edk2-platforms Patch 3/3] OptionRomPkg: Remove all U= GA support REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2368 Remove all UGA support Cc: Ray Ni Signed-off-by: Guomin Jiang --- .../CirrusLogic5430Dxe/CirrusLogic5430.c | 522 +++++++----------- .../CirrusLogic5430Dxe/CirrusLogic5430.h | 136 ++--- .../CirrusLogic5430Dxe/CirrusLogic5430Dxe.inf | 9 +- .../CirrusLogic5430UgaDraw.c | 412 -------------- Drivers/OptionRomPkg/OptionRomPkg.dec | 3 - 5 files changed, 271 insertions(+), 811 deletions(-) delete mode 100644 Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430= UgaDraw.c diff --git a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c b/Dr= ivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c index 4e7830ea94b3..a2f2c2ff60f4 100644 --- a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c +++ b/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.c @@ -11,7 +11,7 @@ documentation on UGA for details on how to write a UGA driver that is ab= le to function both in the EFI pre-boot environment and from the OS runtime= . =20 - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -21,7 +21,7 @@ // #include "CirrusLogic5430.h" =20 -EFI_DRIVER_BINDING_PROTOCOL gCirrusLogic5430DriverBinding =3D { +EFI_DRIVER_BINDING_PROTOCOL gCirrusLogic5430DriverBinding =3D { CirrusLogic5430ControllerDriverSupported, CirrusLogic5430ControllerDriverStart, CirrusLogic5430ControllerDriverStop, @@ -42,21 +42,21 @@ UINT8 AttributeController[21] =3D { /// /// Generic Graphics Controller Register Settings /// -UINT8 GraphicsController[9] =3D { +UINT8 GraphicsController[9] =3D { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF }; =20 // // 640 x 480 x 256 color @ 60 Hertz // -UINT8 Crtc_640_480_256_60[28] =3D { +UINT8 Crtc_640_480_256_60[28] =3D { 0x5d, 0x4f, 0x50, 0x82, 0x53, 0x9f, 0x00, 0x3e, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x83, 0xdf, 0x50, 0x00, 0xe7, 0x04, 0xe3, 0xff, 0x00, 0x00, 0x22 }; =20 -UINT16 Seq_640_480_256_60[15] =3D { +UINT16 Seq_640_480_256_60[15] =3D { 0x0100, 0x0101, 0x0f02, 0x0003, 0x0e04, 0x1107, 0x0008, 0x4a0b, 0x5b0c, 0x450d, 0x7e0e, 0x2b1b, 0x2f1c, 0x301d, 0x331e }; @@ -64,14 +64,14 @@ UINT16 Seq_640_480_256_60[15] =3D { // // 800 x 600 x 256 color @ 60 Hertz // -UINT8 Crtc_800_600_256_60[28] =3D { +UINT8 Crtc_800_600_256_60[28] =3D { 0x7F, 0x63, 0x64, 0x80, 0x6B, 0x1B, 0x72, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x8C, 0x57, 0x64, 0x00, 0x5F, 0x91, 0xE3, 0xFF, 0x00, 0x00, 0x22 }; =20 -UINT16 Seq_800_600_256_60[15] =3D { +UINT16 Seq_800_600_256_60[15] =3D { 0x0100, 0x0101, 0x0f02, 0x0003, 0x0e04, 0x1107, 0x0008, 0x4a0b, 0x5b0c, 0x450d, 0x510e, 0x2b1b, 0x2f1c, 0x301d, 0x3a1e }; @@ -79,14 +79,14 @@ UINT16 Seq_800_600_256_60[15] =3D { // // 1024 x 768 x 256 color @ 60 Hertz // -UINT8 Crtc_1024_768_256_60[28] =3D { +UINT8 Crtc_1024_768_256_60[28] =3D { 0xA3, 0x7F, 0x80, 0x86, 0x85, 0x96, 0x24, 0xFD, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x88, 0xFF, 0x80, 0x00, 0x00, 0x24, 0xE3, 0xFF, 0x4A, 0x00, 0x22 }; =20 -UINT16 Seq_1024_768_256_60[15] =3D { +UINT16 Seq_1024_768_256_60[15] =3D { 0x0100, 0x0101, 0x0f02, 0x0003, 0x0e04, 0x1107, 0x0008, 0x4a0b, 0x5b0c, 0x450d, 0x760e, 0x2b1b, 0x2f1c, 0x301d, 0x341e }; @@ -95,12 +95,11 @@ UINT16 Seq_1024_768_256_60[15] =3D { /// Table of supported video modes /// CIRRUS_LOGIC_5430_VIDEO_MODES CirrusLogic5430VideoModes[] =3D { - { 640, 480, 8, 60, Crtc_640_480_256_60, Seq_640_480_256_60, 0xe3 }, - { 800, 600, 8, 60, Crtc_800_600_256_60, Seq_800_600_256_60, 0xef }, + { 640, 480, 8, 60, Crtc_640_480_256_60, Seq_640_480_256_60, 0xe3 }, + { 800, 600, 8, 60, Crtc_800_600_256_60, Seq_800_600_256_60, 0xef }, { 1024, 768, 8, 60, Crtc_1024_768_256_60, Seq_1024_768_256_60, 0xef } }; =20 - /** CirrusLogic5430ControllerDriverSupported =20 @@ -111,15 +110,15 @@ CIRRUS_LOGIC_5430_VIDEO_MODES CirrusLogic5430VideoMo= des[] =3D { EFI_STATUS EFIAPI CirrusLogic5430ControllerDriverSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE Controller, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { - EFI_STATUS Status; - EFI_PCI_IO_PROTOCOL *PciIo; - PCI_TYPE00 Pci; - EFI_DEV_PATH *Node; + EFI_STATUS Status; + EFI_PCI_IO_PROTOCOL *PciIo; + PCI_TYPE00 Pci; + EFI_DEV_PATH *Node; =20 // // Open the PCI I/O Protocol @@ -127,7 +126,7 @@ CirrusLogic5430ControllerDriverSupported ( Status =3D gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, + (VOID **)&PciIo, This->DriverBindingHandle, Controller, EFI_OPEN_PROTOCOL_BY_DRIVER @@ -163,19 +162,19 @@ CirrusLogic5430ControllerDriverSupported ( // // See if this is a 5430 or a 5446 PCI controller // - if (Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5430_DEVICE_ID ||=20 - Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID || - Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5446_DEVICE_ID) { - =20 + if ((Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5430_DEVICE_ID) || + (Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID) || + (Pci.Hdr.DeviceId =3D=3D CIRRUS_LOGIC_5446_DEVICE_ID)) + { Status =3D EFI_SUCCESS; // // If this is an Intel 945 graphics controller, // go further check RemainingDevicePath validation // if (RemainingDevicePath !=3D NULL) { - Node =3D (EFI_DEV_PATH *) RemainingDevicePath; + Node =3D (EFI_DEV_PATH *)RemainingDevicePath; // - // Check if RemainingDevicePath is the End of Device Path Node,=20 + // Check if RemainingDevicePath is the End of Device Path Node, // if yes, return EFI_SUCCESS // if (!IsDevicePathEnd (Node)) { @@ -183,9 +182,10 @@ CirrusLogic5430ControllerDriverSupported ( // If RemainingDevicePath isn't the End of Device Path Node, // check its validation // - if (Node->DevPath.Type !=3D ACPI_DEVICE_PATH || - Node->DevPath.SubType !=3D ACPI_ADR_DP || - DevicePathNodeLength(&Node->DevPath) !=3D sizeof(ACPI_ADR_DE= VICE_PATH)) { + if ((Node->DevPath.Type !=3D ACPI_DEVICE_PATH) || + (Node->DevPath.SubType !=3D ACPI_ADR_DP) || + (DevicePathNodeLength (&Node->DevPath) !=3D sizeof (ACPI_ADR= _DEVICE_PATH))) + { Status =3D EFI_UNSUPPORTED; } } @@ -198,11 +198,11 @@ Done: // Close the PCI I/O Protocol // gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); + Controller, + &gEfiPciIoProtocolGuid, + This->DriverBindingHandle, + Controller + ); =20 return Status; } @@ -217,9 +217,9 @@ Done: EFI_STATUS EFIAPI CirrusLogic5430ControllerDriverStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE Controller, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { EFI_STATUS Status; @@ -242,8 +242,8 @@ CirrusLogic5430ControllerDriverStart ( // // Set up context record // - Private->Signature =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE; - Private->Handle =3D NULL; + Private->Signature =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE; + Private->Handle =3D NULL; =20 // // Open PCI I/O Protocol @@ -251,7 +251,7 @@ CirrusLogic5430ControllerDriverStart ( Status =3D gBS->OpenProtocol ( Controller, &gEfiPciIoProtocolGuid, - (VOID **) &Private->PciIo, + (VOID **)&Private->PciIo, This->DriverBindingHandle, Controller, EFI_OPEN_PROTOCOL_BY_DRIVER @@ -274,24 +274,25 @@ CirrusLogic5430ControllerDriverStart ( } =20 Supports &=3D (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO= _16); - if (Supports =3D=3D 0 || Supports =3D=3D (EFI_PCI_IO_ATTRIBUTE_VGA_IO | = EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) { + if ((Supports =3D=3D 0) || (Supports =3D=3D (EFI_PCI_IO_ATTRIBUTE_VGA_IO= | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16))) { Status =3D EFI_UNSUPPORTED; goto Error; - } =20 + } =20 // // Save original PCI attributes // Status =3D Private->PciIo->Attributes ( - Private->PciIo, - EfiPciIoAttributeOperationGet, - 0, - &Private->OriginalPciAttributes - ); + Private->PciIo, + EfiPciIoAttributeOperationGet, + 0, + &Private->OriginalPciAttributes + ); =20 if (EFI_ERROR (Status)) { goto Error; } + PciAttributesSaved =3D TRUE; =20 Status =3D Private->PciIo->Attributes ( @@ -310,53 +311,51 @@ CirrusLogic5430ControllerDriverStart ( Status =3D gBS->HandleProtocol ( Controller, &gEfiDevicePathProtocolGuid, - (VOID **) &ParentDevicePath + (VOID **)&ParentDevicePath ); if (EFI_ERROR (Status)) { goto Error; } =20 - if (FeaturePcdGet (PcdSupportGop)) { + // + // Set Gop Device Path + // + if (RemainingDevicePath =3D=3D NULL) { + ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH)); + AcpiDeviceNode.Header.Type =3D ACPI_DEVICE_PATH; + AcpiDeviceNode.Header.SubType =3D ACPI_ADR_DP; + AcpiDeviceNode.ADR =3D ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACP= I_ADR_DISPLAY_TYPE_VGA, 0, 0); + SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVI= CE_PATH)); + + Private->GopDevicePath =3D AppendDevicePathNode ( + ParentDevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)&AcpiDeviceNode + ); + } else if (!IsDevicePathEnd (RemainingDevicePath)) { + // + // If RemainingDevicePath isn't the End of Device Path Node, + // only scan the specified device by RemainingDevicePath + // + Private->GopDevicePath =3D AppendDevicePathNode (ParentDevicePath, Rem= ainingDevicePath); + } else { // - // Set Gop Device Path + // If RemainingDevicePath is the End of Device Path Node, + // don't create child device and return EFI_SUCCESS // - if (RemainingDevicePath =3D=3D NULL) { - ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH)); - AcpiDeviceNode.Header.Type =3D ACPI_DEVICE_PATH; - AcpiDeviceNode.Header.SubType =3D ACPI_ADR_DP; - AcpiDeviceNode.ADR =3D ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DIS= PLAY_TYPE_VGA, 0, 0); - SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DE= VICE_PATH)); + Private->GopDevicePath =3D NULL; + } =20 - Private->GopDevicePath =3D AppendDevicePathNode ( - ParentDevicePath, - (EFI_DEVICE_PATH_PROTOCOL *) &Ac= piDeviceNode - ); - } else if (!IsDevicePathEnd (RemainingDevicePath)) { - // - // If RemainingDevicePath isn't the End of Device Path Node,=20 - // only scan the specified device by RemainingDevicePath - // - Private->GopDevicePath =3D AppendDevicePathNode (ParentDevicePath, R= emainingDevicePath); - } else { - // - // If RemainingDevicePath is the End of Device Path Node,=20 - // don't create child device and return EFI_SUCCESS - // - Private->GopDevicePath =3D NULL; - } - =20 - if (Private->GopDevicePath !=3D NULL) { - // - // Creat child handle and device path protocol firstly - // - Private->Handle =3D NULL; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Private->Handle, - &gEfiDevicePathProtocolGuid, - Private->GopDevicePath, - NULL - ); - } + if (Private->GopDevicePath !=3D NULL) { + // + // Creat child handle and device path protocol firstly + // + Private->Handle =3D NULL; + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &Private->Handle, + &gEfiDevicePathProtocolGuid, + Private->GopDevicePath, + NULL + ); } =20 // @@ -367,57 +366,22 @@ CirrusLogic5430ControllerDriverStart ( goto Error; } =20 - if (FeaturePcdGet (PcdSupportUga)) { - // - // Start the UGA Draw software stack. - // - Status =3D CirrusLogic5430UgaDrawConstructor (Private); - ASSERT_EFI_ERROR (Status); - - Private->UgaDevicePath =3D ParentDevicePath; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Controller, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw, - &gEfiDevicePathProtocolGuid, - Private->UgaDevicePath, - NULL - ); - - } else if (FeaturePcdGet (PcdSupportGop)) { - if (Private->GopDevicePath =3D=3D NULL) { - // - // If RemainingDevicePath is the End of Device Path Node,=20 - // don't create child device and return EFI_SUCCESS - // - Status =3D EFI_SUCCESS; - } else { - =20 - // - // Start the GOP software stack. - // - Status =3D CirrusLogic5430GraphicsOutputConstructor (Private); - ASSERT_EFI_ERROR (Status); - =20 - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Private->Handle, - &gEfiGraphicsOutputProtocolGuid, - &Private->GraphicsOutput, - &gEfiEdidDiscoveredProtocolGuid, - &Private->EdidDiscovered, - &gEfiEdidActiveProtocolGuid, - &Private->EdidActive, - NULL - ); - } - } else { - // - // This driver must support eithor GOP or UGA or both. - // - ASSERT (FALSE); - Status =3D EFI_UNSUPPORTED; - } + // + // Start the GOP software stack. + // + Status =3D CirrusLogic5430GraphicsOutputConstructor (Private); + ASSERT_EFI_ERROR (Status); =20 + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &Private->Handle, + &gEfiGraphicsOutputProtocolGuid, + &Private->GraphicsOutput, + &gEfiEdidDiscoveredProtocolGuid, + &Private->EdidDiscovered, + &gEfiEdidActiveProtocolGuid, + &Private->EdidActive, + NULL + ); =20 Error: if (EFI_ERROR (Status)) { @@ -428,21 +392,22 @@ Error: // Restore original PCI attributes // Private->PciIo->Attributes ( - Private->PciIo, - EfiPciIoAttributeOperationSet, - Private->OriginalPciAttributes, - NULL - ); + Private->PciIo, + EfiPciIoAttributeOperationSet, + Private->OriginalPciAttributes, + NULL + ); } + // // Close the PCI I/O Protocol // gBS->CloseProtocol ( - Private->Handle, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Private->Handle - ); + Private->Handle, + &gEfiPciIoProtocolGuid, + This->DriverBindingHandle, + Private->Handle + ); } =20 gBS->FreePool (Private); @@ -464,92 +429,45 @@ Error: EFI_STATUS EFIAPI CirrusLogic5430ControllerDriverStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE Controller, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer ) { - EFI_UGA_DRAW_PROTOCOL *UgaDraw; - EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; + EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; =20 EFI_STATUS Status; CIRRUS_LOGIC_5430_PRIVATE_DATA *Private; =20 - if (FeaturePcdGet (PcdSupportUga)) { - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiUgaDrawProtocolGuid, - (VOID **) &UgaDraw, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return Status; - } - // - // Get our private context information - // - Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (UgaDraw= ); - CirrusLogic5430UgaDrawDestructor (Private); - - if (FeaturePcdGet (PcdSupportGop)) { - CirrusLogic5430GraphicsOutputDestructor (Private); - // - // Remove the UGA and GOP protocol interface from the system - // - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Private->Handle, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw, - &gEfiGraphicsOutputProtocolGuid, - &Private->GraphicsOutput, - NULL - ); - } else { - // - // Remove the UGA Draw interface from the system - // - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Private->Handle, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw, - NULL - ); - } - } else { - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiGraphicsOutputProtocolGuid, - (VOID **) &GraphicsOutput, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Get our private context information - // - Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (= GraphicsOutput); - - CirrusLogic5430GraphicsOutputDestructor (Private); - // - // Remove the GOP protocol interface from the system - // - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Private->Handle, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw, - &gEfiGraphicsOutputProtocolGuid, - &Private->GraphicsOutput, - NULL - ); + Status =3D gBS->OpenProtocol ( + Controller, + &gEfiGraphicsOutputProtocolGuid, + (VOID **)&GraphicsOutput, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return Status; } =20 + // + // Get our private context information + // + Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (Gr= aphicsOutput); + + CirrusLogic5430GraphicsOutputDestructor (Private); + // + // Remove the GOP protocol interface from the system + // + Status =3D gBS->UninstallMultipleProtocolInterfaces ( + Private->Handle, + &gEfiGraphicsOutputProtocolGuid, + &Private->GraphicsOutput, + NULL + ); + if (EFI_ERROR (Status)) { return Status; } @@ -558,21 +476,21 @@ CirrusLogic5430ControllerDriverStop ( // Restore original PCI attributes // Private->PciIo->Attributes ( - Private->PciIo, - EfiPciIoAttributeOperationSet, - Private->OriginalPciAttributes, - NULL - ); + Private->PciIo, + EfiPciIoAttributeOperationSet, + Private->OriginalPciAttributes, + NULL + ); =20 // // Close the PCI I/O Protocol // gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); + Controller, + &gEfiPciIoProtocolGuid, + This->DriverBindingHandle, + Controller + ); =20 // // Free our instance data @@ -582,20 +500,6 @@ CirrusLogic5430ControllerDriverStop ( return EFI_SUCCESS; } =20 -/** - CirrusLogic5430UgaDrawDestructor - - TODO: Private - add argument and description to function comment - TODO: EFI_SUCCESS - add return value to function comment -**/ -EFI_STATUS -CirrusLogic5430UgaDrawDestructor ( - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private - ) -{ - return EFI_SUCCESS; -} - /** TODO: Add function description =20 @@ -614,13 +518,13 @@ outb ( ) { Private->PciIo->Io.Write ( - Private->PciIo, - EfiPciIoWidthUint8, - EFI_PCI_IO_PASS_THROUGH_BAR, - Address, - 1, - &Data - ); + Private->PciIo, + EfiPciIoWidthUint8, + EFI_PCI_IO_PASS_THROUGH_BAR, + Address, + 1, + &Data + ); } =20 /** @@ -641,13 +545,13 @@ outw ( ) { Private->PciIo->Io.Write ( - Private->PciIo, - EfiPciIoWidthUint16, - EFI_PCI_IO_PASS_THROUGH_BAR, - Address, - 1, - &Data - ); + Private->PciIo, + EfiPciIoWidthUint16, + EFI_PCI_IO_PASS_THROUGH_BAR, + Address, + 1, + &Data + ); } =20 /** @@ -665,16 +569,16 @@ inb ( UINTN Address ) { - UINT8 Data; + UINT8 Data; =20 Private->PciIo->Io.Read ( - Private->PciIo, - EfiPciIoWidthUint8, - EFI_PCI_IO_PASS_THROUGH_BAR, - Address, - 1, - &Data - ); + Private->PciIo, + EfiPciIoWidthUint8, + EFI_PCI_IO_PASS_THROUGH_BAR, + Address, + 1, + &Data + ); return Data; } =20 @@ -696,13 +600,13 @@ inw ( UINT16 Data; =20 Private->PciIo->Io.Read ( - Private->PciIo, - EfiPciIoWidthUint16, - EFI_PCI_IO_PASS_THROUGH_BAR, - Address, - 1, - &Data - ); + Private->PciIo, + EfiPciIoWidthUint16, + EFI_PCI_IO_PASS_THROUGH_BAR, + Address, + 1, + &Data + ); return Data; } =20 @@ -727,10 +631,10 @@ SetPaletteColor ( UINT8 Blue ) { - outb (Private, PALETTE_INDEX_REGISTER, (UINT8) Index); - outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Red >> 2)); - outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Green >> 2)); - outb (Private, PALETTE_DATA_REGISTER, (UINT8) (Blue >> 2)); + outb (Private, PALETTE_INDEX_REGISTER, (UINT8)Index); + outb (Private, PALETTE_DATA_REGISTER, (UINT8)(Red >> 2)); + outb (Private, PALETTE_DATA_REGISTER, (UINT8)(Green >> 2)); + outb (Private, PALETTE_DATA_REGISTER, (UINT8)(Blue >> 2)); } =20 /** @@ -746,16 +650,16 @@ SetDefaultPalette ( CIRRUS_LOGIC_5430_PRIVATE_DATA *Private ) { - UINTN Index; - UINTN RedIndex; - UINTN GreenIndex; - UINTN BlueIndex; + UINTN Index; + UINTN RedIndex; + UINTN GreenIndex; + UINTN BlueIndex; =20 Index =3D 0; for (RedIndex =3D 0; RedIndex < 8; RedIndex++) { for (GreenIndex =3D 0; GreenIndex < 8; GreenIndex++) { for (BlueIndex =3D 0; BlueIndex < 4; BlueIndex++) { - SetPaletteColor (Private, Index, (UINT8) (RedIndex << 5), (UINT8) = (GreenIndex << 5), (UINT8) (BlueIndex << 6)); + SetPaletteColor (Private, Index, (UINT8)(RedIndex << 5), (UINT8)(G= reenIndex << 5), (UINT8)(BlueIndex << 6)); Index++; } } @@ -820,18 +724,18 @@ InitializeGraphicsMode ( CIRRUS_LOGIC_5430_VIDEO_MODES *ModeData ) { - UINT8 Byte; - UINTN Index; - UINT16 DeviceId; - EFI_STATUS Status; + UINT8 Byte; + UINTN Index; + UINT16 DeviceId; + EFI_STATUS Status; =20 Status =3D Private->PciIo->Pci.Read ( - Private->PciIo, - EfiPciIoWidthUint16, - PCI_DEVICE_ID_OFFSET, - 1, - &DeviceId - ); + Private->PciIo, + EfiPciIoWidthUint16, + PCI_DEVICE_ID_OFFSET, + 1, + &DeviceId + ); // // Read the PCI Configuration Header from the PCI Device // @@ -846,7 +750,7 @@ InitializeGraphicsMode ( =20 if (DeviceId !=3D CIRRUS_LOGIC_5446_DEVICE_ID) { outb (Private, SEQ_ADDRESS_REGISTER, 0x0f); - Byte =3D (UINT8) ((inb (Private, SEQ_DATA_REGISTER) & 0xc7) ^ 0x30); + Byte =3D (UINT8)((inb (Private, SEQ_DATA_REGISTER) & 0xc7) ^ 0x30); outb (Private, SEQ_DATA_REGISTER, Byte); } =20 @@ -856,17 +760,17 @@ InitializeGraphicsMode ( outw (Private, CRTC_ADDRESS_REGISTER, 0x2011); =20 for (Index =3D 0; Index < 28; Index++) { - outw (Private, CRTC_ADDRESS_REGISTER, (UINT16) ((ModeData->CrtcSetting= s[Index] << 8) | Index)); + outw (Private, CRTC_ADDRESS_REGISTER, (UINT16)((ModeData->CrtcSettings= [Index] << 8) | Index)); } =20 for (Index =3D 0; Index < 9; Index++) { - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((GraphicsController[I= ndex] << 8) | Index)); + outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16)((GraphicsController[In= dex] << 8) | Index)); } =20 inb (Private, INPUT_STATUS_1_REGISTER); =20 for (Index =3D 0; Index < 21; Index++) { - outb (Private, ATT_ADDRESS_REGISTER, (UINT8) Index); + outb (Private, ATT_ADDRESS_REGISTER, (UINT8)Index); outb (Private, ATT_ADDRESS_REGISTER, AttributeController[Index]); } =20 @@ -884,11 +788,11 @@ InitializeGraphicsMode ( EFI_STATUS EFIAPI InitializeCirrusLogic5430 ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; + EFI_STATUS Status; =20 Status =3D EfiLibInstallDriverBindingComponentName2 ( ImageHandle, @@ -905,12 +809,12 @@ InitializeCirrusLogic5430 ( // EFI drivers that are on PCI and other plug in cards. // gCirrusLogic5430DriverSupportedEfiVersion.FirmwareVersion =3D PcdGet32 (= PcdDriverSupportedEfiVersion); - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &ImageHandle, - &gEfiDriverSupportedEfiVersionProtocolGuid, - &gCirrusLogic5430DriverSupportedEfiVersion, - NULL - ); + Status =3D gBS->Insta= llMultipleProtocolInterfaces ( + &Imag= eHandle, + &gEfi= DriverSupportedEfiVersionProtocolGuid, + &gCir= rusLogic5430DriverSupportedEfiVersion, + NULL + ); ASSERT_EFI_ERROR (Status); =20 return Status; diff --git a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.h b/Dr= ivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.h index 355f0418b3b5..13ecc72caa31 100644 --- a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.h +++ b/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.h @@ -1,7 +1,7 @@ /** @file Cirrus Logic 5430 Controller Driver =20 - Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -13,9 +13,7 @@ #ifndef _CIRRUS_LOGIC_5430_H_ #define _CIRRUS_LOGIC_5430_H_ =20 - #include -#include #include #include #include @@ -38,36 +36,36 @@ // // Cirrus Logic 5430 PCI Configuration Header values // -#define CIRRUS_LOGIC_VENDOR_ID 0x1013 -#define CIRRUS_LOGIC_5430_DEVICE_ID 0x00a8 -#define CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID 0x00a0 -#define CIRRUS_LOGIC_5446_DEVICE_ID 0x00b8 +#define CIRRUS_LOGIC_VENDOR_ID 0x1013 +#define CIRRUS_LOGIC_5430_DEVICE_ID 0x00a8 +#define CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID 0x00a0 +#define CIRRUS_LOGIC_5446_DEVICE_ID 0x00b8 =20 // // Cirrus Logic Graphical Mode Data // -#define CIRRUS_LOGIC_5430_MODE_COUNT 3 +#define CIRRUS_LOGIC_5430_MODE_COUNT 3 =20 typedef struct { - UINT32 ModeNumber; - UINT32 HorizontalResolution; - UINT32 VerticalResolution; - UINT32 ColorDepth; - UINT32 RefreshRate; + UINT32 ModeNumber; + UINT32 HorizontalResolution; + UINT32 VerticalResolution; + UINT32 ColorDepth; + UINT32 RefreshRate; } CIRRUS_LOGIC_5430_MODE_DATA; =20 -#define PIXEL_RED_SHIFT 0 -#define PIXEL_GREEN_SHIFT 3 -#define PIXEL_BLUE_SHIFT 6 +#define PIXEL_RED_SHIFT 0 +#define PIXEL_GREEN_SHIFT 3 +#define PIXEL_BLUE_SHIFT 6 =20 #define PIXEL_RED_MASK (BIT7 | BIT6 | BIT5) #define PIXEL_GREEN_MASK (BIT4 | BIT3 | BIT2) #define PIXEL_BLUE_MASK (BIT1 | BIT0) =20 -#define PIXEL_TO_COLOR_BYTE(pixel, mask, shift) ((UINT8) ((pixel & mask) <= < shift)) -#define PIXEL_TO_RED_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_RED_MASK= , PIXEL_RED_SHIFT) -#define PIXEL_TO_GREEN_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_GREEN_= MASK, PIXEL_GREEN_SHIFT) -#define PIXEL_TO_BLUE_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_BLUE_MA= SK, PIXEL_BLUE_SHIFT) +#define PIXEL_TO_COLOR_BYTE(pixel, mask, shift) ((UINT8) ((pixel & mask) = << shift)) +#define PIXEL_TO_RED_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel= , PIXEL_RED_MASK, PIXEL_RED_SHIFT) +#define PIXEL_TO_GREEN_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel= , PIXEL_GREEN_MASK, PIXEL_GREEN_SHIFT) +#define PIXEL_TO_BLUE_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel= , PIXEL_BLUE_MASK, PIXEL_BLUE_SHIFT) =20 #define RGB_BYTES_TO_PIXEL(Red, Green, Blue) \ (UINT8) ( (((Red) >> PIXEL_RED_SHIFT) & PIXEL_RED_MASK) | \ @@ -82,43 +80,37 @@ typedef struct { #define CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('C', 'L', = '5', '4') =20 typedef struct { - UINT64 Signature; - EFI_HANDLE Handle; - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 OriginalPciAttributes; - EFI_UGA_DRAW_PROTOCOL UgaDraw; - EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput; - EFI_EDID_DISCOVERED_PROTOCOL EdidDiscovered; - EFI_EDID_ACTIVE_PROTOCOL EdidActive; - EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; - EFI_DEVICE_PATH_PROTOCOL *UgaDevicePath; - UINTN CurrentMode; - UINTN MaxMode; - CIRRUS_LOGIC_5430_MODE_DATA ModeData[CIRRUS_LOGIC_5430_MODE_CO= UNT]; - UINT8 *LineBuffer; - BOOLEAN HardwareNeedsStarting; + UINT64 Signature; + EFI_HANDLE Handle; + EFI_PCI_IO_PROTOCOL *PciIo; + UINT64 OriginalPciAttributes; + EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput; + EFI_EDID_DISCOVERED_PROTOCOL EdidDiscovered; + EFI_EDID_ACTIVE_PROTOCOL EdidActive; + EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; + UINTN CurrentMode; + UINTN MaxMode; + CIRRUS_LOGIC_5430_MODE_DATA ModeData[CIRRUS_LOGIC_5430_MODE_COUNT]; + UINT8 *LineBuffer; + BOOLEAN HardwareNeedsStarting; } CIRRUS_LOGIC_5430_PRIVATE_DATA; =20 /// /// Video Mode structure /// typedef struct { - UINT32 Width; - UINT32 Height; - UINT32 ColorDepth; - UINT32 RefreshRate; - UINT8 *CrtcSettings; - UINT16 *SeqSettings; - UINT8 MiscSetting; + UINT32 Width; + UINT32 Height; + UINT32 ColorDepth; + UINT32 RefreshRate; + UINT8 *CrtcSettings; + UINT16 *SeqSettings; + UINT8 MiscSetting; } CIRRUS_LOGIC_5430_VIDEO_MODES; =20 -#define CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS(a) \ - CR(a, CIRRUS_LOGIC_5430_PRIVATE_DATA, UgaDraw, CIRRUS_LOGIC_5430_PRIVATE= _DATA_SIGNATURE) - #define CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS(a) \ CR(a, CIRRUS_LOGIC_5430_PRIVATE_DATA, GraphicsOutput, CIRRUS_LOGIC_5430_= PRIVATE_DATA_SIGNATURE) =20 - // // Global Variables // @@ -139,31 +131,18 @@ extern EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gCi= rrusLogic5430DriverSupporte // // Io Registers defined by VGA // -#define CRTC_ADDRESS_REGISTER 0x3d4 -#define CRTC_DATA_REGISTER 0x3d5 -#define SEQ_ADDRESS_REGISTER 0x3c4 -#define SEQ_DATA_REGISTER 0x3c5 -#define GRAPH_ADDRESS_REGISTER 0x3ce -#define GRAPH_DATA_REGISTER 0x3cf -#define ATT_ADDRESS_REGISTER 0x3c0 -#define MISC_OUTPUT_REGISTER 0x3c2 -#define INPUT_STATUS_1_REGISTER 0x3da -#define DAC_PIXEL_MASK_REGISTER 0x3c6 -#define PALETTE_INDEX_REGISTER 0x3c8 -#define PALETTE_DATA_REGISTER 0x3c9 - -// -// UGA Draw Hardware abstraction internal worker functions -// -EFI_STATUS -CirrusLogic5430UgaDrawConstructor ( - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private - ); - -EFI_STATUS -CirrusLogic5430UgaDrawDestructor ( - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private - ); +#define CRTC_ADDRESS_REGISTER 0x3d4 +#define CRTC_DATA_REGISTER 0x3d5 +#define SEQ_ADDRESS_REGISTER 0x3c4 +#define SEQ_DATA_REGISTER 0x3c5 +#define GRAPH_ADDRESS_REGISTER 0x3ce +#define GRAPH_DATA_REGISTER 0x3cf +#define ATT_ADDRESS_REGISTER 0x3c0 +#define MISC_OUTPUT_REGISTER 0x3c2 +#define INPUT_STATUS_1_REGISTER 0x3da +#define DAC_PIXEL_MASK_REGISTER 0x3c6 +#define PALETTE_INDEX_REGISTER 0x3c8 +#define PALETTE_DATA_REGISTER 0x3c9 =20 // // Graphics Output Hardware abstraction internal worker functions @@ -178,10 +157,10 @@ CirrusLogic5430GraphicsOutputDestructor ( CIRRUS_LOGIC_5430_PRIVATE_DATA *Private ); =20 - // // EFI_DRIVER_BINDING_PROTOCOL Protocol Interface // + /** TODO: Add function description =20 @@ -241,6 +220,7 @@ CirrusLogic5430ControllerDriverStop ( // // EFI Component Name Functions // + /** Retrieves a Unicode string that is the user readable name of the driver. =20 @@ -288,7 +268,6 @@ CirrusLogic5430ComponentNameGetDriverName ( OUT CHAR16 **DriverName ); =20 - /** Retrieves a Unicode string that is the user readable name of the control= ler that is being managed by a driver. @@ -360,14 +339,13 @@ CirrusLogic5430ComponentNameGetDriverName ( EFI_STATUS EFIAPI CirrusLogic5430ComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle O= PTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName ); =20 - // // Local Function Prototypes // diff --git a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430Dxe.inf= b/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430Dxe.inf index 3e8b7b087f11..359ce486e5ba 100644 --- a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430Dxe.inf +++ b/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430Dxe.inf @@ -9,7 +9,7 @@ # requires both the UGA Draw and the UGA I/O Protocol. Please refer to Mi= crosoft's # documentation on UGA for details on how to write a UGA driver that is a= ble # to function both in the EFI pre-boot environment and from the OS runtim= e. -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -43,7 +43,6 @@ [Sources] ComponentName.c DriverSupportedEfiVersion.c - CirrusLogic5430UgaDraw.c CirrusLogic5430GraphicsOutput.c CirrusLogic5430.c CirrusLogic5430.h @@ -67,7 +66,6 @@ =20 [Protocols] gEfiDriverSupportedEfiVersionProtocolGuid # PROTOCOL ALWAYS_PRODUCED - gEfiUgaDrawProtocolGuid # PROTOCOL BY_START gEfiGraphicsOutputProtocolGuid # PROTOCOL BY_START gEfiEdidDiscoveredProtocolGuid # PROTOCOL BY_START gEfiEdidActiveProtocolGuid # PROTOCOL BY_START @@ -75,10 +73,5 @@ gEfiPciIoProtocolGuid # PROTOCOL TO_START gEfiEdidOverrideProtocolGuid # PROTOCOL TO_START =20 - -[FeaturePcd] - gOptionRomPkgTokenSpaceGuid.PcdSupportGop - gOptionRomPkgTokenSpaceGuid.PcdSupportUga - [Pcd] gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion diff --git a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430UgaDraw= .c b/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430UgaDraw.c deleted file mode 100644 index bdcbd3450c5f..000000000000 --- a/Drivers/OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430UgaDraw.c +++ /dev/null @@ -1,412 +0,0 @@ -/** @file - This file produces the graphics abstration of UGA Draw. It is called by - CirrusLogic5430.c file which deals with the EFI 1.1 driver model. - This file just does graphics. - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "CirrusLogic5430.h" - -// -// UGA Draw Protocol Member Functions -// -EFI_STATUS -EFIAPI -CirrusLogic5430UgaDrawGetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - OUT UINT32 *HorizontalResolution, - OUT UINT32 *VerticalResolution, - OUT UINT32 *ColorDepth, - OUT UINT32 *RefreshRate - ) -{ - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private; - - Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (This); - - if (Private->HardwareNeedsStarting) { - return EFI_NOT_STARTED; - } - - if ((HorizontalResolution =3D=3D NULL) || - (VerticalResolution =3D=3D NULL) || - (ColorDepth =3D=3D NULL) || - (RefreshRate =3D=3D NULL)) { - return EFI_INVALID_PARAMETER; - } - - *HorizontalResolution =3D Private->ModeData[Private->CurrentMode].Horizo= ntalResolution; - *VerticalResolution =3D Private->ModeData[Private->CurrentMode].Vertic= alResolution; - *ColorDepth =3D Private->ModeData[Private->CurrentMode].ColorD= epth; - *RefreshRate =3D Private->ModeData[Private->CurrentMode].Refres= hRate; - - return EFI_SUCCESS; -} - -EFI_STATUS -EFIAPI -CirrusLogic5430UgaDrawSetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN UINT32 HorizontalResolution, - IN UINT32 VerticalResolution, - IN UINT32 ColorDepth, - IN UINT32 RefreshRate - ) -{ - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private; - UINTN Index; - - Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (This); - - for (Index =3D 0; Index < Private->MaxMode; Index++) { - - if (HorizontalResolution !=3D Private->ModeData[Index].HorizontalResol= ution) { - continue; - } - - if (VerticalResolution !=3D Private->ModeData[Index].VerticalResolutio= n) { - continue; - } - - if (ColorDepth !=3D Private->ModeData[Index].ColorDepth) { - continue; - } - - if (RefreshRate !=3D Private->ModeData[Index].RefreshRate) { - continue; - } - - if (Private->LineBuffer) { - gBS->FreePool (Private->LineBuffer); - } - - Private->LineBuffer =3D NULL; - Private->LineBuffer =3D AllocatePool (HorizontalResolution); - if (Private->LineBuffer =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - InitializeGraphicsMode (Private, &CirrusLogic5430VideoModes[Private->M= odeData[Index].ModeNumber]); - - Private->CurrentMode =3D Index; - - Private->HardwareNeedsStarting =3D FALSE; - - return EFI_SUCCESS; - } - - return EFI_NOT_FOUND; -} - -EFI_STATUS -EFIAPI -CirrusLogic5430UgaDrawBlt ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL - IN EFI_UGA_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta - ) -{ - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private; - EFI_TPL OriginalTPL; - UINTN DstY; - UINTN SrcY; - EFI_UGA_PIXEL *Blt; - UINTN X; - UINT8 Pixel; - UINT32 WidePixel; - UINTN ScreenWidth; - UINTN Offset; - UINTN SourceOffset; - - Private =3D CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (This); - - if ((UINT32)BltOperation >=3D EfiUgaBltMax) { - return EFI_INVALID_PARAMETER; - } - - if (Width =3D=3D 0 || Height =3D=3D 0) { - return EFI_INVALID_PARAMETER; - } - - // - // If Delta is zero, then the entire BltBuffer is being used, so Delta - // is the number of bytes in each row of BltBuffer. Since BltBuffer is = Width pixels size, - // the number of bytes in each row can be computed. - // - if (Delta =3D=3D 0) { - Delta =3D Width * sizeof (EFI_UGA_PIXEL); - } - - // - // We need to fill the Virtual Screen buffer with the blt data. - // The virtual screen is upside down, as the first row is the bootom row= of - // the image. - // - - // - // Make sure the SourceX, SourceY, DestinationX, DestinationY, Width, an= d Height parameters - // are valid for the operation and the current screen geometry. - // - if (BltOperation =3D=3D EfiUgaVideoToBltBuffer) { - // - // Video to BltBuffer: Source is Video, destination is BltBuffer - // - if (SourceY + Height > Private->ModeData[Private->CurrentMode].Vertica= lResolution) { - return EFI_INVALID_PARAMETER; - } - - if (SourceX + Width > Private->ModeData[Private->CurrentMode].Horizont= alResolution) { - return EFI_INVALID_PARAMETER; - } - } else { - // - // BltBuffer to Video: Source is BltBuffer, destination is Video - // - if (DestinationY + Height > Private->ModeData[Private->CurrentMode].Ve= rticalResolution) { - return EFI_INVALID_PARAMETER; - } - - if (DestinationX + Width > Private->ModeData[Private->CurrentMode].Hor= izontalResolution) { - return EFI_INVALID_PARAMETER; - } - } - // - // We have to raise to TPL Notify, so we make an atomic write the frame = buffer. - // We would not want a timer based event (Cursor, ...) to come in while = we are - // doing this operation. - // - OriginalTPL =3D gBS->RaiseTPL (TPL_NOTIFY); - - switch (BltOperation) { - case EfiUgaVideoToBltBuffer: - // - // Video to BltBuffer: Source is Video, destination is BltBuffer - // - for (SrcY =3D SourceY, DstY =3D DestinationY; DstY < (Height + Destina= tionY); SrcY++, DstY++) { - - Offset =3D (SrcY * Private->ModeData[Private->CurrentMode].Horizonta= lResolution) + SourceX; - if (((Offset & 0x03) =3D=3D 0) && ((Width & 0x03) =3D=3D 0)) { - Private->PciIo->Mem.Read ( - Private->PciIo, - EfiPciIoWidthUint32, - 0, - Offset, - Width >> 2, - Private->LineBuffer - ); - } else { - Private->PciIo->Mem.Read ( - Private->PciIo, - EfiPciIoWidthUint8, - 0, - Offset, - Width, - Private->LineBuffer - ); - } - - for (X =3D 0; X < Width; X++) { - Blt =3D (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + (DstY * D= elta) + (DestinationX + X) * sizeof (EFI_UGA_PIXEL)); - - Blt->Red =3D (UINT8) (Private->LineBuffer[X] & 0xe0); - Blt->Green =3D (UINT8) ((Private->LineBuffer[X] & 0x1c) << 3); - Blt->Blue =3D (UINT8) ((Private->LineBuffer[X] & 0x03) << 6); - } - } - break; - - case EfiUgaVideoToVideo: - // - // Perform hardware acceleration for Video to Video operations - // - ScreenWidth =3D Private->ModeData[Private->CurrentMode].HorizontalRe= solution; - SourceOffset =3D (SourceY * Private->ModeData[Private->CurrentMode].H= orizontalResolution) + (SourceX); - Offset =3D (DestinationY * Private->ModeData[Private->CurrentMo= de].HorizontalResolution) + (DestinationX); - - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0000); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0010); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0012); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0014); - - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0001); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0011); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0013); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0015); - - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) (((Width << 8) & 0xff0= 0) | 0x20)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((Width & 0xff00) | 0x= 21)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) (((Height << 8) & 0xff= 00) | 0x22)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((Height & 0xff00) | 0= x23)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) (((ScreenWidth << 8) &= 0xff00) | 0x24)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((ScreenWidth & 0xff00= ) | 0x25)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) (((ScreenWidth << 8) &= 0xff00) | 0x26)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((ScreenWidth & 0xff00= ) | 0x27)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((Offset) << 8) & 0x= ff00) | 0x28)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((Offset) >> 0) & 0x= ff00) | 0x29)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((Offset) >> 8) & 0x= ff00) | 0x2a)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((SourceOffset) << 8= ) & 0xff00) | 0x2c)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((SourceOffset) >> 0= ) & 0xff00) | 0x2d)); - outw (Private, GRAPH_ADDRESS_REGISTER, (UINT16) ((((SourceOffset) >> 8= ) & 0xff00) | 0x2e)); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x002f); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0030); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0d32); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0033); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0034); - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0035); - - outw (Private, GRAPH_ADDRESS_REGISTER, 0x0231); - - outb (Private, GRAPH_ADDRESS_REGISTER, 0x31); - while ((inb (Private, GRAPH_DATA_REGISTER) & 0x01) =3D=3D 0x01) - ; - break; - - case EfiUgaVideoFill: - Blt =3D BltBuffer; - Pixel =3D (UINT8) ((Blt->Red & 0xe0) | ((Blt->Green >> 3) & 0x1c) = | ((Blt->Blue >> 6) & 0x03)); - WidePixel =3D (Pixel << 8) | Pixel; - WidePixel =3D (WidePixel << 16) | WidePixel; - - if (DestinationX =3D=3D 0 && Width =3D=3D Private->ModeData[Private->C= urrentMode].HorizontalResolution) { - Offset =3D DestinationY * Private->ModeData[Private->CurrentMode].Ho= rizontalResolution; - if (((Offset & 0x03) =3D=3D 0) && (((Width * Height) & 0x03) =3D=3D = 0)) { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthFillUint32, - 0, - Offset, - (Width * Height) >> 2, - &WidePixel - ); - } else { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthFillUint8, - 0, - Offset, - Width * Height, - &Pixel - ); - } - } else { - for (SrcY =3D SourceY, DstY =3D DestinationY; SrcY < (Height + Sourc= eY); SrcY++, DstY++) { - Offset =3D (DstY * Private->ModeData[Private->CurrentMode].Horizon= talResolution) + DestinationX; - if (((Offset & 0x03) =3D=3D 0) && ((Width & 0x03) =3D=3D 0)) { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthFillUint32, - 0, - Offset, - Width >> 2, - &WidePixel - ); - } else { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthFillUint8, - 0, - Offset, - Width, - &Pixel - ); - } - } - } - break; - - case EfiUgaBltBufferToVideo: - for (SrcY =3D SourceY, DstY =3D DestinationY; SrcY < (Height + SourceY= ); SrcY++, DstY++) { - - for (X =3D 0; X < Width; X++) { - Blt =3D (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer= + (SrcY * Delta) + (SourceX + X) * sizeof (EFI_UGA_PIXEL)); - Private->LineBuffer[X] =3D (UINT8) ((Blt->Red & 0xe0) | ((Blt->Gr= een >> 3) & 0x1c) | ((Blt->Blue >> 6) & 0x03)); - } - - Offset =3D (DstY * Private->ModeData[Private->CurrentMode].Horizonta= lResolution) + DestinationX; - - if (((Offset & 0x03) =3D=3D 0) && ((Width & 0x03) =3D=3D 0)) { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthUint32, - 0, - Offset, - Width >> 2, - Private->LineBuffer - ); - } else { - Private->PciIo->Mem.Write ( - Private->PciIo, - EfiPciIoWidthUint8, - 0, - Offset, - Width, - Private->LineBuffer - ); - } - } - break; - - default: - break; - } - - gBS->RestoreTPL (OriginalTPL); - - return EFI_SUCCESS; -} - -// -// Construction and Destruction functions -// -EFI_STATUS -CirrusLogic5430UgaDrawConstructor ( - CIRRUS_LOGIC_5430_PRIVATE_DATA *Private - ) -{ - EFI_UGA_DRAW_PROTOCOL *UgaDraw; - - // - // Fill in Private->UgaDraw protocol - // - UgaDraw =3D &Private->UgaDraw; - - UgaDraw->GetMode =3D CirrusLogic5430UgaDrawGetMode; - UgaDraw->SetMode =3D CirrusLogic5430UgaDrawSetMode; - UgaDraw->Blt =3D CirrusLogic5430UgaDrawBlt; - - // - // Initialize the private data - // - Private->CurrentMode =3D 0; - Private->HardwareNeedsStarting =3D TRUE; - Private->LineBuffer =3D NULL; - - // - // Initialize the hardware - // - UgaDraw->SetMode ( - UgaDraw, - Private->ModeData[Private->CurrentMode].HorizontalResolution, - Private->ModeData[Private->CurrentMode].VerticalResolution, - Private->ModeData[Private->CurrentMode].ColorDepth, - Private->ModeData[Private->CurrentMode].RefreshRate - ); - DrawLogo ( - Private, - Private->ModeData[Private->CurrentMode].HorizontalResolution, - Private->ModeData[Private->CurrentMode].VerticalResolution - ); - - return EFI_SUCCESS; -} - diff --git a/Drivers/OptionRomPkg/OptionRomPkg.dec b/Drivers/OptionRomPkg/O= ptionRomPkg.dec index 6881f3648ede..14957349aab7 100644 --- a/Drivers/OptionRomPkg/OptionRomPkg.dec +++ b/Drivers/OptionRomPkg/OptionRomPkg.dec @@ -33,9 +33,6 @@ [PcdsFeatureFlag] gOptionRomPkgTokenSpaceGuid.PcdSupportScsiPassThru|TRUE|BOOLEAN|0x000100= 01 gOptionRomPkgTokenSpaceGuid.PcdSupportExtScsiPassThru|TRUE|BOOLEAN|0x000= 10002 - gOptionRomPkgTokenSpaceGuid.PcdSupportGop|TRUE|BOOLEAN|0x00010004 - gOptionRomPkgTokenSpaceGuid.PcdSupportUga|TRUE|BOOLEAN|0x00010005 =20 [PcdsFixedAtBuild, PcdsPatchableInModule] gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion|0x0002000a|UINT= 32|0x00010003 - --=20 2.35.1.windows.2