From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.71.123; helo=nam05-by2-obe.outbound.protection.outlook.com; envelope-from=christopher.co@microsoft.com; receiver=edk2-devel@lists.01.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710123.outbound.protection.outlook.com [40.107.71.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6C88B2118C519 for ; Wed, 28 Nov 2018 16:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wuvGWc8qjjUrJV13zl03+cj2MOiax8JMufx5XO+BREU=; b=MM31zCa2kY2PwJMRSvnHjQylpQfYHN+UTh+tuT/+zrICpVy/g9H0GxlkyMFJIl5djaBqiZZ2diDjfVMNHjC2vxREhBZpohvxYFjp63PVR1Q6QzO/i8WIvkGM+tQkkbiiFIk3fGOrkZ7xhF5KYM2bnG7Uip6mQUJN1fwLPQSdTtc= Received: from DM5PR21MB0186.namprd21.prod.outlook.com (10.173.173.137) by DM5PR21MB0123.namprd21.prod.outlook.com (10.173.173.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.5; Thu, 29 Nov 2018 00:55:26 +0000 Received: from DM5PR21MB0186.namprd21.prod.outlook.com ([fe80::9115:7193:d145:d0f5]) by DM5PR21MB0186.namprd21.prod.outlook.com ([fe80::9115:7193:d145:d0f5%6]) with mapi id 15.20.1404.008; Thu, 29 Nov 2018 00:55:26 +0000 From: Chris Co To: Leif Lindholm CC: "edk2-devel@lists.01.org" , Ard Biesheuvel , Michael D Kinney Thread-Topic: [PATCH edk2-platforms 07/27] Silicon/NXP: Add i.MX display library support Thread-Index: AQHUUYS5T9aFHgXl5EKsEdl9iMj7nKU7d9WAgCrfyuA= Date: Thu, 29 Nov 2018 00:55:26 +0000 Message-ID: References: <20180921082542.35768-1-christopher.co@microsoft.com> <20180921082542.35768-8-christopher.co@microsoft.com> <20181101180513.njyuzs6qekuxvuqb@bivouac.eciton.net> In-Reply-To: <20181101180513.njyuzs6qekuxvuqb@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=chrco@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-11-29T00:55:24.9882300Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:3:ad0b:cedd:7800:f281] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR21MB0123; 6:+A5fc14PFNI2GSUPgxhK/67duhokgf4+MmFDad1Io28M6+vpIkWip+Gzo2h76q1Gl/HG0HAup1kn6Usa/fuAihl+QyBtVU6NJD1aP05imrOXijchfzyKwmky44BGi64EYJgaqn2SfbDPz85ZADiPr1/B9xZkI1wJ1eDrQKZuCjpq+lmMiaWYQuSfomX6OGGgVWfXNGaHoQ3/ijdV096MgsScBOjpBoUEszsa9b8HuiG4O9IJKVN/NOCdvAkMHyV9vbWszhrbZA8ZsVgvmHyghEz9fRfTGAAUMMYh7r/AAWiIc9w1DftzrfSWDZkqCk6Yl743InYGkQu//WorVzlQh226WCn3SDsOfcF9uf/+WahnITQE7bFzLIzxoCSGIWGyT5h/23dqm5FVw9uyuYRaz5fqzN3FRiCVNFZ3t8ZlFHto1KDsBy9iHgED610KtYIUtfyX3TuItGySrUvTPY3j9g==; 5:fmrmRwV0l4MvXD0LRcUCoMfPxH2HZjIW3GQ+/dRC5JCpqHtETFBoMu02klss7EFBC/w4SEsI/b77sw6vM0CuSxijHM9Sgfns+6novRPQo/4K2G2jpxPkSTSFX5IjqMBrKpNJsGq9LJbFA8vrRcnSP81oKw+oDDncPrbsMVzbjT4=; 7:l4qfNGWHq8MzCAGu4MdzE4G64hVFi699e/Ui2n4QKFkaBDpoSPGoMtUflXOWxiIsss9nMb7/zj4WnEuJkHeH36iDzr3JaGZniQ0vdtVLqRTdiMDIElUJbDV/zLh88ieQPOd69LXFc3a0NIDx/paJiA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: a9ebbceb-76d4-489c-6517-08d655955a14 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:DM5PR21MB0123; x-ms-traffictypediagnostic: DM5PR21MB0123: x-ms-exchange-purlcount: 3 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Christopher.Co@microsoft.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(8220035)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231451)(999002)(944501445)(4982022)(2018427008)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DM5PR21MB0123; BCL:0; PCL:0; RULEID:; SRVR:DM5PR21MB0123; x-forefront-prvs: 0871917CDA x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(376002)(396003)(39860400002)(136003)(13464003)(189003)(199004)(6306002)(86362001)(55016002)(6916009)(8936002)(74316002)(105586002)(6246003)(8676002)(4326008)(53936002)(25786009)(33656002)(5660300001)(46003)(575784001)(106356001)(9686003)(86612001)(316002)(229853002)(68736007)(99286004)(54906003)(22452003)(486006)(6436002)(10290500003)(14454004)(81156014)(72206003)(11346002)(81166006)(53946003)(4744004)(476003)(478600001)(97736004)(102836004)(10090500001)(305945005)(186003)(16799955002)(8990500004)(53546011)(7736002)(256004)(7696005)(2906002)(76176011)(71190400001)(71200400001)(6506007)(446003)(14444005)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR21MB0123; H:DM5PR21MB0186.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nYjaaD4EI67W4Yc2NzYFEmYIdTEXYj39RiXYqXOnt1+BvM909XXy7BV+WRmFc2m3O5mmf7z5BJmjzOCTNBknyYNKyn5ZTRxU+UQZd0bzCFoYQPk7YQnjPf3FIqnqWIJSCP5PaY8Ci1HM646Vs32zRsunLbH1qihnJz/0jTOtHQ/wVXm3wSY4HINyS1AYHNiSXNfzjnIe33igbClAa0vUQbvmp1IdGnWrd4oKHf6FWW2HcqmmoNZ/BhToq8sw+wcNPM2HIJWdHEou+3wHFpwYSUEELfbBiorL1JDtrAvYpQit9dOktmFIaJxhsVox2UCUnp65+OSwTdF0YJ34gcRwDvych9G+6x+NdlfgKK9vqgI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9ebbceb-76d4-489c-6517-08d655955a14 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2018 00:55:26.7736 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0123 Subject: Re: [PATCH edk2-platforms 07/27] Silicon/NXP: Add i.MX display library support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 00:55:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, > -----Original Message----- > From: Leif Lindholm > Sent: Thursday, November 1, 2018 11:05 AM > To: Chris Co > Cc: edk2-devel@lists.01.org; Ard Biesheuvel ; > Michael D Kinney > Subject: Re: [PATCH edk2-platforms 07/27] Silicon/NXP: Add i.MX display > library support >=20 > On Fri, Sep 21, 2018 at 08:25:58AM +0000, Chris Co wrote: > > This adds support for processing EDID data on NXP i.MX platforms. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Christopher Co > > Cc: Ard Biesheuvel > > Cc: Leif Lindholm > > Cc: Michael D Kinney > > --- > > Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h | 1= 14 > +++++++++++++++ > > Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c | 1= 52 > ++++++++++++++++++++ > > Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.inf | > > 31 ++++ > > 3 files changed, 297 insertions(+) > > > > diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h > > b/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h > > new file mode 100644 > > index 000000000000..70ef8d0af97f > > --- /dev/null > > +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h > > @@ -0,0 +1,114 @@ > > +/** @file > > +* > > +* Copyright (c) 2018 Microsoft Corporation. All rights reserved. > > +* > > +* This program and the accompanying materials > > +* are licensed and made available under the terms and conditions of > > +the BSD License > > +* which accompanies this distribution. The full text of the license > > +may be found at > > +* > > +https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fopen= s > > +ource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7CChristopher > > > +.Co%40microsoft.com%7C06e5c1f1adef43f79f9008d6402494f7%7C72f988bf86 > f1 > > > +41af91ab2d7cd011db47%7C1%7C0%7C636766923203571004&sdata=3D6GJ > qphnDZ > > +gT%2FGOiEeSSnPeTRGiRn%2B9CB%2Fi4A0ilq3MA%3D&reserved=3D0 > > +* > > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, > > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > > +* > > +**/ > > + > > +#ifndef __IMX_DISPLAY_H__ > > +#define __IMX_DISPLAY_H__ > > + > > +#define EDID_MIN_SIZE 128 > > +#define EDID_I2C_ADDRESS 0x50 >=20 > Are all of these #defines and functions called only from within iMX platf= orm > code? >=20 These defines and functions are called by iMX platform and silicon (iMX6Pkg= ) code. Should I prefix these defines with "IMX_" and function names with "= Imx"? I made changes to address the rest of the feedback. Chris > > + > > +// The first DTD is the preferred timing, refer to 3.1 VESA EDID spec. > > +#define EDID_DTD_1_OFFSET 0x36 > > +#define EDID_DTD_2_OFFSET 0x48 > > +#define EDID_DTD_3_OFFSET 0x5A > > +#define EDID_DTD_4_OFFSET 0x6C > > + > > +typedef enum { > > + PIXEL_FORMAT_ARGB32, > > + PIXEL_FORMAT_BGRA32, > > +} PIXEL_FORMAT; > > + > > +typedef struct _DISPLAY_TIMING { > > + UINT32 PixelClock; > > + UINT32 HActive; > > + UINT32 HBlank; > > + UINT32 VActive; > > + UINT32 VBlank; > > + UINT32 HSync; > > + UINT32 VSync; > > + UINT32 HSyncOffset; > > + UINT32 VSyncOffset; > > + UINT32 HImageSize; > > + UINT32 VImageSize; > > + UINT32 HBorder; > > + UINT32 VBorder; > > + UINT32 EdidFlags; > > + UINT32 Flags; > > + UINT32 PixelRepetition; > > + UINT32 Bpp; > > + PIXEL_FORMAT PixelFormat; > > +} DISPLAY_TIMING, *PDISPLAY_TIMING, DTD; > > + > > +typedef struct _DETAILED_TIMING_DESCRIPTOR { > > + UINT8 PixelClock[2]; > > + UINT8 HActive; > > + UINT8 HBlank; > > + UINT8 HActiveBlank; > > + UINT8 VActive; > > + UINT8 VBlank; > > + UINT8 VActiveBlank; > > + UINT8 HSyncOffset; > > + UINT8 HSyncWidth; > > + UINT8 VSyncOffsetWidth; > > + UINT8 HVOffsetWidth; > > + UINT8 HImageSize; > > + UINT8 VImageSize; > > + UINT8 HVImageSize; > > + UINT8 HBorder; > > + UINT8 VBorder; > > + UINT8 EdidFlags; > > +} DETAILED_TIMING_DESCRIPTOR, *PDETAILED_TIMING_DESCRIPTOR; > > + > > +/** > > + Convert detailed timing descriptor to display timing format > > + > > + @param[in] DTDPtr Pointer to detailed timing descripto= r. > > + @param[out] DisplayTimingPtr Pointer to display timing structure. > > + > > + @retval EFI_SUCCESS Detailed timing descriptor data was converte= d. > > + > > +**/ > > +EFI_STATUS > > +ConvertDTDToDisplayTiming ( > > + IN DETAILED_TIMING_DESCRIPTOR *DTDPtr, > > + OUT DISPLAY_TIMING *DisplayTimingPtr > > + ); > > + > > +/** > > + Debug dump of Display Timing structure > > + > > + @param[in] DisplayTimingNamePtr Name of display timing structure= . > > + @param[in] DisplayTimingPtr Pointer to display timing struct= ure. > > +**/ > > +VOID > > +PrintDisplayTiming ( > > + IN CHAR8 *DisplayTimingNamePtr, > > + IN DISPLAY_TIMING *DisplayTimingPtr > > + ); > > + > > +/** > > + Check if EDID is valid > > + > > + @param[in] EdidDataPtr Pointer to EDID data. > > + > > + @retval EFI_SUCCESS EDID data is a valid EDID. > > + @retval EFI_INVALID_PARAMETER EDID data is invalid. > > + > > +**/ > > +EFI_STATUS > > +ValidateEdidData ( > > + IN UINT8 *EdidDataPtr > > + ); > > + > > +#endif // __IMX_DISPLAY_H__ > > diff --git > > a/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c > > b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c > > new file mode 100644 > > index 000000000000..9e90ece96260 > > --- /dev/null > > +++ b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c > > @@ -0,0 +1,152 @@ > > +/** @file > > +* > > +* Copyright (c) 2018 Microsoft Corporation. All rights reserved. > > +* > > +* This program and the accompanying materials > > +* are licensed and made available under the terms and conditions of > > +the BSD License > > +* which accompanies this distribution. The full text of the license > > +may be found at > > +* > > +https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fopen= s > > +ource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7CChristopher > > > +.Co%40microsoft.com%7C06e5c1f1adef43f79f9008d6402494f7%7C72f988bf86 > f1 > > > +41af91ab2d7cd011db47%7C1%7C0%7C636766923203571004&sdata=3D6GJ > qphnDZ > > +gT%2FGOiEeSSnPeTRGiRn%2B9CB%2Fi4A0ilq3MA%3D&reserved=3D0 > > +* > > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, > > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > > +* > > +**/ > > + > > +#include > > + > > +#include > > + > > +#include > > + > > +/** > > + Convert detailed timing descriptor to display timing format > > + > > + @param[in] DTDPtr Pointer to detailed timing descripto= r. > > + @param[out] DisplayTimingPtr Pointer to display timing structure. > > + > > + @retval EFI_SUCCESS Detailed timing descriptor data was converte= d. > > + > > +**/ > > +EFI_STATUS > > +ConvertDTDToDisplayTiming ( > > + IN DETAILED_TIMING_DESCRIPTOR *DTDPtr, > > + OUT DISPLAY_TIMING *DisplayTimingPtr > > + ) > > +{ > > + UINT32 edidPixelClock; >=20 > e -> E. >=20 > > + > > + DEBUG ((DEBUG_INFO, "++ConvertDTDToDisplayTiming()\r\n")); >=20 > Please use %a and __FUNCTION__ instead of hard-coding function name. >=20 > > + // Refer to 3.10.2 VESA EDID spec > > + edidPixelClock =3D (DTDPtr->PixelClock[0] | (DTDPtr->PixelClock[1] <= < > > + 8)); DisplayTimingPtr->PixelClock =3D edidPixelClock * 10000; > > + DisplayTimingPtr->HActive =3D (DTDPtr->HActiveBlank & 0xF0); > > + DisplayTimingPtr->HActive =3D (DisplayTimingPtr->HActive << 4) | > > + DTDPtr->HActive; DisplayTimingPtr->HBlank =3D (DTDPtr->HActiveBlank = & > > + 0x0F); DisplayTimingPtr->HBlank =3D (DisplayTimingPtr->HBlank << 8) = | > > + DTDPtr->HBlank; DisplayTimingPtr->VActive =3D (DTDPtr->VActiveBlank = & > > + 0xF0); DisplayTimingPtr->VActive =3D (DisplayTimingPtr->VActive << 4= ) > > + | DTDPtr->VActive; DisplayTimingPtr->VBlank =3D (DTDPtr->VActiveBlan= k > > + & 0x0F); DisplayTimingPtr->VBlank =3D (DisplayTimingPtr->VBlank << 8= ) > > + | DTDPtr->VBlank; DisplayTimingPtr->HSyncOffset =3D > > + (DTDPtr->HVOffsetWidth & 0xC0); DisplayTimingPtr->HSyncOffset =3D > (DisplayTimingPtr->HSyncOffset << 2) | > > + DTDPtr->HSyncOffset; > > + DisplayTimingPtr->VSyncOffset =3D (DTDPtr->HVOffsetWidth & 0x0C); > > + DisplayTimingPtr->VSyncOffset =3D (DisplayTimingPtr->VSyncOffset << 2= ) | > > + ((DTDPtr->VSyncOffsetWidth & 0xF0) > > + >> 4); DisplayTimingPtr->HSync =3D (DTDPtr->HVOffsetWidth & 0x30); > > + DisplayTimingPtr->HSync =3D (DisplayTimingPtr->HSync << 4) | > > + DTDPtr->HSyncWidth; DisplayTimingPtr->VSync =3D > > + (DTDPtr->HVOffsetWidth & 0x03); DisplayTimingPtr->VSync =3D > (DisplayTimingPtr->VSync << 4) | > > + (DTDPtr->VSyncOffsetWidth & 0x0F); > > + DisplayTimingPtr->HImageSize =3D ((DTDPtr->HVImageSize & 0xF0) << 4) = | > > + DTDPtr->HImageSize; > > + DisplayTimingPtr->VImageSize =3D ((DTDPtr->HVImageSize & 0x0F) << 8) = | > > + DTDPtr->VImageSize; >=20 > A lot of these above transforms are a fairly unreadable, but maybe they n= eed > to be? >=20 > > + DisplayTimingPtr->HBorder =3D DTDPtr->HBorder; > > + DisplayTimingPtr->VBorder =3D DTDPtr->VBorder; > > + DisplayTimingPtr->EdidFlags =3D DTDPtr->EdidFlags; > > + DisplayTimingPtr->Flags =3D 0; >=20 > A #define for that 0? >=20 > > + > > + DEBUG ((DEBUG_INFO, "--ConvertDTDToDisplayTiming()=3Dok\r\n")); >=20 > __FUNCTION__ >=20 > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Debug dump of Display Timing structure > > + > > + @param[in] DisplayTimingNamePtr Name of display timing structure= . > > + @param[in] DisplayTimingPtr Pointer to display timing struct= ure. > > +**/ > > +VOID > > +PrintDisplayTiming ( > > + IN CHAR8 *DisplayTimingNamePtr, > > + IN DISPLAY_TIMING *DisplayTimingPtr > > + ) > > +{ > > + DEBUG ((DEBUG_INFO, "**********************\n")); > > + DEBUG ((DEBUG_INFO, "%a\n", DisplayTimingNamePtr)); > > + DEBUG ((DEBUG_INFO, "**********************\n")); > > + DEBUG ((DEBUG_INFO, "PixelClock %d\n", > > +DisplayTimingPtr->PixelClock)); > > + DEBUG ((DEBUG_INFO, "HActive %d\n", DisplayTimingPtr->HActive)); > > + DEBUG ((DEBUG_INFO, "HBlank %d\n", DisplayTimingPtr->HBlank)); > > + DEBUG ((DEBUG_INFO, "VActive %d\n", DisplayTimingPtr->VActive)); > > + DEBUG ((DEBUG_INFO, "VBlank %d\n", DisplayTimingPtr->VBlank)); > > + DEBUG ((DEBUG_INFO, "HSync %d\n", DisplayTimingPtr->HSync)); > > + DEBUG ((DEBUG_INFO, "VSync %d\n", DisplayTimingPtr->VSync)); > > + DEBUG ((DEBUG_INFO, "HSyncOffset %d\n", > > +DisplayTimingPtr->HSyncOffset)); > > + DEBUG ((DEBUG_INFO, "VSyncOffset %d\n", > > +DisplayTimingPtr->VSyncOffset)); > > + DEBUG ((DEBUG_INFO, "HBorder %d\n", DisplayTimingPtr->HBorder)); > > + DEBUG ((DEBUG_INFO, "VBorder %d\n", DisplayTimingPtr->VBorder)); > > + DEBUG ((DEBUG_INFO, "EdidFlags %d\n", > > +DisplayTimingPtr->EdidFlags)); > > + DEBUG ((DEBUG_INFO, "Flags %d\n", DisplayTimingPtr->Flags)); > > + DEBUG ((DEBUG_INFO, "PixelRepetition %d\n", > > +DisplayTimingPtr->PixelRepetition)); > > + DEBUG ((DEBUG_INFO, "BPP %d\n", DisplayTimingPtr->Bpp)); > > + DEBUG ((DEBUG_INFO, "PixelFormat %d\n", > > +DisplayTimingPtr->PixelFormat)); > > + DEBUG ((DEBUG_INFO, "**********************\n")); } > > + > > +/** > > + Check if EDID is valid > > + > > + @param[in] EdidDataPtr Pointer to EDID data. > > + > > + @retval EFI_SUCCESS EDID data is a valid EDID. > > + @retval EFI_INVALID_PARAMETER EDID data is invalid. > > + > > +**/ > > +EFI_STATUS > > +ValidateEdidData ( > > + IN UINT8 *EdidDataPtr > > + ) > > +{ > > + UINT8 Checksum; > > + UINT8 Index; > > + > > + DEBUG ((DEBUG_INFO, "++ValidateEdidData()\r\n")); >=20 > __FUNCTION__ >=20 > > + > > + if (EdidDataPtr[0] !=3D 0x00 || > > + EdidDataPtr[1] !=3D 0xFF || > > + EdidDataPtr[2] !=3D 0xFF || > > + EdidDataPtr[3] !=3D 0xFF || > > + EdidDataPtr[4] !=3D 0xFF || > > + EdidDataPtr[5] !=3D 0xFF || > > + EdidDataPtr[6] !=3D 0xFF || > > + EdidDataPtr[7] !=3D 0x00) { > > + DEBUG ((DEBUG_ERROR, "Invalid EDID header\n")); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + // Validate EDID checksum > > + Checksum =3D 0; > > + for (Index =3D 0; Index < EDID_MIN_SIZE; Index++) { > > + Checksum +=3D EdidDataPtr[Index]; > > + } > > + > > + if (Checksum !=3D 0) { > > + DEBUG ((DEBUG_ERROR, "Invalid EDID checksum\n")); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + DEBUG ((DEBUG_INFO, "--ValidateEdidData()=3Dok\r\n")); >=20 > __FUNCTION__ >=20 > / > Leif >=20 > > + return EFI_SUCCESS; > > +} > > diff --git > > a/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.inf > > b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.inf > > new file mode 100644 > > index 000000000000..bd77d4159639 > > --- /dev/null > > +++ b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.i > > +++ nf > > @@ -0,0 +1,31 @@ > > +## @file > > +# > > +# Copyright (c) 2018 Microsoft Corporation. All rights reserved. > > +# > > +# This program and the accompanying materials # are licensed and > > +made available under the terms and conditions of the BSD License # > > +which accompanies this distribution. The full text of the license > > +may be found at # > > +https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fopen= s > > +ource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7CChristopher > > > +.Co%40microsoft.com%7C06e5c1f1adef43f79f9008d6402494f7%7C72f988bf86 > f1 > > > +41af91ab2d7cd011db47%7C1%7C0%7C636766923203581009&sdata=3Ds3Y > tp2LL8 > > +T9AkKX6X%2FK2QCn3%2FXgj5wqjS%2BIE9EBYwzk%3D&reserved=3D0 > > +# > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER EXPRESS OR IMPLIED. > > +# > > +## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001001A > > + BASE_NAME =3D iMXDisplayLib > > + FILE_GUID =3D C0408490-F09B-4CFA-9A2F-5159F2705= 323 > > + MODULE_TYPE =3D BASE > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D iMXDisplayLib > > + > > +[Packages] > > + EmbeddedPkg/EmbeddedPkg.dec > > + MdePkg/MdePkg.dec > > + Silicon/NXP/iMXPlatformPkg/iMXPlatformPkg.dec > > + > > +[LibraryClasses] > > + > > +[Sources.common] > > + iMXDisplayLib.c > > -- > > 2.16.2.gvfs.1.33.gf5370f1 > >