From patchwork Thu Jul 4 06:18:17 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: 11031019 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 DD1A61510 for ; Thu, 4 Jul 2019 06:18:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCDD628A35 for ; Thu, 4 Jul 2019 06:18:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA24B28A40; Thu, 4 Jul 2019 06:18:23 +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 320DB28A35 for ; Thu, 4 Jul 2019 06:18:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 666F76E25C; Thu, 4 Jul 2019 06:18:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::61a]) by gabe.freedesktop.org (Postfix) with ESMTPS id B714F6E25C for ; Thu, 4 Jul 2019 06:18:20 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:17 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:17 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 1/6] drm/komeda: Add side by side assembling Thread-Topic: [PATCH 1/6] drm/komeda: Add side by side assembling Thread-Index: AQHVMjBFlYmNC0QkvE69W6T2GlIVsw== Date: Thu, 4 Jul 2019 06:18:17 +0000 Message-ID: <20190704061717.6854-2-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2c9342a2-00dc-4d17-a37f-08d70047673f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(14444005)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(966005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(6306002)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: tjg46lxOO87tBs6rPUbriYzaOuoOW8q4L6hCjCt7YcMaIwC/tumAK5bA484lN0SO15BB0XdXM9CT4BqkPAu5r/nW0dSXDc3mbg3Jrvi750hMQIbweidnDvZXIfL1iIN2pJ2tNPf/x9m9vKmV5gaCBFQsQel2zFoFsgFmiLUNW/YtioLA/xcOk4zDUszLWNkYEboeEJdZ10REdp1AZ1DC2Sq7h5hxsNVHs9Ndnm/C6AmRW+bblSZ62KGFcett8uAXAlVNd7aguRt1e2pHsDQpRHwSIOJr+y1l12w0eDMLT0nktaclhwhhOfJYjpk2eKXJmvhizIuicn4iIff/Rbfh+lgS2rImyF/E9Ud1C1E1CUzAltlZ/tnw/etnaLl5U8i/RA1z3G91Z/g+Uv/NmyJFE+YeK9M170iWCL746441a+E= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c9342a2-00dc-4d17-a37f-08d70047673f X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:17.6633 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bZp3A+Zj58ITdMBc/79NVuDNXIXj7nlNqra73Z2aQZY=; b=cA2OmyC0CZMCm+W/yzgscfmpgYSHCaraJn2n1DkRm42Aifv1fubI9UkjFTHKo2aDhW5IIQu35Y7b6SUB+ydouDKwXBUdeaVSNoQ/rh//PaV9jLxpCCXBCM5wPmq7rOqXHZu87Fydkw5mZuZved5nzLTEGOSX+LmOBaIGGQeCFQY= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Komeda HW can support side by side, which splits the internal display processing to two single halves (LEFT/RIGHT) and handle them by two pipelines separately and simultaneously. The data flow of side_by_side as blow: slave.layer0 ->\ /-> slave.wb_layer -> fb.right_part ... -> slave.compiz -> slave.layer3 ->/ \-> slave.improcessor-> \ /-> output-link0 master.layer0 ->\ /-> master.improcessor ->\-> output-link1 ... -> master.compiz -> master.layer3 ->/ \-> master.wb_layer -> fb.right_part Depends on: - https://patchwork.freedesktop.org/series/62280/ Signed-off-by: James Qian Wang (Arm Technology China) --- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 9 +++- .../gpu/drm/arm/display/komeda/komeda_dev.c | 3 ++ .../gpu/drm/arm/display/komeda/komeda_dev.h | 9 ++++ .../gpu/drm/arm/display/komeda/komeda_kms.h | 3 ++ .../drm/arm/display/komeda/komeda_pipeline.c | 50 +++++++++++++++++-- .../drm/arm/display/komeda/komeda_pipeline.h | 1 + 6 files changed, 69 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 3744e6d1ba96..c3bb111c454c 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -591,16 +591,21 @@ int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms, crtc->master = master; crtc->slave = komeda_pipeline_get_slave(master); + crtc->side_by_side = mdev->side_by_side; if (crtc->slave) sprintf(str, "pipe-%d", crtc->slave->id); else sprintf(str, "None"); - DRM_INFO("CRTC-%d: master(pipe-%d) slave(%s).\n", - kms->n_crtcs, master->id, str); + DRM_INFO("CRTC-%d: master(pipe-%d) slave(%s) sbs(%s).\n", + kms->n_crtcs, master->id, str, + crtc->side_by_side ? "On" : "Off"); kms->n_crtcs++; + + if (mdev->side_by_side) + break; } return 0; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index bb72642cfd67..2aee735a683f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -191,6 +191,9 @@ static int komeda_parse_dt(struct device *dev, struct komeda_dev *mdev) } } + mdev->side_by_side = !of_property_read_u32(np, "side_by_side_master", + &mdev->side_by_side_master); + return ret; } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h index e863ec327790..c70cc25d246f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -176,6 +176,15 @@ struct komeda_dev { /** @irq: irq number */ int irq; + /** + * @side_by_side: + * + * on sbs the whole display frame will be split to two halves (1:2), + * master pipeline handles the left part, slave for the right part + */ + bool side_by_side; + /** @side_by_side_master: master pipe id for side by side */ + int side_by_side_master; /** @lock: used to protect dpmode */ struct mutex lock; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h index d0cf8381d2ab..0dbfd7ad7805 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h @@ -84,6 +84,9 @@ struct komeda_crtc { */ struct komeda_pipeline *slave; + /** @side_by_side: if the master and slave works on side by side mode */ + bool side_by_side; + /** @slave_planes: komeda slave planes mask */ u32 slave_planes; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c index 452e505a1fd3..104e27cc1dc3 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c @@ -326,14 +326,56 @@ static void komeda_pipeline_assemble(struct komeda_pipeline *pipe) struct komeda_pipeline * komeda_pipeline_get_slave(struct komeda_pipeline *master) { - struct komeda_component *slave; + struct komeda_dev *mdev = master->mdev; + struct komeda_component *comp, *slave; + u32 avail_inputs; + + /* on SBS, slave pipeline merge to master via image processor */ + if (mdev->side_by_side) { + comp = &master->improc->base; + avail_inputs = KOMEDA_PIPELINE_IMPROCS; + } else { + comp = &master->compiz->base; + avail_inputs = KOMEDA_PIPELINE_COMPIZS; + } - slave = komeda_component_pickup_input(&master->compiz->base, - KOMEDA_PIPELINE_COMPIZS); + slave = komeda_component_pickup_input(comp, avail_inputs); return slave ? slave->pipeline : NULL; } +static int komeda_assemble_side_by_side(struct komeda_dev *mdev) +{ + struct komeda_pipeline *master, *slave; + int i; + + if (!mdev->side_by_side) + return 0; + + if (mdev->side_by_side_master >= mdev->n_pipelines) { + DRM_ERROR("DT configured side by side master-%d is invalid.\n", + mdev->side_by_side_master); + return -EINVAL; + } + + master = mdev->pipelines[mdev->side_by_side_master]; + slave = komeda_pipeline_get_slave(master); + if (!slave || slave->n_layers != master->n_layers) { + DRM_ERROR("Current HW doesn't support side by side.\n"); + return -EINVAL; + } + + if (!master->dual_link) { + DRM_DEBUG_ATOMIC("SBS can not work without dual link.\n"); + return -EINVAL; + } + + for (i = 0; i < master->n_layers; i++) + master->layers[i]->sbs_slave = slave->layers[i]; + + return 0; +} + int komeda_assemble_pipelines(struct komeda_dev *mdev) { struct komeda_pipeline *pipe; @@ -346,7 +388,7 @@ int komeda_assemble_pipelines(struct komeda_dev *mdev) komeda_pipeline_dump(pipe); } - return 0; + return komeda_assemble_side_by_side(mdev); } void komeda_pipeline_dump_register(struct komeda_pipeline *pipe, diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 66d76642bc5b..6d3745bb8c1d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -236,6 +236,7 @@ struct komeda_layer { * not the source buffer. */ struct komeda_layer *right; + struct komeda_layer *sbs_slave; }; struct komeda_layer_state { From patchwork Thu Jul 4 06:18:27 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: 11031021 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 8A049112C for ; Thu, 4 Jul 2019 06:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A51628A35 for ; Thu, 4 Jul 2019 06:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CF2728A40; Thu, 4 Jul 2019 06:18:33 +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 A721528A35 for ; Thu, 4 Jul 2019 06:18:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA5426E25E; Thu, 4 Jul 2019 06:18:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80049.outbound.protection.outlook.com [40.107.8.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCBE66E25D for ; Thu, 4 Jul 2019 06:18:29 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:27 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:27 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 2/6] drm/komeda: Add side by side plane_state split Thread-Topic: [PATCH 2/6] drm/komeda: Add side by side plane_state split Thread-Index: AQHVMjBKQnzmAbqxSkGNREzJRMThgw== Date: Thu, 4 Jul 2019 06:18:27 +0000 Message-ID: <20190704061717.6854-3-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b1d003a2-e5d2-447c-7efa-08d700476cd5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(30864003)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: DzeJLFzwNRPTbbs/1QgDpxcSjSgx3kE2jgCminQ0vVNMbTyzd5Rn0rbbVD8b6IvGimx4J9CIqjnrNyevxqcW0IeAAfqIREpS5RhQhvPhPr9g15ukPDHm1o7noXZxgJIa41maXehzBdXl3S6yW5nWRpSi5De9k1B2unNaEEzmnnFyROeDuHu0LDKcc01knnUD5LEVGlzDU13AAalv9NPU5ZLvnLtNbKmZmhk5jqhfqd4sgvPnvKoQpdN4Hbo6MHpmVgHXWIxqtrOSlLhT/qMsWqxcesDwTbXG6YeLdsP13mBu3jPz81nFBV1gIEsL0hleNTUq5TsHPcV1Iya0cUSRv1ZJtodPi2LVnER80QsEiTaJqMhaEixIxSL5c7+2p75LeYeqdTC9sjtVnCUD/WzGYuE9xlx+8TPcXoFk2Zs8Aec= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1d003a2-e5d2-447c-7efa-08d700476cd5 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:27.0340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eVJmM650iZrJXShIkidsXZ6RIhGHrmzctzH2PLmRtrY=; b=aWNyQl6lBrsVQzFyiA0Syhf89Y3cW0qyYHxiOG4Ghlr/h1AK5SGxWojJakXwSFENg7RW7Vfy6Q8nB2y8jyJQ/iV+3cKEPtQaP3fnHETZ4rJhZSjSqrKnl/3geUMBIHwmf5qMvqaH8cZ6JU4pWW2qWezSdZT9MZUu4Q0DYPYbcvs= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On side by side mode, The full display frame will be split into two parts (Left/Right), and each part will be handled by a single pipeline separately master pipeline for left part, slave for right. To simplify the usage and implementation, komeda use the following scheme to do the side by side split 1. The planes also have been grouped into two classes: master-planes and slave-planes. 2. The master plane can display its image on any location of the final/full display frame, komeda will help to split the plane configuration to two parts and fed them into master and slave pipelines. 3. The slave plane only can put its display rect on the right part of the final display frame, and its data is only can be fed into the slave pipeline. From the perspective of resource usage and assignment: The master plane can use the resources from the master pipeline and slave pipeline both, but slave plane only can use the slave pipeline resources. With such scheme, the usage of master planes are same as the none side_by_side mode. user can easily skip the slave planes and no need to consider side_by_side for them. Signed-off-by: James Qian Wang (Arm Technology China) --- .../drm/arm/display/komeda/komeda_pipeline.h | 33 ++- .../display/komeda/komeda_pipeline_state.c | 188 ++++++++++++++++++ .../gpu/drm/arm/display/komeda/komeda_plane.c | 7 +- 3 files changed, 220 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 6d3745bb8c1d..aa7c0fefa47e 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -511,6 +511,20 @@ komeda_component_pickup_output(struct komeda_component *c, u32 avail_comps) return komeda_pipeline_get_first_component(c->pipeline, avail_inputs); } +static inline const char * +komeda_data_flow_msg(struct komeda_data_flow_cfg *config) +{ + static char str[128]; + + snprintf(str, sizeof(str), + "rot: %x src[x/y:%d/%d, w/h:%d/%d] disp[x/y:%d/%d, w/h:%d/%d]", + config->rot, + config->in_x, config->in_y, config->in_w, config->in_h, + config->out_x, config->out_y, config->out_w, config->out_h); + + return str; +} + struct komeda_plane_state; struct komeda_crtc_state; struct komeda_crtc; @@ -522,22 +536,27 @@ 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_wb_data_flow(struct komeda_layer *wb_layer, - struct drm_connector_state *conn_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); - int komeda_build_layer_split_data_flow(struct komeda_layer *left, struct komeda_plane_state *kplane_st, struct komeda_crtc_state *kcrtc_st, struct komeda_data_flow_cfg *dflow); +int komeda_build_layer_sbs_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_wb_data_flow(struct komeda_layer *wb_layer, + struct drm_connector_state *conn_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *dflow); int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer, struct drm_connector_state *conn_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); + int komeda_release_unclaimed_resources(struct komeda_pipeline *pipe, struct komeda_crtc_state *kcrtc_st); 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 9123284c98a1..c08d59ae7090 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1102,6 +1102,194 @@ int komeda_build_layer_split_data_flow(struct komeda_layer *left, return err; } +/* split func will split configuration of master plane to two layer data + * flows, which will be fed into master and slave pipeline then. + * NOTE: @m_dflow is first used as input argument to pass the configuration of + * master_plane. when the split is done, @*m_dflow @*s_dflow are the + * output data flow for pipeline. + */ +static int +komeda_split_sbs_master_data_flow(struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg **m_dflow, + struct komeda_data_flow_cfg **s_dflow) +{ + struct komeda_data_flow_cfg *master = *m_dflow; + struct komeda_data_flow_cfg *slave = *s_dflow; + u32 disp_end = master->out_x + master->out_w; + u16 boundary; + + pipeline_composition_size(kcrtc_st, &boundary, NULL); + + if (disp_end <= boundary) { + /* the master viewport only located in master side, no need + * slave anymore + */ + *s_dflow = NULL; + } else if ((master->out_x < boundary) && (disp_end > boundary)) { + /* the master viewport across two pipelines, split it */ + bool flip_h = has_flip_h(master->rot); + bool r90 = drm_rotation_90_or_270(master->rot); + u32 src_x = master->in_x; + u32 src_y = master->in_y; + u32 src_w = master->in_w; + u32 src_h = master->in_h; + + if (master->en_scaling || master->en_img_enhancement) { + DRM_DEBUG_ATOMIC("sbs doesn't support to split a scaling image.\n"); + return -EINVAL; + } + + memcpy(slave, master, sizeof(*master)); + + /* master for left part of display, slave for the right part */ + /* split the disp_rect */ + master->out_w = boundary - master->out_x; + slave->out_w = disp_end - boundary; + slave->out_x = 0; + + if (r90) { + master->in_h = master->out_w; + slave->in_h = slave->out_w; + + if (flip_h) + master->in_y = src_y + src_h - master->in_h; + else + slave->in_y = src_y + src_h - slave->in_h; + } else { + master->in_w = master->out_w; + slave->in_w = slave->out_w; + + /* on flip_h, the left display content from the right-source */ + if (flip_h) + master->in_x = src_w + src_x - master->in_w; + else + slave->in_x = src_w + src_x - slave->in_w; + } + } else if (master->out_x >= boundary) { + /* disp_rect only locate in right part, move the dflow to slave */ + master->out_x -= boundary; + *s_dflow = master; + *m_dflow = NULL; + } + + return 0; +} + +static int +komeda_split_sbs_slave_data_flow(struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *slave) +{ + u16 boundary; + + pipeline_composition_size(kcrtc_st, &boundary, NULL); + + if (slave->out_x < boundary) { + DRM_DEBUG_ATOMIC("SBS Slave plane is only allowed to configure the right part frame.\n"); + return -EINVAL; + } + + /* slave->disp_rect locate in the right part */ + slave->out_x -= boundary; + + return 0; +} + +/* On side by side mode, The full display frame will be split to two parts + * (Left/Right), and each part will be handled by a single pipeline separately, + * master pipeline for left part, slave for right. + * + * To simplify the usage and implementation, komeda use the following scheme + * to do the side by side split + * 1. The planes also have been grouped into two classes: + * master-planes and slave-planes. + * 2. The master plane can display its image on any location of the final/full + * display frame, komeda will help to split the plane configuration to two + * parts and fed them into master and slave pipelines. + * 3. The slave plane only can put its display rect on the right part of the + * final display frame, and its data is only can be fed into the slave + * pipeline. + * + * From the perspective of resource usage and assignment: + * The master plane can use the resources from the master pipeline and slave + * pipeline both, but slave plane only can use the slave pipeline resources. + * + * With such scheme, the usage of master planes are same as the none + * side_by_side mode. user can easily skip the slave planes and no need to + * consider side_by_side for them. + * + * NOTE: side_by_side split is occurred on pipeline level which split the plane + * data flow into pipelines, but the layer split is a pipeline + * internal split which splits the data flow into pipeline layers. + * So komeda still supports to apply a further layer split to the sbs + * split data flow. + */ +int komeda_build_layer_sbs_data_flow(struct komeda_layer *layer, + struct komeda_plane_state *kplane_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *dflow) +{ + struct komeda_crtc *kcrtc = to_kcrtc(kcrtc_st->base.crtc); + struct drm_plane *plane = kplane_st->base.plane; + struct komeda_data_flow_cfg temp, *master_dflow, *slave_dflow; + struct komeda_layer *master, *slave; + bool master_plane = layer->base.pipeline == kcrtc->master; + int err; + + DRM_DEBUG_ATOMIC("SBS prepare %s-[PLANE:%d:%s]: %s.\n", + master_plane ? "Master" : "Slave", + plane->base.id, plane->name, + komeda_data_flow_msg(dflow)); + + if (master_plane) { + master = layer; + slave = layer->sbs_slave; + master_dflow = dflow; + slave_dflow = &temp; + err = komeda_split_sbs_master_data_flow(kcrtc_st, + &master_dflow, &slave_dflow); + } else { + master = NULL; + slave = layer; + master_dflow = NULL; + slave_dflow = dflow; + err = komeda_split_sbs_slave_data_flow(kcrtc_st, slave_dflow); + } + + if (err) + return err; + + if (master_dflow) { + DRM_DEBUG_ATOMIC("SBS Master-%s assigned: %s\n", + master->base.name, komeda_data_flow_msg(master_dflow)); + + if (master_dflow->en_split) + err = komeda_build_layer_split_data_flow(master, + kplane_st, kcrtc_st, master_dflow); + else + err = komeda_build_layer_data_flow(master, + kplane_st, kcrtc_st, master_dflow); + + if (err) + return err; + } + + if (slave_dflow) { + DRM_DEBUG_ATOMIC("SBS Slave-%s assigned: %s\n", + slave->base.name, komeda_data_flow_msg(slave_dflow)); + + if (slave_dflow->en_split) + err = komeda_build_layer_split_data_flow(slave, + kplane_st, kcrtc_st, slave_dflow); + else + err = komeda_build_layer_data_flow(slave, + kplane_st, kcrtc_st, slave_dflow); + if (err) + return err; + } + + return 0; +} + /* writeback data path: compiz -> scaler -> wb_layer -> memory */ int komeda_build_wb_data_flow(struct komeda_layer *wb_layer, struct drm_connector_state *conn_st, diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index a5625f46120f..436dda1ca6dd 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -81,6 +81,7 @@ komeda_plane_atomic_check(struct drm_plane *plane, struct komeda_plane_state *kplane_st = to_kplane_st(state); struct komeda_layer *layer = kplane->layer; struct drm_crtc_state *crtc_st; + struct komeda_crtc *kcrtc; struct komeda_crtc_state *kcrtc_st; struct komeda_data_flow_cfg dflow; int err; @@ -98,13 +99,17 @@ komeda_plane_atomic_check(struct drm_plane *plane, if (!crtc_st->active) return 0; + kcrtc = to_kcrtc(crtc_st->crtc); kcrtc_st = to_kcrtc_st(crtc_st); err = komeda_plane_init_data_flow(state, kcrtc_st, &dflow); if (err) return err; - if (dflow.en_split) + if (kcrtc->side_by_side) + err = komeda_build_layer_sbs_data_flow(layer, + kplane_st, kcrtc_st, &dflow); + else if (dflow.en_split) err = komeda_build_layer_split_data_flow(layer, kplane_st, kcrtc_st, &dflow); else From patchwork Thu Jul 4 06:18:34 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: 11031023 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 D6D2F1510 for ; Thu, 4 Jul 2019 06:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7BF328A35 for ; Thu, 4 Jul 2019 06:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB4D228A40; Thu, 4 Jul 2019 06:18:40 +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 163D028A35 for ; Thu, 4 Jul 2019 06:18:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D3736E25F; Thu, 4 Jul 2019 06:18:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80057.outbound.protection.outlook.com [40.107.8.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 448D26E25F for ; Thu, 4 Jul 2019 06:18:37 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:34 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:34 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 3/6] drm/komeda: Build side by side display output pipeline Thread-Topic: [PATCH 3/6] drm/komeda: Build side by side display output pipeline Thread-Index: AQHVMjBPznLosmBrJkG/lSXffkzMNw== Date: Thu, 4 Jul 2019 06:18:34 +0000 Message-ID: <20190704061717.6854-4-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d6f44fee-b458-4b37-b65f-08d70047715f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:285; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(14444005)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iaTAfYXDdDnVSrR0is6QAFImnjNpr3gz+dVGuagRy8VZqv31noZXZJgYf2K+d34fI1lhVfjFbjdobqDPiDUcwJ034Zx3Sctuhb022cMqBfTs/INYxN7T3/yNaDykTw3p/su88Yq0jlD1nF+SP7rjsDGFohluIV1AleUrKuRYV65THwi31h95fXXox9EkBAjkhG2YZBDTwuPf1Vtg7Msit3wnSwWl5ZQhtDGZlAZdMQownb4fnj2jQwHwcVwGmiNr7alZrVSeD4zXvv/x2my5hYVTYAVbZPYQYPywpJnSdnr//TcwWmcljaKcXgkZt78omVlSssLGFDekpusakquM2buBL5Q1t+XioODgDMQpxDEr8XQnotkCI/5aHC0BjqmLoeIIp6bcMw7qi97lZxmAY5I6zMC/H6JsG11Q9mfZK1o= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6f44fee-b458-4b37-b65f-08d70047715f X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:34.4568 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mVRM3cE3gTYSYV1gfI1lyaN8EdenOI0Ejgkx7GicXUM=; b=W+6Dpm12hoZCOvqiybXIReBRm8w7cBhB4Ar14kIcEKCyrq972dlvYB23svZyhqPJXR+sebcW80oafx2RbUHiQXBgX/UEcWjEQ3DVhbdopZluTrhCIShoroWIIr3JrMzyGBRrlXoFW8eDV07KAIETGwubTnB/G7zhyiKVySfdh8c= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For side by side, the slave pipeline merges to master via image processor slave-layers -> slave-compiz-> slave-improc- \ master-layers -> master-compiz -------------> master-improc -> Signed-off-by: James Qian Wang (Arm Technology China) --- .../arm/display/komeda/d71/d71_component.c | 4 ++ .../gpu/drm/arm/display/komeda/komeda_crtc.c | 19 ++++--- .../drm/arm/display/komeda/komeda_pipeline.h | 1 + .../display/komeda/komeda_pipeline_state.c | 51 ++++++++++++++----- .../arm/display/komeda/komeda_wb_connector.c | 2 +- 5 files changed, 56 insertions(+), 21 deletions(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c index c1355f5cb47d..a68954bb594a 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c @@ -985,6 +985,10 @@ static void d71_improc_update(struct komeda_component *c, else if (st->color_format == DRM_COLOR_FORMAT_YCRCB444) ctrl |= IPS_CTRL_YUV; + /* slave input has been enabled, means side by side */ + if (has_bit(1, state->active_inputs)) + ctrl |= IPS_CTRL_SBS; + malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl); } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index c3bb111c454c..133ea4728149 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -361,19 +361,26 @@ komeda_crtc_atomic_flush(struct drm_crtc *crtc, komeda_crtc_do_flush(crtc, old); } -/* Returns the minimum frequency of the aclk rate (main engine clock) in Hz */ +/* + * Returns the minimum frequency of the aclk rate (main engine clock) in Hz. + * + * The DPU output can be split into two halves, to stay within the bandwidth + * capabilities of the external link (dual-link mode). + * In these cases, each output link runs at half the pixel clock rate of the + * combined display, and has half the number of pixels. + * Beside split the output, the DPU internal pixel processing also can be split + * into two halves (LEFT/RIGHT) and handles by two pipelines simultaneously. + * So if side by side, the pipeline (main engine clock) also can run at half + * the clock rate of the combined display. + */ static unsigned long komeda_calc_min_aclk_rate(struct komeda_crtc *kcrtc, unsigned long pxlclk) { - /* Once dual-link one display pipeline drives two display outputs, - * the aclk needs run on the double rate of pxlclk - */ - if (kcrtc->master->dual_link) + if (kcrtc->master->dual_link && !kcrtc->side_by_side) return pxlclk * 2; else return pxlclk; - } /* Get current aclk rate that specified by state */ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index aa7c0fefa47e..3358bcea8f7d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -530,6 +530,7 @@ struct komeda_crtc_state; struct komeda_crtc; void pipeline_composition_size(struct komeda_crtc_state *kcrtc_st, + bool side_by_side, u16 *hsize, u16 *vsize); int komeda_build_layer_data_flow(struct komeda_layer *layer, 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 c08d59ae7090..4e5c891fbbd4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -637,12 +637,13 @@ komeda_merger_validate(struct komeda_merger *merger, } void pipeline_composition_size(struct komeda_crtc_state *kcrtc_st, + bool side_by_side, u16 *hsize, u16 *vsize) { struct drm_display_mode *m = &kcrtc_st->base.adjusted_mode; if (hsize) - *hsize = m->hdisplay; + *hsize = side_by_side ? m->hdisplay / 2 : m->hdisplay; if (vsize) *vsize = m->vdisplay; } @@ -653,12 +654,14 @@ komeda_compiz_set_input(struct komeda_compiz *compiz, struct komeda_data_flow_cfg *dflow) { struct drm_atomic_state *drm_st = kcrtc_st->base.state; + struct drm_crtc *crtc = kcrtc_st->base.crtc; struct komeda_component_state *c_st, *old_st; struct komeda_compiz_input_cfg *cin; u16 compiz_w, compiz_h; int idx = dflow->blending_zorder; - pipeline_composition_size(kcrtc_st, &compiz_w, &compiz_h); + pipeline_composition_size(kcrtc_st, to_kcrtc(crtc)->side_by_side, + &compiz_w, &compiz_h); /* check display rect */ if ((dflow->out_x + dflow->out_w > compiz_w) || (dflow->out_y + dflow->out_h > compiz_h) || @@ -670,7 +673,7 @@ komeda_compiz_set_input(struct komeda_compiz *compiz, } c_st = komeda_component_get_state_and_set_user(&compiz->base, drm_st, - kcrtc_st->base.crtc, kcrtc_st->base.crtc); + crtc, crtc); if (IS_ERR(c_st)) return PTR_ERR(c_st); @@ -704,17 +707,19 @@ komeda_compiz_validate(struct komeda_compiz *compiz, struct komeda_crtc_state *state, struct komeda_data_flow_cfg *dflow) { + struct drm_crtc *crtc = state->base.crtc; struct komeda_component_state *c_st; struct komeda_compiz_state *st; c_st = komeda_component_get_state_and_set_user(&compiz->base, - state->base.state, state->base.crtc, state->base.crtc); + state->base.state, crtc, crtc); if (IS_ERR(c_st)) return PTR_ERR(c_st); st = to_compiz_st(c_st); - pipeline_composition_size(state, &st->hsize, &st->vsize); + pipeline_composition_size(state, to_kcrtc(crtc)->side_by_side, + &st->hsize, &st->vsize); komeda_component_set_output(&dflow->input, &compiz->base, 0); @@ -740,7 +745,8 @@ komeda_compiz_validate(struct komeda_compiz *compiz, static int komeda_improc_validate(struct komeda_improc *improc, struct komeda_crtc_state *kcrtc_st, - struct komeda_data_flow_cfg *dflow) + struct komeda_data_flow_cfg *m_dflow, + struct komeda_data_flow_cfg *s_dflow) { struct drm_crtc *crtc = kcrtc_st->base.crtc; struct drm_crtc_state *crtc_st = &kcrtc_st->base; @@ -754,8 +760,8 @@ komeda_improc_validate(struct komeda_improc *improc, st = to_improc_st(c_st); - st->hsize = dflow->in_w; - st->vsize = dflow->in_h; + st->hsize = m_dflow->in_w; + st->vsize = m_dflow->in_h; if (drm_atomic_crtc_needs_modeset(crtc_st)) { u32 output_depths, output_formats; @@ -793,8 +799,10 @@ komeda_improc_validate(struct komeda_improc *improc, drm_ctm_to_coeffs(kcrtc_st->base.ctm, st->ctm_coeffs); } - komeda_component_add_input(&st->base, &dflow->input, 0); - komeda_component_set_output(&dflow->input, &improc->base, 0); + komeda_component_add_input(&st->base, &m_dflow->input, 0); + if (s_dflow) + komeda_component_add_input(&st->base, &s_dflow->input, 1); + komeda_component_set_output(&m_dflow->input, &improc->base, 0); return 0; } @@ -1118,7 +1126,7 @@ komeda_split_sbs_master_data_flow(struct komeda_crtc_state *kcrtc_st, u32 disp_end = master->out_x + master->out_w; u16 boundary; - pipeline_composition_size(kcrtc_st, &boundary, NULL); + pipeline_composition_size(kcrtc_st, true, &boundary, NULL); if (disp_end <= boundary) { /* the master viewport only located in master side, no need @@ -1181,7 +1189,7 @@ komeda_split_sbs_slave_data_flow(struct komeda_crtc_state *kcrtc_st, { u16 boundary; - pipeline_composition_size(kcrtc_st, &boundary, NULL); + pipeline_composition_size(kcrtc_st, true, &boundary, NULL); if (slave->out_x < boundary) { DRM_DEBUG_ATOMIC("SBS Slave plane is only allowed to configure the right part frame.\n"); @@ -1356,7 +1364,20 @@ int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, memset(&m_dflow, 0, sizeof(m_dflow)); memset(&s_dflow, 0, sizeof(s_dflow)); - if (slave && has_bit(slave->id, kcrtc_st->active_pipes)) { + /* build slave output data flow */ + if (kcrtc->side_by_side) { + /* on side by side, the slave data flows into the improc of + * itself first, and then merge it into master's image processor + */ + err = komeda_compiz_validate(slave->compiz, kcrtc_st, &s_dflow); + if (err) + return err; + + err = komeda_improc_validate(slave->improc, kcrtc_st, + &s_dflow, NULL); + if (err) + return err; + } else if (slave && has_bit(slave->id, kcrtc_st->active_pipes)) { err = komeda_compiz_validate(slave->compiz, kcrtc_st, &s_dflow); if (err) return err; @@ -1372,7 +1393,9 @@ int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, if (err) return err; - err = komeda_improc_validate(master->improc, kcrtc_st, &m_dflow); + /* on side by side, merge the slave dflow into master */ + err = komeda_improc_validate(master->improc, kcrtc_st, &m_dflow, + kcrtc->side_by_side ? &s_dflow : NULL); if (err) return err; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index e6f66922843c..c1b0ad22422e 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -22,7 +22,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer, dflow->out_h = fb->height; /* the write back data comes from the compiz */ - pipeline_composition_size(kcrtc_st, &dflow->in_w, &dflow->in_h); + pipeline_composition_size(kcrtc_st, false, &dflow->in_w, &dflow->in_h); dflow->input.component = &wb_layer->base.pipeline->compiz->base; /* compiz doesn't output alpha */ dflow->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE; From patchwork Thu Jul 4 06:18:41 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: 11031025 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 9339F1510 for ; Thu, 4 Jul 2019 06:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8643228A35 for ; Thu, 4 Jul 2019 06:18:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79DD128A40; Thu, 4 Jul 2019 06:18: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 11DC228A35 for ; Thu, 4 Jul 2019 06:18:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D6CE6E260; Thu, 4 Jul 2019 06:18:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56EF66E260 for ; Thu, 4 Jul 2019 06:18:44 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:41 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:41 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 4/6] drm/komeda: Add side by side support for writeback Thread-Topic: [PATCH 4/6] drm/komeda: Add side by side support for writeback Thread-Index: AQHVMjBTbFY0GrGtY0Kn+yCBeCAL7A== Date: Thu, 4 Jul 2019 06:18:41 +0000 Message-ID: <20190704061717.6854-5-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 74c61768-3ca0-4353-ac3c-08d7004775af x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:785; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(14444005)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mvKGSR39R8xB12Uo8XM4gONHfmtHBk9duHs0ov6XcKu32afyUQxpWs+RqCRiVbkFtinO0ZK/NonLooRQwqCNQ7jfMrsbFlXSNDH2udraOr6qJuIbl329yiOruzsBagPkmzzp8PIr0eJ1ERIcRvW9aclvCUZD28hkuYlYALjmlv8S1FSXRM/NuVZA7VJZxhj4o5iAoRUkLrxdFcW7QGlGJN9fptzFKktfpzb/ZWUgloHCbJ9o9T+1J57H5oMq30fKxrtklonXvb+3grT7pzlFCO/VwB0VZxaptoZLr9YwaXGgYGfYrgnsZq4hmKF5uZgX6GoWoRpRAnVuVfzE6GRYXBTGqBHhBrkI7kvVA+vRMFTKnE7MN34RIjpwpjUcQmGLtubYT1RpVYyXW6WhUnrAWwMHSBfiCZeCNt3uGw2o5cs= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74c61768-3ca0-4353-ac3c-08d7004775af X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:41.7637 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ywYIGffmJVJTuipwozQ7D/vOtWbzSjF3LL/JViTvy1o=; b=+SJVZczY3YEuKbYCfEhn4/a78x3KyElHvavJYQU6AIsDCEA+fnOPNZtFoZ6XqoxkJTGIO8riJx7q3lFm6Ajht0OtIsVTVLCG/ysL2EpT5mgTjJtg0XZn4zBwIjoFmYAsFkH+CF0QYHi19fHVu0w/AgxzIztQX6B1bRMn8JpZo50= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In side by side mode, the master pipeline writeback the left frame and the slave writeback the right part, the data flow as below: slave.compiz -> slave.wb_layer -> fb (right-part) master.compiz -> master.wb_layer -> fb (left-part) Signed-off-by: James Qian Wang (Arm Technology China) --- .../drm/arm/display/komeda/komeda_pipeline.h | 4 ++ .../display/komeda/komeda_pipeline_state.c | 42 +++++++++++++++++++ .../arm/display/komeda/komeda_wb_connector.c | 6 ++- 3 files changed, 51 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 3358bcea8f7d..9145af3355f4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -554,6 +554,10 @@ int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer, struct drm_connector_state *conn_st, struct komeda_crtc_state *kcrtc_st, struct komeda_data_flow_cfg *dflow); +int komeda_build_wb_sbs_data_flow(struct komeda_crtc *kcrtc, + struct drm_connector_state *conn_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *wb_dflow); int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, struct komeda_crtc_state *kcrtc_st); 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 4e5c891fbbd4..9fcd3d7cabe5 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1349,6 +1349,48 @@ int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer, return komeda_wb_layer_validate(wb_layer, conn_st, dflow); } +/* writeback side by side split data path: + * + * slave.compiz -> slave.wb_layer - > fb (right-part) + * master.compiz -> master.wb_layer -> fb (left-part) + */ +int komeda_build_wb_sbs_data_flow(struct komeda_crtc *kcrtc, + struct drm_connector_state *conn_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *wb_dflow) +{ + struct komeda_pipeline *master = kcrtc->master; + struct komeda_pipeline *slave = kcrtc->slave; + struct komeda_data_flow_cfg m_dflow, s_dflow; + int err; + + if (wb_dflow->en_scaling || wb_dflow->en_img_enhancement) { + DRM_DEBUG_ATOMIC("sbs doesn't support WB_scaling\n"); + return -EINVAL; + } + + memcpy(&m_dflow, wb_dflow, sizeof(*wb_dflow)); + memcpy(&s_dflow, wb_dflow, sizeof(*wb_dflow)); + + /* master writeout the left part */ + m_dflow.in_w >>= 1; + m_dflow.out_w >>= 1; + m_dflow.input.component = &master->compiz->base; + + /* slave writeout the right part */ + s_dflow.in_w >>= 1; + s_dflow.out_w >>= 1; + s_dflow.in_x += m_dflow.in_w; + s_dflow.out_x += m_dflow.out_w; + s_dflow.input.component = &slave->compiz->base; + + err = komeda_wb_layer_validate(master->wb_layer, conn_st, &m_dflow); + if (err) + return err; + + return komeda_wb_layer_validate(slave->wb_layer, conn_st, &s_dflow); +} + /* build display output data flow, the data path is: * compiz -> improc -> timing_ctrlr */ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index c1b0ad22422e..ea584b1e5bd2 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -45,6 +45,7 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_st, struct drm_connector_state *conn_st) { + struct komeda_crtc *kcrtc = to_kcrtc(crtc_st->crtc); struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st); struct drm_writeback_job *writeback_job = conn_st->writeback_job; struct komeda_layer *wb_layer; @@ -73,7 +74,10 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder, if (err) return err; - if (dflow.en_split) + if (kcrtc->side_by_side) + err = komeda_build_wb_sbs_data_flow(kcrtc, + conn_st, kcrtc_st, &dflow); + else if (dflow.en_split) err = komeda_build_wb_split_data_flow(wb_layer, conn_st, kcrtc_st, &dflow); else From patchwork Thu Jul 4 06:18:49 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: 11031027 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 20E99112C for ; Thu, 4 Jul 2019 06:18:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119F628A35 for ; Thu, 4 Jul 2019 06:18:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04CC928A40; Thu, 4 Jul 2019 06:18:54 +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 99CB628A35 for ; Thu, 4 Jul 2019 06:18:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C522D6E261; Thu, 4 Jul 2019 06:18:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80043.outbound.protection.outlook.com [40.107.8.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A7C2F6E261 for ; Thu, 4 Jul 2019 06:18:51 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:49 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:49 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Topic: [PATCH 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Index: AQHVMjBXsi95oRG0aUKNUDy22dS6Ow== Date: Thu, 4 Jul 2019 06:18:49 +0000 Message-ID: <20190704061717.6854-6-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 438e669d-937d-4595-8557-08d700477a26 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Y/bf+jm6LC616ZSjlQodJ23eEqYfzQoFIoizEIR482AB+99dddqTHEFoIjb1SG56qUJ4WY5phxVABTBo+GX6wRbfJ9S+R4rG36u/ot/av2pnqBvXpPC4IxboZAtLzC7Gg1sBk6hhvYerkMzwoebIk/Bhzt2gi71oLEM/SUSGSI+MpK2UKohBOVn8f4rhvhPEH454oOb061w52Jcxb8x5jhyZC7sq5LyFj2OwBpgjtcKPOeUpJ4Trrb8Az1ic4VBQzOUeEGSTOyQkO4yzppH/G0a95/+smJ9UU0apdTm8zq0KIAxOndL3T6MzRpOCRSaS40NaH8/ClDIxHV5EgVbAVPDuHgnkLDC9g9EFb+/A/DejLhR6W6UGvcoCUgjsfnXEfuoBwwwGTX21v5Ed2Fu55lHoYI7sUdfzCm3QKbP8ky8= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 438e669d-937d-4595-8557-08d700477a26 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:49.1915 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I5cDa+jXFxFlTb5B+nQ6ibtWucIh9j1Ger14n2h7rdc=; b=sPtul+51vrBvhbhBzoYKO8PAI5Iw5luyTaaKHKXP8zTY4DgqKHN6UdlWodwAks4dT/YlkKPFvB2vq1VvD02b5h6ewDKHHSuW4IkWQHE1fzbK+5M2spsxgdoFR544ibD56bXhR1719683x0CnDNW3prgII8YICVMtu3RMMu4VM7c= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In side by side mode, a writeback job is completed by two pipelines: left by master and right by slave, we need to wait both pipeline finished (EOW), then can signal the writeback job completion. Signed-off-by: James Qian Wang (Arm Technology China) --- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 23 ++++++++++--------- .../gpu/drm/arm/display/komeda/komeda_kms.h | 5 ++++ .../arm/display/komeda/komeda_wb_connector.c | 3 +++ 3 files changed, 20 insertions(+), 11 deletions(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 133ea4728149..ca1bef8fb8dc 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -194,27 +194,28 @@ komeda_crtc_unprepare(struct komeda_crtc *kcrtc) return err; } -void komeda_crtc_handle_event(struct komeda_crtc *kcrtc, +void komeda_crtc_handle_event(struct komeda_crtc *kcrtc, struct komeda_events *evts) { struct drm_crtc *crtc = &kcrtc->base; + struct komeda_wb_connector *wb_conn = kcrtc->wb_conn; u32 events = evts->pipes[kcrtc->master->id]; if (events & KOMEDA_EVENT_VSYNC) drm_crtc_handle_vblank(crtc); - if (events & KOMEDA_EVENT_EOW) { - struct komeda_wb_connector *wb_conn = kcrtc->wb_conn; + /* handles writeback event */ + if (events & KOMEDA_EVENT_EOW) + wb_conn->complete_pipes |= BIT(kcrtc->master->id); - if (wb_conn) - drm_writeback_signal_completion(&wb_conn->base, 0); - else - DRM_WARN("CRTC[%d]: EOW happen but no wb_connector.\n", - drm_crtc_index(&kcrtc->base)); + if (kcrtc->side_by_side && + (evts->pipes[kcrtc->slave->id] & KOMEDA_EVENT_EOW)) + wb_conn->complete_pipes |= BIT(kcrtc->slave->id); + + if (wb_conn->expected_pipes == wb_conn->complete_pipes) { + wb_conn->complete_pipes = 0; + drm_writeback_signal_completion(&wb_conn->base, 0); } - /* will handle it together with the write back support */ - if (events & KOMEDA_EVENT_EOW) - DRM_DEBUG("EOW.\n"); if (events & KOMEDA_EVENT_FLIP) { unsigned long flags; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h index 0dbfd7ad7805..3cb57ea82192 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h @@ -66,6 +66,11 @@ struct komeda_wb_connector { /** @wb_layer: represents associated writeback pipeline of komeda */ struct komeda_layer *wb_layer; + + /** @expected_pipes: pipelines are used for the writeback job */ + u32 expected_pipes; + /** @complete_pipes: pipelines which have finished writeback */ + u32 complete_pipes; }; /** diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index ea584b1e5bd2..9787745713df 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -165,6 +165,9 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, return -ENOMEM; kwb_conn->wb_layer = kcrtc->master->wb_layer; + kwb_conn->expected_pipes = BIT(kcrtc->master->id); + if (kcrtc->side_by_side) + kwb_conn->expected_pipes |= BIT(kcrtc->slave->id); wb_conn = &kwb_conn->base; wb_conn->encoder.possible_crtcs = BIT(drm_crtc_index(&kcrtc->base)); From patchwork Thu Jul 4 06:18:56 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: 11031029 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 7B78E112C for ; Thu, 4 Jul 2019 06:19:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B76B28A35 for ; Thu, 4 Jul 2019 06:19:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C76B28A40; Thu, 4 Jul 2019 06:19:01 +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 0A5F928A35 for ; Thu, 4 Jul 2019 06:19:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 518936E263; Thu, 4 Jul 2019 06:19:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0618.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::618]) by gabe.freedesktop.org (Postfix) with ESMTPS id E290B6E263 for ; Thu, 4 Jul 2019 06:18:58 +0000 (UTC) Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB4637.eurprd08.prod.outlook.com (10.255.27.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.18; Thu, 4 Jul 2019 06:18:56 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::4062:a380:35ba:11d1%3]) with mapi id 15.20.2032.019; Thu, 4 Jul 2019 06:18:56 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" Subject: [PATCH 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Topic: [PATCH 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Index: AQHVMjBc6ENIwv9q1EWZDI2YhrNJoA== Date: Thu, 4 Jul 2019 06:18:56 +0000 Message-ID: <20190704061717.6854-7-james.qian.wang@arm.com> References: <20190704061717.6854-1-james.qian.wang@arm.com> In-Reply-To: <20190704061717.6854-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: HK0PR01CA0070.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f96b871c-6a22-453b-4a7f-08d700477e83 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4637; x-ms-traffictypediagnostic: VE1PR08MB4637: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:2733; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(199004)(189003)(99286004)(110136005)(14444005)(36756003)(68736007)(256004)(52116002)(102836004)(26005)(386003)(55236004)(3846002)(6116002)(6506007)(8676002)(5660300002)(103116003)(486006)(2906002)(54906003)(76176011)(2501003)(186003)(6436002)(81156014)(81166006)(2201001)(476003)(71200400001)(86362001)(305945005)(446003)(7736002)(11346002)(8936002)(478600001)(2616005)(6486002)(66476007)(64756008)(66066001)(66946007)(4326008)(53936002)(50226002)(66446008)(14454004)(316002)(73956011)(66556008)(71190400001)(6512007)(1076003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4637; H:VE1PR08MB5006.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: jIX8ZIKNtu87K4PrvPEL/fsdEWeQUU1UEudBhvi71+CxrrmLtxBi3JhcnUsqVosUiJwilj4/wPT5bbWW69Dnloh6rxizkhiRRMClix4ktcZ9rVlW5/fRu6wx0KfPd5vKNOvufSqhk7Ig2iMegB/drZR0/5td3kjlAuALNzGb7J9oBilNK30Ct9CHPpP6DBSAEXgm/q0WJjx1Jj08TBles9DacQfKQgmg+n4Yu71WYUMZEAMAsFhNdy5U/9VHhZCnvAvassybLkr30I99Oz8nxqdl5mA5SaAcNZFwqKoOzdT/zf5JIOe4v7m/lkdRfB/2d5Gcu2JCibB1LcA874vvlXxTAHHO43FEjnG4EI14RMtWy1d/ELXzH27WzGLvFJnmOJh10XR/Uq8HlPtdho5KsdkuqkH5EyYKYXeLOVhJ3BI= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f96b871c-6a22-453b-4a7f-08d700477e83 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 06:18:56.4714 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: james.qian.wang@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4637 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VMSmMOdtH3y6BovOloPIjE3DVQTNjALu3Ub4HyRnkcc=; b=NZvnV8sz4D/vQ+Mqunb900orfOsmCmpcXuQUPhCEmWSAE3D2Ch1Ag/fT9B5Rj96Ejg7vAmK9ZfpLF3QWuUo+YBfMOSB9p10X2w+fCxaBSJQ62dbhJ7noO3ftio0C9WGc094qRVzzMnIH6vkSceKnB7ckfgSGKw9GaAqpUX5nhG8= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; 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 , "Oscar Zhang \(Arm Technology China\)" , "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\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP There are some restrictions if HW works on side_by_side, expose it by config_id to user for taking care them. Signed-off-by: James Qian Wang (Arm Technology China) --- drivers/gpu/drm/arm/display/include/malidp_product.h | 3 ++- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/gpu/drm/arm/display/include/malidp_product.h b/drivers/gpu/drm/arm/display/include/malidp_product.h index 1053b11352eb..96e2e4016250 100644 --- a/drivers/gpu/drm/arm/display/include/malidp_product.h +++ b/drivers/gpu/drm/arm/display/include/malidp_product.h @@ -27,7 +27,8 @@ union komeda_config_id { n_scalers:2, /* number of scalers per pipeline */ n_layers:3, /* number of layers per pipeline */ n_richs:3, /* number of rich layers per pipeline */ - reserved_bits:6; + side_by_side:1, /* if HW works on side_by_side mode */ + reserved_bits:5; }; __u32 value; }; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index 2aee735a683f..0fc7b9f6f649 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -82,6 +82,7 @@ config_id_show(struct device *dev, struct device_attribute *attr, char *buf) memset(&config_id, 0, sizeof(config_id)); config_id.max_line_sz = pipe->layers[0]->hsize_in.end; + config_id.side_by_side = mdev->side_by_side; config_id.n_pipelines = mdev->n_pipelines; config_id.n_scalers = pipe->n_scalers; config_id.n_layers = pipe->n_layers;