From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6D63E2214E329 for ; Mon, 11 Dec 2017 09:28:09 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id r78so16022791wme.5 for ; Mon, 11 Dec 2017 09:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y0dThe8Q1mHD5tSSh+67rnVbHTMzKghBKDTOqak6AEQ=; b=A6APw1pHcXhcAp2fzh64nz90DgGmI6fd/cU9NZCX6J7sTfbsQky+GwAmmRUlmDO1HM zsXBEx52GCK+MRt6qQNNpVFT2N9kpO9JoIn1JVT7neh0v1TDH3OnD3cAreLExlx0bbxG rRhMmIOaGzuTgvwLFM45SjbDDMjsb5dRZfKrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y0dThe8Q1mHD5tSSh+67rnVbHTMzKghBKDTOqak6AEQ=; b=qbjHun0b/5piHLO8Z83sTt7ASbVbcju2apIKNnhUEABo735uCL6Z1cx4kRLX/OJHtN nUnUIy7kSwoBbLQzAbmcSlmL1yEBcMCVNXFnvK/GxqewJ5V/YiFQxU/BUGXneaJXXUKd 0UDay4gQ7g1LlWBho6oFO1Zr0OJTDEMAKTXKrrC5R3iZ9leBL3xW3F4PfjwTLkxHd48E /5wyDnOLmbPfvXVTq45BCjMnIUQmabYIz2Evl5JyIAodAZD8hnOt3GOsHF9AcnD8GvqB zOonzXu0GIvT66ITmd3NTvQcYsokOxNxIjhTH17lHmbR4A5vi3BJaYV25mXmYbDGxRcV VWcQ== X-Gm-Message-State: AKGB3mL74s1nD/+nHNMsMsne1Ke4lnlwakZgwqX/cuI8uxjuHtm80xm4 S9XKd7Sio+cDI+mUQCA6w5ZPKQ== X-Google-Smtp-Source: ACJfBoulHEESxYHLu+KPQ+Zw2YVakQ6RTg8SbKvcOrCr7S3axt6mDkU+vQAf0iMLvQ35DPocQyXSOw== X-Received: by 10.28.169.194 with SMTP id s185mr1445608wme.119.1513013565190; Mon, 11 Dec 2017 09:32:45 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id b66sm9126987wmh.32.2017.12.11.09.32.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 09:32:44 -0800 (PST) Date: Mon, 11 Dec 2017 17:32:42 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, Girish Pathak , Evan Lloyd Message-ID: <20171211173242.u5yol2egafnvciwx@bivouac.eciton.net> References: <20171208173128.28485-1-ard.biesheuvel@linaro.org> <20171208173128.28485-2-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20171208173128.28485-2-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v2 1/5] ArmPlatformPkg: introduce LcdHwLib library class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2017 17:28:09 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 08, 2017 at 05:31:24PM +0000, Ard Biesheuvel wrote: > Add the declaration and include file for the new LcdHwLib library class, > which will allow us to abstract away from platform variations in the > LCD graphics output driver. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Girish Pathak > Signed-off-by: Evan Lloyd > [ardb: add NULL implementation as well and add it to ArmPlatformPkg.dsc] > Signed-off-by: Ard Biesheuvel > --- > ArmPlatformPkg/ArmPlatformPkg.dec | 1 + > ArmPlatformPkg/ArmPlatformPkg.dsc | 1 + > ArmPlatformPkg/Include/Library/LcdHwLib.h | 68 ++++++++++++++++++ > ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c | 75 ++++++++++++++++++++ > ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf | 28 ++++++++ > 5 files changed, 173 insertions(+) > > diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec > index 6a7bbc02d011..b33b6e630d85 100644 > --- a/ArmPlatformPkg/ArmPlatformPkg.dec > +++ b/ArmPlatformPkg/ArmPlatformPkg.dec > @@ -33,6 +33,7 @@ [Includes.common] > > [LibraryClasses] > ArmPlatformLib|Include/Library/ArmPlatformLib.h > + LcdHwLib|Include/Library/LcdHwLib.h > LcdPlatformLib|Include/Library/LcdPlatformLib.h > NorFlashPlatformLib|Include/Library/NorFlashPlatformLib.h > PL011UartLib|Include/Library/PL011UartLib.h > diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc > index c3a8c257cb02..9dd64b472acf 100644 > --- a/ArmPlatformPkg/ArmPlatformPkg.dsc > +++ b/ArmPlatformPkg/ArmPlatformPkg.dsc > @@ -101,6 +101,7 @@ [Components.common] > > ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf > ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf > + ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf > ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf > ArmPlatformPkg/Library/NorFlashPlatformNullLib/NorFlashPlatformNullLib.inf > ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf > diff --git a/ArmPlatformPkg/Include/Library/LcdHwLib.h b/ArmPlatformPkg/Include/Library/LcdHwLib.h > new file mode 100644 > index 000000000000..0c0480862aea > --- /dev/null > +++ b/ArmPlatformPkg/Include/Library/LcdHwLib.h > @@ -0,0 +1,68 @@ > +/** @file LcdHwLib.h > + > + This file contains interface functions for LcdHwLib of ArmPlatformPkg > + > + Copyright (c) 2017, ARM Ltd. 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 > + http://opensource.org/licenses/bsd-license.php > + > + 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 LCD_HW_LIB_H_ > +#define LCD_HW_LIB_H_ > + > +#include > + > +/** > + Check for presence of display > + > + @retval EFI_SUCCESS Platform implements display. > + @retval EFI_NOT_FOUND Display not found on the platform. > + > +**/ > +EFI_STATUS > +LcdIdentify ( > + VOID > + ); > + > +/** > + Initialize display. > + > + @param FrameBaseAddress Address of the frame buffer. > + @retval EFI_SUCCESS Display initialization success. > + @retval !(EFI_SUCCESS) Display initialization failure. > + > +**/ > +EFI_STATUS > +LcdInitialize ( > + EFI_PHYSICAL_ADDRESS FrameBaseAddress > + ); > + > +/** > + Set requested mode of the display. > + > + @param ModeNumber Display mode number. > + @retval EFI_SUCCESS Display set mode success. > + @retval EFI_DEVICE_ERROR If mode not found/supported. > + > +**/ > +EFI_STATUS > +LcdSetMode ( > + IN UINT32 ModeNumber > + ); > + > +/** > + De-initializes the display. > +**/ > +VOID > +LcdShutdown ( > + VOID > + ); > + > +#endif /* LCD_HW_LIB_H_ */ > diff --git a/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c > new file mode 100644 > index 000000000000..2d31b5183c95 > --- /dev/null > +++ b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.c > @@ -0,0 +1,75 @@ > +/** @file > + > + Copyright (c) 2017, Linaro, Ltd. 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 > + http://opensource.org/licenses/bsd-license.php > + > + 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 > +#include > + > +/** > + Check for presence of display > + > + @retval EFI_SUCCESS Platform implements display. > + @retval EFI_NOT_FOUND Display not found on the platform. > + > +**/ > +EFI_STATUS > +LcdIdentify ( > + VOID > + ) > +{ Bikeshedding: Since this Null implementation can never fill any functionality other than letting build complete without platform-specific glue - would it not be more expected for it to ASSERT and/or return failure everywhere? / Leif > + return EFI_SUCCESS; > +} > + > +/** > + Initialize display. > + > + @param FrameBaseAddress Address of the frame buffer. > + @retval EFI_SUCCESS Display initialization success. > + @retval !(EFI_SUCCESS) Display initialization failure. > + > +**/ > +EFI_STATUS > +LcdInitialize ( > + EFI_PHYSICAL_ADDRESS FrameBaseAddress > + ) > +{ > + return EFI_SUCCESS; > +} > + > +/** > + Set requested mode of the display. > + > + @param ModeNumber Display mode number. > + @retval EFI_SUCCESS Display set mode success. > + @retval EFI_DEVICE_ERROR If mode not found/supported. > + > +**/ > +EFI_STATUS > +LcdSetMode ( > + IN UINT32 ModeNumber > + ) > +{ > + return EFI_SUCCESS; > +} > + > +/** > + De-initializes the display. > +**/ > +VOID > +LcdShutdown ( > + VOID > + ) > +{ > +} > diff --git a/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf > new file mode 100644 > index 000000000000..d556bed65548 > --- /dev/null > +++ b/ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf > @@ -0,0 +1,28 @@ > +#/** @file > +# > +# Copyright (c) 2017, Linaro, Ltd. 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 > +# http://opensource.org/licenses/bsd-license.php > +# > +# 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 = 0x0001001A > + BASE_NAME = LcdHwNullLib > + FILE_GUID = bb1fde98-1de2-410e-8850-fdcb8e67ebc0 > + MODULE_TYPE = BASE > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = LcdHwLib > + > +[Sources] > + LcdHwNullLib.c > + > +[Packages] > + ArmPlatformPkg/ArmPlatformPkg.dec > + MdePkg/MdePkg.dec > -- > 2.11.0 >