From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a01:111:f400:fe08::603; helo=eur03-am5-obe.outbound.protection.outlook.com; envelope-from=evan.lloyd@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03on0603.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe08::603]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0BC9422631492 for ; Wed, 21 Mar 2018 05:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QQPW5nZacEGOYnoDCtHLFe5B1d7+gP3upNV2AezMC38=; b=p9d64OIRN9nSpjfI6oFpilu9F/v6HYJlLHN+dDfyVVF+x7nsivW7yg6uSWvltdybqbskLnceDajs3/6y0OK7OigKDpwpkELNebBnfAv5/QxuTC3gGzBMkBnpNX9aPshAgFERbDLNumynyid4YWvM3Vvfydb95zW4Jl6FjmhZ/nY= Received: from HE1PR0801MB1771.eurprd08.prod.outlook.com (10.168.150.14) by HE1PR0801MB1786.eurprd08.prod.outlook.com (10.168.150.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Wed, 21 Mar 2018 12:53:34 +0000 Received: from HE1PR0801MB1771.eurprd08.prod.outlook.com ([fe80::69cc:3ecf:9c8c:f5a3]) by HE1PR0801MB1771.eurprd08.prod.outlook.com ([fe80::69cc:3ecf:9c8c:f5a3%17]) with mapi id 15.20.0588.017; Wed, 21 Mar 2018 12:53:34 +0000 From: Evan Lloyd To: Girish Pathak , "edk2-devel@lists.01.org" CC: nd , Stephanie Hughes-Fitt , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" Thread-Topic: [edk2] [PATCH v3 09/16] ArmPlatformPkg: Redefine LcdPlatformGetTimings function Thread-Index: AQHTwGZPvAOpFl+7Wk6uvdsKZhGXm6Papmxg Date: Wed, 21 Mar 2018 12:53:34 +0000 Message-ID: References: <20180320161212.79120-1-girish.pathak@arm.com> <20180320161212.79120-10-girish.pathak@arm.com> In-Reply-To: <20180320161212.79120-10-girish.pathak@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [217.140.96.140] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0801MB1786; 6:YPP8c414wmsglhUPUFe2UAXMX6XGOwJzCv4eyubOvjKFEAIAw11ottuppFVTGvok+0agZgehSQJRAPxK+KSevUNrG3n1106XkrHX5BVO2rueJuHwj9WGKNn8kFxTq58SczBVhDRC52nitcLLdwDARQ+Razc1WQqyXD2uRNV5dZd2veaT6D4KCSH+PT8YEZunSKrNXn63G42hNB6LTrKZRTQ5ResjI9E1tkeZTixTVzYtEkD73SAeS9MUjWC+dSFv1Wh3GHE4RZAIcUsC0qG4PArOb5tX0A/ErTO8MGH6g25WPgyjzaBRq5tnB2X8oaKrlNAXXGgNXnvJHq4x301u1gfjsONHGxsu5kktlzOpahjRQBK4r3WFBn7bWv7KhpoB; 5:4ZZpckOxwChTmJRET1sBdDu+H+D1rkYrGiwcMsPMX6OK5kI0Hr+zNcJn3NsG+iCTqp5AAEV8BewhQvk6SbAxoud6BcoWXO+TJBVXdta/3v7AlRFKgFYXlxefxNr8X+cO4OUkwqU+53OC5yX+Ex2Lkc+q06fEQuR6qOKF5w8HsVU=; 24:/ZPECexSxmY/N+1xuD06YLqYkkqsqdz2WHZfgTktKrnqVtA95nA2pJi+G8ihQ21jKGY9vACwkFyafAELeE5I32enXeu8KWQ9H3sFQkK+ygI=; 7:nMedaGVlzlEdiN2pRAkGsXcf769kAjg5SdAe9lznIHIqdsAWQaXGNLo3tWkICmcM8aozhkeBP0l1fMhO+A3YTxvjrI3FD0PH8zTFmiEdfzcvOFWUBNVsS0GhG2VzHs1rxA85Dr2M5IpCRgvJRGYMnmkESwP96gtq4MexMkcYbNknCTWj1Dr3dkLP0OkmQh7S/v7TNYE1abSNxOfrtjU9z6HNJwBvVZSwskaVxZc5DrSrty45qmtCQW88xID/L/PJ x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bd10bc2e-7b46-43df-6b1f-08d58f2ac1a2 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1786; x-ms-traffictypediagnostic: HE1PR0801MB1786: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Evan.Lloyd@arm.com; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(162533806227266); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501323)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR0801MB1786; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1786; x-forefront-prvs: 0618E4E7E1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(346002)(376002)(396003)(39860400002)(13464003)(189003)(199004)(2950100002)(97736004)(105586002)(3280700002)(2906002)(25786009)(81156014)(99286004)(316002)(59450400001)(7696005)(966005)(26005)(110136005)(14454004)(478600001)(76176011)(6506007)(102836004)(72206003)(2900100001)(8676002)(54906003)(81166006)(5660300001)(86362001)(5250100002)(4326008)(33656002)(6246003)(6436002)(9686003)(229853002)(53546011)(2501003)(575784001)(3846002)(106356001)(3660700001)(6116002)(66066001)(53936002)(7736002)(68736007)(305945005)(55016002)(6306002)(8936002)(74316002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB1786; H:HE1PR0801MB1771.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0fQGXxJ7P8FUvOUXpxxSnQYWdHKrKx+D/w7t9/F/NDqxKmhp5/eFBE5O6pA2bCqqzXczTzvp6iZl79Ia0SnqDpceew7xAz6umnzw44PyKSTRsiXyyIr/+3NY/vV+frXEgbX5eD3qry9TYxkOxKdpObNHDMPQIKbVqwnsrBbyJo93Oilp4BWWo/G8iHWAZDtRMWP6lISkX2M1uZU/QH2GNYxSQ5udy4vU2Mu5CNQCH8RNFknUr7vmyMtIVhQP/oV2eYHqi0WhtFrMkWiK4pD9CFNkDAou9NxF03Nn0vpamX+kzPx6nBdLsVildrCX1a8nDEmE17E1qqroyWdZyHeEqA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd10bc2e-7b46-43df-6b1f-08d58f2ac1a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2018 12:53:34.0963 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1786 Subject: Re: [PATCH v3 09/16] ArmPlatformPkg: Redefine LcdPlatformGetTimings function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2018 12:47:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Evan Lloyd > -----Original Message----- > From: edk2-devel On Behalf Of Girish > Pathak > Sent: 20 March 2018 16:12 > To: edk2-devel@lists.01.org > Cc: nd ; Stephanie Hughes-Fitt Fitt@arm.com>; leif.lindholm@linaro.org; ard.biesheuvel@linaro.org > Subject: [edk2] [PATCH v3 09/16] ArmPlatformPkg: Redefine > LcdPlatformGetTimings function >=20 > From: Girish Pathak >=20 > The LcdPlatformGetTimings interface function takes similar sets of multip= le > parameters for horizontal and vertical timings which can be aggregated in= a > common data type. This change defines a structure SCAN_TIMINGS for this > which can be used to describe both horizontal and vertical scan timings, > and accordingly redefines the LcdPlatformGetTiming interface, greatly > reducing the amount of data passed about. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Girish Pathak > Signed-off-by: Evan Lloyd > Reviewed-by: Ard Biesheuvel > --- > ArmPlatformPkg/Include/Library/LcdPlatformLib.h | 31 ++++= ++---- > -- > ArmPlatformPkg/Library/HdLcd/HdLcd.c | 50 ++++= +++++---- > ------- > ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c | 10 +--- > ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c | 43 > +++++++++-------- > 4 files changed, 64 insertions(+), 70 deletions(-) >=20 > diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h > b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h > index > e51e78640ae7b1acd51ac333ba3faa8c78aea5a5..8338b327fd2dd0d6b316 > 53e278e25da5ac850939 100644 > --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h > +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h > @@ -153,6 +153,14 @@ typedef enum { > LCD_BITS_PER_PIXEL_12_444 > } LCD_BPP; >=20 > +// Display timing settings. > +typedef struct { > + UINT32 Resolution; > + UINT32 Sync; > + UINT32 BackPorch; > + UINT32 FrontPorch; > +} SCAN_TIMINGS; > + > /** Platform related initialization function. >=20 > @param[in] Handle Handle to the LCD device instance. > @@ -228,14 +236,11 @@ LcdPlatformQueryMode ( >=20 > @param[in] ModeNumber Mode Number. >=20 > - @param[out] HRes Pointer to horizontal resolution. > - @param[out] HSync Pointer to horizontal sync width. > - @param[out] HBackPorch Pointer to horizontal back porch. > - @param[out] HFrontPorch Pointer to horizontal front porch. > - @param[out] VRes Pointer to vertical resolution. > - @param[out] VSync Pointer to vertical sync width. > - @param[out] VBackPorch Pointer to vertical back porch. > - @param[out] VFrontPorch Pointer to vertical front porch. > + @param[out] Horizontal Pointer to horizontal timing parameter= s. > + (Resolution, Sync, Back porch, Front p= orch) > + @param[out] Vertical Pointer to vertical timing parameters. > + (Resolution, Sync, Back porch, Front > + porch) > + >=20 > @retval EFI_SUCCESS Display timing information for the req= uested > mode returned successfully. > @@ -244,14 +249,8 @@ LcdPlatformQueryMode ( EFI_STATUS > LcdPlatformGetTimings ( > IN UINT32 ModeNumber, > - OUT UINT32* HRes, > - OUT UINT32* HSync, > - OUT UINT32* HBackPorch, > - OUT UINT32* HFrontPorch, > - OUT UINT32* VRes, > - OUT UINT32* VSync, > - OUT UINT32* VBackPorch, > - OUT UINT32* VFrontPorch > + OUT SCAN_TIMINGS **Horizontal, > + OUT SCAN_TIMINGS **Vertical > ); >=20 > /** Return bits per pixel information for a mode number. > diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.c > b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > index > 039048398c531ec944bc4b43a5551a554a368481..f5886848ce582b475b5 > 97ccca015c816707ade0e 100644 > --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.c > +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.c > @@ -98,34 +98,25 @@ LcdSetMode ( > ) > { > EFI_STATUS Status; > - UINT32 HRes; > - UINT32 HSync; > - UINT32 HBackPorch; > - UINT32 HFrontPorch; > - UINT32 VRes; > - UINT32 VSync; > - UINT32 VBackPorch; > - UINT32 VFrontPorch; > + SCAN_TIMINGS *Horizontal; > + SCAN_TIMINGS *Vertical; > UINT32 BytesPerPixel; > LCD_BPP LcdBpp; >=20 > // Set the video mode timings and other relevant information > Status =3D LcdPlatformGetTimings ( > ModeNumber, > - &HRes, > - &HSync, > - &HBackPorch, > - &HFrontPorch, > - &VRes, > - &VSync, > - &VBackPorch, > - &VFrontPorch > + &Horizontal, > + &Vertical > ); > if (EFI_ERROR (Status)) { > ASSERT_EFI_ERROR (Status); > return Status; > } >=20 > + ASSERT (Horizontal !=3D NULL); > + ASSERT (Vertical !=3D NULL); > + > Status =3D LcdPlatformGetBpp (ModeNumber, &LcdBpp); > if (EFI_ERROR (Status)) { > ASSERT_EFI_ERROR (Status); > @@ -138,21 +129,26 @@ LcdSetMode ( > MmioWrite32 (HDLCD_REG_COMMAND, HDLCD_DISABLE); >=20 > // Update the frame buffer information with the new settings > - MmioWrite32 (HDLCD_REG_FB_LINE_LENGTH, HRes * BytesPerPixel); > - MmioWrite32 (HDLCD_REG_FB_LINE_PITCH, HRes * BytesPerPixel); > - MmioWrite32 (HDLCD_REG_FB_LINE_COUNT, VRes - 1); > + MmioWrite32 ( > + HDLCD_REG_FB_LINE_LENGTH, > + Horizontal->Resolution * BytesPerPixel > + ); > + > + MmioWrite32 (HDLCD_REG_FB_LINE_PITCH, Horizontal->Resolution * > + BytesPerPixel); > + > + MmioWrite32 (HDLCD_REG_FB_LINE_COUNT, Vertical->Resolution - 1); >=20 > // Set the vertical timing information > - MmioWrite32 (HDLCD_REG_V_SYNC, VSync); > - MmioWrite32 (HDLCD_REG_V_BACK_PORCH, VBackPorch); > - MmioWrite32 (HDLCD_REG_V_DATA, VRes - 1); > - MmioWrite32 (HDLCD_REG_V_FRONT_PORCH, VFrontPorch); > + MmioWrite32 (HDLCD_REG_V_SYNC, Vertical->Sync); > + MmioWrite32 (HDLCD_REG_V_BACK_PORCH, Vertical->BackPorch); > + MmioWrite32 (HDLCD_REG_V_DATA, Vertical->Resolution - 1); > + MmioWrite32 (HDLCD_REG_V_FRONT_PORCH, Vertical->FrontPorch); >=20 > // Set the horizontal timing information > - MmioWrite32 (HDLCD_REG_H_SYNC, HSync); > - MmioWrite32 (HDLCD_REG_H_BACK_PORCH, HBackPorch); > - MmioWrite32 (HDLCD_REG_H_DATA, HRes - 1); > - MmioWrite32 (HDLCD_REG_H_FRONT_PORCH, HFrontPorch); > + MmioWrite32 (HDLCD_REG_H_SYNC, Horizontal->Sync); > + MmioWrite32 (HDLCD_REG_H_BACK_PORCH, Horizontal->BackPorch); > + MmioWrite32 (HDLCD_REG_H_DATA, Horizontal->Resolution - 1); > + MmioWrite32 (HDLCD_REG_H_FRONT_PORCH, Horizontal->FrontPorch); >=20 > // Enable the controller > MmioWrite32 (HDLCD_REG_COMMAND, HDLCD_ENABLE); diff --git > a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c > b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c > index > b76894c534fb413d87c77c528f0bb7d49862c78f..492edd1ba2e57158c219 > 20d6df11eed5673649c1 100644 > --- a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c > +++ b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c > @@ -123,14 +123,8 @@ LcdPlatformQueryMode ( EFI_STATUS > LcdPlatformGetTimings ( > IN UINT32 ModeNumber, > - OUT UINT32* HRes, > - OUT UINT32* HSync, > - OUT UINT32* HBackPorch, > - OUT UINT32* HFrontPorch, > - OUT UINT32* VRes, > - OUT UINT32* VSync, > - OUT UINT32* VBackPorch, > - OUT UINT32* VFrontPorch > + OUT SCAN_TIMINGS **Horizontal, > + OUT SCAN_TIMINGS **Vertical > ) > { > ASSERT (FALSE); > diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > index > 465cb6845437f57d15f05a271d1b01f634e11b56..c9e2736911881fc36b51 > 562b9259b7bccf30747d 100644 > --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c > @@ -84,34 +84,25 @@ LcdSetMode ( > ) > { > EFI_STATUS Status; > - UINT32 HRes; > - UINT32 HSync; > - UINT32 HBackPorch; > - UINT32 HFrontPorch; > - UINT32 VRes; > - UINT32 VSync; > - UINT32 VBackPorch; > - UINT32 VFrontPorch; > + SCAN_TIMINGS *Horizontal; > + SCAN_TIMINGS *Vertical; > UINT32 LcdControl; > LCD_BPP LcdBpp; >=20 > // Set the video mode timings and other relevant information > Status =3D LcdPlatformGetTimings ( > ModeNumber, > - &HRes, > - &HSync, > - &HBackPorch, > - &HFrontPorch, > - &VRes, > - &VSync, > - &VBackPorch, > - &VFrontPorch > + &Horizontal, > + &Vertical > ); > if (EFI_ERROR (Status)) { > ASSERT_EFI_ERROR (Status); > return Status; > } >=20 > + ASSERT (Horizontal !=3D NULL); > + ASSERT (Vertical !=3D NULL); > + > Status =3D LcdPlatformGetBpp (ModeNumber, &LcdBpp); > if (EFI_ERROR (Status)) { > ASSERT_EFI_ERROR (Status); > @@ -124,15 +115,29 @@ LcdSetMode ( > // Set Timings > MmioWrite32 ( > PL111_REG_LCD_TIMING_0, > - HOR_AXIS_PANEL (HBackPorch, HFrontPorch, HSync, HRes) > + HOR_AXIS_PANEL ( > + Horizontal->BackPorch, > + Horizontal->FrontPorch, > + Horizontal->Sync, > + Horizontal->Resolution > + ) > ); >=20 > MmioWrite32 ( > PL111_REG_LCD_TIMING_1, > - VER_AXIS_PANEL (VBackPorch, VFrontPorch, VSync, VRes) > + VER_AXIS_PANEL ( > + Vertical->BackPorch, > + Vertical->FrontPorch, > + Vertical->Sync, > + Vertical->Resolution > + ) > + ); > + > + MmioWrite32 ( > + PL111_REG_LCD_TIMING_2, > + CLK_SIG_POLARITY (Horizontal->Resolution) > ); >=20 > - MmioWrite32 (PL111_REG_LCD_TIMING_2, CLK_SIG_POLARITY (HRes)); > MmioWrite32 (PL111_REG_LCD_TIMING_3, 0); >=20 > // PL111_REG_LCD_CONTROL > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >=20 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel