From patchwork Wed Dec 19 12:32:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 10737199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3817F924 for ; Wed, 19 Dec 2018 12:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28AB72B14A for ; Wed, 19 Dec 2018 12:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2662B2B161; Wed, 19 Dec 2018 12:32:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FB332B14A for ; Wed, 19 Dec 2018 12:32:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DBCC16EF2F; Wed, 19 Dec 2018 12:32:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10079.outbound.protection.outlook.com [40.107.1.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id 689296EF2F for ; Wed, 19 Dec 2018 12:32:41 +0000 (UTC) Received: from AM0PR08MB4483.eurprd08.prod.outlook.com (20.179.35.149) by AM0PR08MB3924.eurprd08.prod.outlook.com (20.178.118.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1425.19; Wed, 19 Dec 2018 12:32:37 +0000 Received: from AM0PR08MB4483.eurprd08.prod.outlook.com ([fe80::1dff:434f:5905:45db]) by AM0PR08MB4483.eurprd08.prod.outlook.com ([fe80::1dff:434f:5905:45db%5]) with mapi id 15.20.1446.018; Wed, 19 Dec 2018 12:32:37 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau Subject: [PATCH v2 0/9] Overview of Arm komeda display driver Thread-Topic: [PATCH v2 0/9] Overview of Arm komeda display driver Thread-Index: AQHUl5bsEm3jkS+fR0m6XqdLwYJd3Q== Date: Wed, 19 Dec 2018 12:32:37 +0000 Message-ID: <20181219123147.16090-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: SYBPR01CA0132.ausprd01.prod.outlook.com (2603:10c6:10:5::24) To AM0PR08MB4483.eurprd08.prod.outlook.com (2603:10a6:208:145::21) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR08MB3924; 6:439yIAwCZqy5Q/1Ux20YHhn8BCh8ZuSW0zwx/JZybSnPoDaHikOEeYY21KPoxgYwFWAJFSRmDVa1HLFU2k2SPiQ+JfECtOakc2AhmSvxN68JRYY6XA1EBxwY/hG8DVDBCGCeuhswSaj0mFV6r9pKjlHa4Fq3W8zpXqS6fbop8SpG9ZXgpUhNA+3ZHG0KKntNfH3ToXxVkah9rnS73s9dsu7jynwx5TjkY4Dd0GLW171y9E25WtBhfcFE5abMJTr+gl/b8GxHJR1YV8H7id6deE+FjumElDByjJX5ysqCT4gWm2SOruXjUYZliY7FaNJojTgtkuhlO6V/5neukQSBGNh+AA4LmLmNB52zEn7PdzawejXnrDPHnO5Mo0wyqqiM8Z5RH8CUK7UzOVDZtlqk5DKwv+sYPvjgntWIBs6N0CGhuXb5UxoAcf92R2zt1PjYuIP+E40N7hhfISCvBpBbKA==; 5:IIPbAvqZLMvzcX0E9ogZT1QDou8CDjcyeaiymwqcINX+H+o7gMEnPtAcP5Jych/qpOL60G6T+1bp0V3Md1gyz3wU8MvLCnNMkkxl+9XQrq+4gLph/Uwj5dFHqunFJajcXR80YfHFxIu0QGwqBn8YVFJhpJF6j7/li1mqY54QydY=; 7:hCbwDJ8/MGn8H34aBegHd4BOX/BLmn8ScfY3vx6G2dZMAMAV2G6cxfyznHh5/dI121WcLXibPox9gciExR6A5OjqSQ4TIj4Y5auHFydhj81jnliAIUeH5HJNU7iX9YiOpOFNcvAfaFg89lqtTU88cg== x-ms-office365-filtering-correlation-id: 205039f7-034a-46b1-5e2f-08d665ae0eec x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3924; x-ms-traffictypediagnostic: AM0PR08MB3924: nodisclaimer: True x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM0PR08MB3924; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3924; x-forefront-prvs: 0891BC3F3D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(39860400002)(366004)(376002)(199004)(189003)(316002)(8936002)(103116003)(37006003)(1076003)(71190400001)(81166006)(81156014)(97736004)(36756003)(54906003)(256004)(2616005)(486006)(6636002)(99286004)(71200400001)(476003)(86362001)(5024004)(14444005)(8676002)(106356001)(105586002)(5660300001)(3846002)(7416002)(6116002)(14454004)(68736007)(6512007)(2906002)(4326008)(25786009)(6486002)(52116002)(53936002)(186003)(55236004)(102836004)(26005)(6862004)(6436002)(305945005)(478600001)(6506007)(66066001)(386003)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3924; H:AM0PR08MB4483.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3t0Tj0bxLy1mZ8D3yYEjRzuYAAhASWrz2xe5hQf/nLa3KX6bmb0Pt49zqxq4JsjxDshOG6zlk+xjPbybmwD4St+5Pyd+bGp7284vJu+MuZzmMSk/6ce1sQmE2/btJUzKrhdCc/+gaHZIpUXVB/G8e9ZIWdI62r18VPwLdNSh3vVDzUJu/iXza/7+w3dM8zj0EEGlUvSyiiI5pxlwCfUboTPkGZbO7KcOCgu5b8Pd8OjCcZ9PJdT05r3gYiRuc1Qe0FLkSMVM6vJ/3YTW2EMgGwhEYGyFQBe6/577YbpcPX7bbSPcKWKVXyB+g2YvEnmf spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 205039f7-034a-46b1-5e2f-08d665ae0eec X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2018 12:32:37.2222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3924 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "linux-doc@vger.kernel.org" , "maxime.ripard@bootlin.com" , "Jonathan Chai \(Arm Technology China\)" , Alexandru-Cosmin Gheorghe , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "yamada.masahiro@socionext.com" , "Yiqi Kang \(Arm Technology China\)" , "mchehab+samsung@kernel.org" , "Tiannan Zhu \(Arm Technology China\)" , "corbet@lwn.net" , "airlied@linux.ie" , "malidp@foss.arm.com" , "thomas Sun \(Arm Technology China\)" , Ayan Halder , "devicetree@vger.kernel.org" , "arnd@arndb.de" , "robh+dt@kernel.org" , "Jin Gao \(Arm Technology China\)" , nd , "sean@poorly.run" , "Lowry Li \(Arm Technology China\)" , "gregkh@linuxfoundation.org" , "rdunlap@infradead.org" , "nicolas.ferre@microchip.com" , "Julien Yin \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "akpm@linux-foundation.org" , "davem@davemloft.net" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is the first patchset of ARM new komeda display driver, this patchset added all basic structure of komeda, relationship of DRM-KMS with komeda, for tring to give a brife overview of komeda-driver. komeda is for supporting the ARM display processor D71 and later IPs, Since from D71, Arm display IP begins to adopt a flexible and modularized architecture: A display pipeline is made up of multiple individual and functional pipeline stages called components, and every component has some specific capabilities that can give the flowed pipeline pixel data a specific data processing. The typical components like: - Layer: Layer is the first pipeline stage, It fetches the pixel from memory and prepare the source pixel data for the next stage, like rotation, format, color-space handling. - Scaler: As its name, scaler is for scaling and image enhancement. - Compositor (compiz) Compositor is for blending multiple layers or pixel data flows into one single display frame. - Writeback Layer (wb_layer) Writeback layer do the opposite things of Layer, Which connect to compiz for writing the composition result to memory. - Post image processor (improc) Post image processor is for adjusting frame data like gamma and color space to fit the requirements of the monitor. - Timing controller (timing_ctrlr) Final stage of display pipeline, Timing controller is not for the pixel handling, but only for controlling the display timing. Benefitting from the modularized architecture, D71 pipelines can be easily adjusted to fit different usages. And D71 has two pipelines, which support two types of working mode: - Dual display mode Two pipelines work independently and separately to drive two display outputs. - Single pipeline data flow Layer_0 -> (scaler) ->\ Layer_1 -> (scaler) ->\ /-> (scaler) -> wb_layer -> memory compiz -> Layer_2 -> (scaler) ->/ \-> improc ->timing_ctrlr ->monitor Layer_3 -> (scaler) ->/ - Single display mode Two pipelines work together to drive only one display output. On this mode, pipeline_B doesn't work indenpendently, but outputs its composition result into pipeline_A, and its pixel timing also derived from pipeline_A.timeing_ctrlr. The pipeline_B works just like a "slave" of pipeline_A(master) - Slave enabled data flow Layer_0 -> (scaler) ->\ Layer_1 -> (scaler) ->\ compiz_B -> compiz_A Layer_2 -> (scaler) ->/ Layer_3 -> (scaler) ->/ compiz_B ->\ Layer_4 -> (scaler) ->\ Layer_5 -> (scaler) ->\ /-> (scaler) -> wb_layer -> memory compiz_A -> Layer_6 -> (scaler) ->/ \-> improc ->timing_ctrlr ->monitor Layer_7 -> (scaler) ->/ To fully utilize and easily access/configure the HW, komeda use a similar architecture: Pipeline/Component to describe the HW features and capabilities. Add the DRM-KMS consideration. then: A Komeda driver is comprised of two layers of data structures: 1. komeda_dev/pipeline/component Which are used by komeda driver to describe and abstract a display HW. - komeda_layer/scaler/compiz/improc/timing_ctrlr for describing a specific pipeline component stage. - komeda_pipeline for abstracting a display pipeline and the pipeline is composed of multiple components. - komeda_dev for the whole view of the device, manage the pipeline, irq, and the other control-abilites of device. 2. komeda_kms_dev/crtc/plane: which connect Komeda-dev to DRM-KMS, basically it collects and organizes komeda_dev's capabilites and resurces by DRM-KMS's way (crtc/plane/connector), and convert the DRM-KMS's requirement to the real komeda_dev's configuration. So generally, the komeda_dev is like a resource collection, and the komeda_kms is a group of users (crtc/plane/wb_connector), the drm_state defined or described the resource requirement of user, and every KMS-OBJ maps or represents to a specific komeda data pipeline: - Plane: Layer -> (Scaler) -> Compiz - Wb_connector: Compiz-> (scaler) -> Wb_layer -> memory - Crtc: Compiz -> Improc -> Timing_Ctrlr -> Monitor The features and properties of KMS-OBJ based on the mapping pipeline, and the komeda_kms level function (crtc/plane/wb_connector->atomic_check) actually is for pickuping suitable pipeline and component resources, configure them to a specific state and build these input/output pipeline of komeda to fit the requirement. Furthermore, To support multiple IPs, komeda_dev has been split into two layers: - Komeda-CORE or common layer. for the common feature validation and handling - Komeda-CHIP. for reporting and exposing the HW resource by CORE's way, the HW register programming and updating. With this two Layer's device abstraction, the most operations are handled in Komeda-CORE, the Komeda-CHIP is only for CHIP-specific stuff, easy for adding new chipset or IP in future. v2: - Use "pipe" (to replace "ppl") as the short form of "pipeline". - Some editing changes for document according to Randy Dunlap's comments. - Adjusted the position of KOMEDA by alphabetical order. James (Qian) Wang (9): drm/komeda: komeda_dev/pipeline/component definition and initialzation dt/bindings: drm/komeda: Add DT bindings for ARM display processor D71 drm/komeda: Build komeda to be a platform module drm/komeda: Add DT parsing drm/komeda: Add komeda_format_caps for format handling drm/komeda: Add komeda_framebuffer drm/komeda: Attach komeda_dev to DRM-KMS drm/doc: Add initial komeda driver documentation MAINTAINERS: Add maintainer for arm komeda driver .../bindings/display/arm/arm,komeda.txt | 87 ++++ Documentation/gpu/drivers.rst | 1 + Documentation/gpu/komeda-kms.rst | 488 ++++++++++++++++++ MAINTAINERS | 9 + drivers/gpu/drm/arm/Kconfig | 2 + drivers/gpu/drm/arm/Makefile | 1 + drivers/gpu/drm/arm/display/Kbuild | 3 + drivers/gpu/drm/arm/display/Kconfig | 14 + .../gpu/drm/arm/display/include/malidp_io.h | 42 ++ .../drm/arm/display/include/malidp_product.h | 23 + .../drm/arm/display/include/malidp_utils.h | 16 + drivers/gpu/drm/arm/display/komeda/Makefile | 21 + .../gpu/drm/arm/display/komeda/d71/d71_dev.c | 111 ++++ .../gpu/drm/arm/display/komeda/komeda_crtc.c | 106 ++++ .../gpu/drm/arm/display/komeda/komeda_dev.c | 193 +++++++ .../gpu/drm/arm/display/komeda/komeda_dev.h | 113 ++++ .../gpu/drm/arm/display/komeda/komeda_drv.c | 144 ++++++ .../arm/display/komeda/komeda_format_caps.c | 75 +++ .../arm/display/komeda/komeda_format_caps.h | 89 ++++ .../arm/display/komeda/komeda_framebuffer.c | 165 ++++++ .../arm/display/komeda/komeda_framebuffer.h | 31 ++ .../gpu/drm/arm/display/komeda/komeda_kms.c | 168 ++++++ .../gpu/drm/arm/display/komeda/komeda_kms.h | 113 ++++ .../drm/arm/display/komeda/komeda_pipeline.c | 202 ++++++++ .../drm/arm/display/komeda/komeda_pipeline.h | 356 +++++++++++++ .../gpu/drm/arm/display/komeda/komeda_plane.c | 109 ++++ .../arm/display/komeda/komeda_private_obj.c | 87 ++++ 27 files changed, 2769 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/arm/arm,komeda.txt create mode 100644 Documentation/gpu/komeda-kms.rst create mode 100644 drivers/gpu/drm/arm/display/Kbuild create mode 100644 drivers/gpu/drm/arm/display/Kconfig create mode 100644 drivers/gpu/drm/arm/display/include/malidp_io.h create mode 100644 drivers/gpu/drm/arm/display/include/malidp_product.h create mode 100644 drivers/gpu/drm/arm/display/include/malidp_utils.h create mode 100644 drivers/gpu/drm/arm/display/komeda/Makefile create mode 100644 drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_dev.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_dev.h create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_drv.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_format_caps.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.h create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_kms.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_kms.h create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_plane.c create mode 100644 drivers/gpu/drm/arm/display/komeda/komeda_private_obj.c