From patchwork Tue Jan 22 11:10:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 10775377 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 B017991E for ; Tue, 22 Jan 2019 11:10:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D78A2A1B7 for ; Tue, 22 Jan 2019 11:10:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9192E2A1E2; Tue, 22 Jan 2019 11:10:35 +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 2DF1A2A1B7 for ; Tue, 22 Jan 2019 11:10:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDCE66EC8E; Tue, 22 Jan 2019 11:10:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20042.outbound.protection.outlook.com [40.107.2.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82A5F6EC8E for ; Tue, 22 Jan 2019 11:10:32 +0000 (UTC) Received: from DB6PR0801MB1990.eurprd08.prod.outlook.com (10.168.81.21) by DB6PR0801MB2088.eurprd08.prod.outlook.com (10.168.87.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.28; Tue, 22 Jan 2019 11:10:30 +0000 Received: from DB6PR0801MB1990.eurprd08.prod.outlook.com ([fe80::b9be:3d28:78a2:6e33]) by DB6PR0801MB1990.eurprd08.prod.outlook.com ([fe80::b9be:3d28:78a2:6e33%2]) with mapi id 15.20.1537.031; Tue, 22 Jan 2019 11:10:30 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey Subject: [PATCH v2 01/11] drm/komeda: Add komeda_build_display_data_flow Thread-Topic: [PATCH v2 01/11] drm/komeda: Add komeda_build_display_data_flow Thread-Index: AQHUskMVYIlkrRHZF0SiTtKrhRQ0fA== Date: Tue, 22 Jan 2019 11:10:30 +0000 Message-ID: <20190122110932.5138-2-james.qian.wang@arm.com> References: <20190122110932.5138-1-james.qian.wang@arm.com> In-Reply-To: <20190122110932.5138-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: SYAPR01CA0034.ausprd01.prod.outlook.com (2603:10c6:1:1::22) To DB6PR0801MB1990.eurprd08.prod.outlook.com (2603:10a6:4:6c::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0801MB2088; 6:S7infNF6tk02fkCjQyLqJk5Ej+QBR/1zOFM+q02pgIZUPKe7F4U24bn8KK3QIlgB60mbY8zjbWmviDgcLcxWwGZ7xN9rV5yfN0J+gzLblXEcQI00dt/6V9PBHjRtedV+nhsMm9QgeS/ltcfmAn6DZZlBGo+RyV9inf6yXshShveK5yBDBSWqHO1hjl6EhN8aiB7xUCRjZdtGFY7hWp2izUJT9hd/liT0dmFSUUs6aGsW4CJMAZ1q3eaTtdx8RGxQoGe+Zr01DSUKGssBtZF+26MppQYRrusPD22qQRJUCp6zxkw1+MrZwi5433dS5m9pkc7m2YOtl0bRndU7rPEMVWOCdVSG9KPwbr3YXcMKq7JkR/hBr9/KFdHnWZUxy6yZ3CLUaCfkAL8cIKO+TV1cir1XifxwYBa7XUx613D74c9cP6LDFtXe0cNIHEPE/ASNpQvpHuF0ewseFswOT/IjrQ==; 5:54wEIkwAr1JZtkQjKxQxevYcV4X2XXJc0We9nFUhsCA6p07ECaNZnktsxMrPzOGiER4UCryvMgEqXyrVU4ztiS7OS5F+sipFeq1n5luwU7EG5qEqDi/6FotG8AsWmQ9jiGs4scAXfEngKliBSxG/QtnvJ0/RsQ+KtJQ+ITuEDEqMr39LeARFKw0ITz/1IGbw2bmvqorqpORh/gibWcwBnA==; 7:mgdO2BMgcisErujqs7RYnk1MZsVdUq0A9E4ozTDRRX3j2faifByaAgW4SYONLbC4h6dR6AOd7Yumf/02Q44uKhokfqLRBsI/6Qk3b+q8KQB5U0EiKX2o78W7SdgN8bXQ2y7VaERUTXxRM608oVPJwA== x-ms-office365-filtering-correlation-id: f23e699a-86af-4f16-3abd-08d6805a3805 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB2088; x-ms-traffictypediagnostic: DB6PR0801MB2088: nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0925081676 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(346002)(39860400002)(376002)(189003)(199004)(7736002)(76176011)(2501003)(52116002)(256004)(478600001)(55236004)(14444005)(102836004)(6506007)(14454004)(4326008)(386003)(53936002)(186003)(8676002)(6636002)(103116003)(6512007)(26005)(6486002)(50226002)(6436002)(8936002)(6116002)(3846002)(81166006)(81156014)(316002)(106356001)(99286004)(71200400001)(97736004)(110136005)(54906003)(1076003)(2906002)(105586002)(25786009)(36756003)(71190400001)(11346002)(446003)(476003)(68736007)(2616005)(86362001)(486006)(66066001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB2088; H:DB6PR0801MB1990.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: CgImJmT8LMFcxSoNDAxGMCPBZAQnJhGsMn15I1Tut9EN4RBaCglQd/RFoY/Lwd81tUtPUkVRiVx6YMnWYmOF6YlkJ3engquMN8YSDLnCdVGG6Z3QNoEavVpwHXQa8H8fizZC0YQk0IuUu/FycHoPtc3SKKTGUNzaAOX0qxn1+rsP7AhRn974CoRu3R+V/W9OCJHcWg9ixS6EPFZmYqQaTGuqI8edoqipkl1pj0vcBbidIRl2mOvjACWSYItba8/pK9lmcfoXYoKlggTEhb7uo5KBO5krAy8lBaoth1PdnQ7Oa8mlJcJFNwiLBOCrlkknWJO2eGrrbDwCRdRy39Nmz0YOooRxEKR4FaKAadYvHVzHtyGfebilHn6ULyw0ySI7gVw9CbFvlY87VX7zUCKz2OwyRpFsXocYObCAJZLm+nI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f23e699a-86af-4f16-3abd-08d6805a3805 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2019 11:10:21.3688 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2088 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: nd , Ayan Halder , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "malidp@foss.arm.com" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Jin Gao \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "james qian wang (Arm Technology China)" This function builds a display output pipeline according to crtc_state. And this change only added single pipeline support, the dual pipeline with slave enabled data flow support will be added in the following change. v2: Rebase Signed-off-by: James Qian Wang (Arm Technology China) --- .../drm/arm/display/komeda/komeda_pipeline.h | 3 + .../display/komeda/komeda_pipeline_state.c | 76 ++++++++++++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 16d7ae891e81..22ad4dfc3e8d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -400,10 +400,13 @@ void komeda_component_destroy(struct komeda_dev *mdev, struct komeda_plane_state; struct komeda_crtc_state; +struct komeda_crtc; int komeda_build_layer_data_flow(struct komeda_layer *layer, struct komeda_plane_state *kplane_st, struct komeda_crtc_state *kcrtc_st, struct komeda_data_flow_cfg *dflow); +int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, + struct komeda_crtc_state *kcrtc_st); #endif /* _KOMEDA_PIPELINE_H_*/ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index 74d25e542103..6a481508624f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -344,7 +344,7 @@ komeda_compiz_set_input(struct komeda_compiz *compiz, return 0; } -int +static int komeda_compiz_validate(struct komeda_compiz *compiz, struct komeda_crtc_state *state, struct komeda_data_flow_cfg *dflow) @@ -382,6 +382,53 @@ komeda_compiz_validate(struct komeda_compiz *compiz, return 0; } +static int +komeda_improc_validate(struct komeda_improc *improc, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *dflow) +{ + struct drm_crtc *crtc = kcrtc_st->base.crtc; + struct komeda_component_state *c_st; + struct komeda_improc_state *st; + + c_st = komeda_component_get_state_and_set_user(&improc->base, + kcrtc_st->base.state, crtc, crtc); + if (IS_ERR(c_st)) + return PTR_ERR(c_st); + + st = to_improc_st(c_st); + + st->hsize = dflow->in_w; + st->vsize = dflow->in_h; + + komeda_component_add_input(&st->base, &dflow->input, 0); + komeda_component_set_output(&dflow->input, &improc->base, 0); + + return 0; +} + +static int +komeda_timing_ctrlr_validate(struct komeda_timing_ctrlr *ctrlr, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *dflow) +{ + struct drm_crtc *crtc = kcrtc_st->base.crtc; + struct komeda_timing_ctrlr_state *st; + struct komeda_component_state *c_st; + + c_st = komeda_component_get_state_and_set_user(&ctrlr->base, + kcrtc_st->base.state, crtc, crtc); + if (IS_ERR(c_st)) + return PTR_ERR(c_st); + + st = to_ctrlr_st(c_st); + + komeda_component_add_input(&st->base, &dflow->input, 0); + komeda_component_set_output(&dflow->input, &ctrlr->base, 0); + + return 0; +} + int komeda_build_layer_data_flow(struct komeda_layer *layer, struct komeda_plane_state *kplane_st, struct komeda_crtc_state *kcrtc_st, @@ -404,3 +451,30 @@ int komeda_build_layer_data_flow(struct komeda_layer *layer, return err; } + +/* build display output data flow, the data path is: + * compiz -> improc -> timing_ctrlr + */ +int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, + struct komeda_crtc_state *kcrtc_st) +{ + struct komeda_pipeline *master = kcrtc->master; + struct komeda_data_flow_cfg m_dflow; /* master data flow */ + int err; + + memset(&m_dflow, 0, sizeof(m_dflow)); + + err = komeda_compiz_validate(master->compiz, kcrtc_st, &m_dflow); + if (err) + return err; + + err = komeda_improc_validate(master->improc, kcrtc_st, &m_dflow); + if (err) + return err; + + err = komeda_timing_ctrlr_validate(master->ctrlr, kcrtc_st, &m_dflow); + if (err) + return err; + + return 0; +}