From patchwork Thu Nov 21 07:12:29 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: 11255385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 805E5186D for ; Thu, 21 Nov 2019 07:12:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 674382089D for ; Thu, 21 Nov 2019 07:12:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 674382089D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3720D6EAEA; Thu, 21 Nov 2019 07:12:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00075.outbound.protection.outlook.com [40.107.0.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BCDA6EAE8 for ; Thu, 21 Nov 2019 07:12:41 +0000 (UTC) Received: from VI1PR0802CA0004.eurprd08.prod.outlook.com (2603:10a6:800:aa::14) by AM0PR08MB3313.eurprd08.prod.outlook.com (2603:10a6:208:5b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Thu, 21 Nov 2019 07:12:38 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::205) by VI1PR0802CA0004.outlook.office365.com (2603:10a6:800:aa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Thu, 21 Nov 2019 07:12:38 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:38 +0000 Received: ("Tessian outbound dbe0f0961e8c:v33"); Thu, 21 Nov 2019 07:12:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 17e046ee2c6b5da9 X-CR-MTA-TID: 64aa7808 Received: from 1450494e56c4.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1542E9F1-5701-4E17-9154-EB776BF738CC.1; Thu, 21 Nov 2019 07:12:31 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2059.outbound.protection.outlook.com [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1450494e56c4.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hfMbAv/vhWrvZNKF7uK4spuFLDtfBbx7SjgdVmJHQo0kjtOBR0fr7YQkkfrBAaM4Y3VwMBkbe0dgZtPsKv8AMm2Q12CUtiFjDwYJTXJQcmxlDIB6H5jWpXlvMs3BuGCyFiG7abS/Vcs1v+DfZD9FKx/ljIMd1Bpocwg2m3g+4KJnu1BaxKX1j+pz3V/YCWTCLIG4Vb6VG6ZitzIdoJjQj2i724ls7TFdOuL5qI2vrxd0huo8cD303SupDX1Z0tjgdy1qoi5NZE61TcEgrXLomETB6SQ2zYgU7Xb7VySYSnNFon2RvCXOuT13WpfzvCjolEXeSzXKO6DSrH7LrugoAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XsOUzp77nJl9O3WojFtY2JRXsyfXhsor1OJ5olyuFR0=; b=hEH+NT4av2+TASzqAdZR5xTW5VJinOqR0FPVrjt+Z+lhYC/zXZbRdaNhaiDUur+UHYbtLUV67ZtCyv2kP8dFtJbZJNdtNRA7iLEdXl6jjbBQP3W6WvteLjQHSXhDpBaX+5Z35ocyGxorT/J5p1CnZXfh85EZjAE3f9L7vV4NGyB6tiSIErhzIse5RYUVWVVui9Am+Kxqid23klBQ+OQNH0rC8QzybU2/Emes9PxrL0tq8AWsLjoaTAGueB368DWhWIEKOIdLpXqabq+i7yPwjbh6R+UWp0EQZrVvIIVzhjrY5+Dt8U4efFwIviYAn2VOdVTT9Gd5FmHQ8iG665WqyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:29 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:29 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 1/6] drm/komeda: Add side by side assembling Thread-Topic: [PATCH v4 1/6] drm/komeda: Add side by side assembling Thread-Index: AQHVoDsJFnTIa+Sei0Kq3YwRmg+KZQ== Date: Thu, 21 Nov 2019 07:12:29 +0000 Message-ID: <20191121071205.27511-2-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 36057b5f-acff-4337-e687-08d76e523103 X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM0PR08MB3313: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:3044;OLM:3044; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 5r/C9L0KmMOygWD5UyqRhN+yRl6O94CXMKmM2Qe05CgcKxBJyQDWR/yO1nUmnoxhC9lO/21Tk6aZltTPRkd66e8UMpkJjxv33/k2QKMrTnchgOEji7nLNOiVPsA3bIsdYvFl3dQqGUp6ZbzIqj5jtBYrOvZVPHXb1jX9g+1c6ah3MuZYGVSH2wAbACjnXMRYaY8s0gXBZ6o91dmxZHyu+Pq69nrsUkVHNRu0glSWnpGV4tsqTXo5RK12CJdxoTJhyPQdXCP82Jo3iX6me+LrY9d/6+9DdQLTe9AL3vVWJ2ZCDHt+BXAAvhIKaWkw+W1gpoXAjo8mFjan8P2iTq90HUmm6mxqd1KLyTDLGJcU2TmjRqE0AtlHe2laBeB/Q0/07lbCa41g8XKeTGs0fvPY0ZQJRRFrQC+0DDQFlzix4Hs3wzCUe/o/xLEEhQZpFklu MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(136003)(346002)(376002)(1110001)(339900001)(189003)(199004)(11346002)(2616005)(316002)(36906005)(103116003)(102836004)(110136005)(7736002)(54906003)(305945005)(105606002)(76176011)(4326008)(86362001)(6506007)(50466002)(386003)(36756003)(99286004)(1076003)(6636002)(8936002)(446003)(6486002)(478600001)(26826003)(356004)(14454004)(336012)(8746002)(23756003)(66066001)(70586007)(70206006)(47776003)(76130400001)(50226002)(26005)(81166006)(186003)(5660300002)(8676002)(81156014)(6512007)(2906002)(2501003)(25786009)(3846002)(14444005)(6116002)(22756006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3313; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 16d46c0b-026d-4561-6117-08d76e522baf NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZZEw1dlfjB+HLYMyY5+EKZCEZfUu4iCgwzePV3mQ7llGo7rHvLsRlgN5VDptp8Wsh9YgbL3IGsY/H7HBgkDpPrpCaemsj0AA/MjpfthRzThbCIjrSCQvjko43DuPbxZJpEcxYvfmIdms0CUYNa74Slqc6ZNjeV7VCqUa+qZUtLQSYSfdtvJprTzKQZvWg4o/5fK0G+woscO+cchLe5Q/VoZKIRFZ02v39SEQGs/DYBC2lvriFk+oIIWQnD8JLNfa7Co1srDANdnTMrMQQ7GuIit/wa3u7e2Rx8K8ZKrsaSag8KGsOAm0LJFYhxvSOZej0aXAHSvTJcLkIQHF5t3AHEpf6lWy43pdtAiKe2G+97EjC5jCizemYH+W1TuN9oy62JKim+c1OWGi/M9Tqoh0LrzLROCZCnBWT7A/KaVmVx9qGgQ6q+CAPzbGDTgTyDTr X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:38.4366 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36057b5f-acff-4337-e687-08d76e523103 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3313 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=XsOUzp77nJl9O3WojFtY2JRXsyfXhsor1OJ5olyuFR0=; b=oyiMJAXB3bOxYFJHJgwCN/JhFujU3/l+qckQWrV5WxwubB9K40BRcykZ6yMz9krgpA4OMeisDZOiC1smCEiPumunek329edmA28i40UaLBMjbg1z5A1UsHVGWmhxn+wOkxxqBOJ0ro743gs20Daq7I3lb9U7JV1v26hcrhA4cbQ= 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=XsOUzp77nJl9O3WojFtY2JRXsyfXhsor1OJ5olyuFR0=; b=oyiMJAXB3bOxYFJHJgwCN/JhFujU3/l+qckQWrV5WxwubB9K40BRcykZ6yMz9krgpA4OMeisDZOiC1smCEiPumunek329edmA28i40UaLBMjbg1z5A1UsHVGWmhxn+wOkxxqBOJ0ro743gs20Daq7I3lb9U7JV1v26hcrhA4cbQ= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. komeda "side by side" is enabled by DT property: "side_by_side_master", once DT configured side by side, komeda need to verify it with HW's configuration, and assemble it for the further usage. v3: Correct a typo. Signed-off-by: James Qian Wang (Arm Technology China) --- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 13 ++++- .../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, 73 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 1c452ea75999..cee9a1692e71 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -561,21 +561,30 @@ int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms, kms->n_crtcs = 0; for (i = 0; i < mdev->n_pipelines; i++) { + /* if sbs, one komeda_dev only can represent one CRTC */ + if (mdev->side_by_side && i != mdev->side_by_side_master) + continue; + crtc = &kms->crtcs[kms->n_crtcs]; master = mdev->pipelines[i]; 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 4e46f650fddf..c3fa4835cb8d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -178,6 +178,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 d406a4d83352..471604b42431 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -183,6 +183,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 456f3c435719..ae6654fe95e2 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h @@ -76,6 +76,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 ac8725e24853..20a076cce635 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -237,6 +237,7 @@ struct komeda_layer { * not the source buffer. */ struct komeda_layer *right; + struct komeda_layer *sbs_slave; }; struct komeda_layer_state { From patchwork Thu Nov 21 07:12:35 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: 11255387 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61996930 for ; Thu, 21 Nov 2019 07:12:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 484932089D for ; Thu, 21 Nov 2019 07:12:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 484932089D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BEA06EAE8; Thu, 21 Nov 2019 07:12:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40048.outbound.protection.outlook.com [40.107.4.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DACA6EAEB for ; Thu, 21 Nov 2019 07:12:46 +0000 (UTC) Received: from VI1PR0802CA0021.eurprd08.prod.outlook.com (2603:10a6:800:aa::31) by AM0PR08MB4225.eurprd08.prod.outlook.com (2603:10a6:208:137::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:43 +0000 Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::207) by VI1PR0802CA0021.outlook.office365.com (2603:10a6:800:aa::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Thu, 21 Nov 2019 07:12:43 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:43 +0000 Received: ("Tessian outbound 512f710540da:v33"); Thu, 21 Nov 2019 07:12:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a651b666fee35c7e X-CR-MTA-TID: 64aa7808 Received: from f051d0fe52c9.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id A381078F-9238-42AD-88CB-4ED4FDF8B29C.1; Thu, 21 Nov 2019 07:12:36 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2050.outbound.protection.outlook.com [104.47.14.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f051d0fe52c9.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F9vzyEaqOHDIVBxlzAnCjK0KSeYejrNb6c2gNpyohjMmnKCpRM494Rj0ozzAIplAQp5eYAiMOqJnOFENPj8TuGMWGFoW+ssJnfh3d1fjj7OGgLA8ma90LY8uDtEAH/wzK3RlFjdWJfHiOEMp61hnHbvSopaX0V4rZDScKl/bDkSNLrgGOMMKT4cDj5LeLrPtfq1T42xnG72Ou1CvbvaXIduAhmxyPoIVcnpAUkl5FYPTvrY+IfqkXgU2yUFJlW0w8KmhUISx9Ww/C+/9nqKt9H231+6f8AaF6go661NPcGRYfrR6CeoIR2OFDBGnCoJOFf3yzlCP8p+PY7FW3v76iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u/OhMdzAJRV+IRQdte4BkdgRPzZxlKwzEQRrhZRPdE0=; b=f76Atr507Ck0ibJm8gihU8x9X+n1lY4X7OhTqrtYYnV5Vh5ONH1KTGB2rmtBcyQFJNCQss7TEsTq0zGYSJpNrkKaB0nFJu8SjQKz+Ff/lnzg0XNn29yMdU/6fPiI5qx+/z5Cnb5/7vEHmgRarGxncWOL53/Lovrehb90x8J6pCOQi/aobmCVPkilMaVtlSEYHRlYHgjTPprk9XdF8ZQrM+ezkM8SFa21eGlInXXRj+i6nSRIErC0Ta+ZUBunXjGsobeP0PyueXK75RJYCqD2tRFjtteN6C5BiqVaqqqTabaZPyr/4pwMxvCiA2gF4o666uEqs34qLNTo5nYTlHwUnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:35 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:35 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 2/6] drm/komeda: Add side by side plane_state split Thread-Topic: [PATCH v4 2/6] drm/komeda: Add side by side plane_state split Thread-Index: AQHVoDsMGprGuC7czEO9IQLJopwUpg== Date: Thu, 21 Nov 2019 07:12:35 +0000 Message-ID: <20191121071205.27511-3-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0eeb8e44-02fe-44a0-10c7-08d76e523424 X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM0PR08MB4225: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:4502;OLM:4502; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(30864003)(52116002)(2906002)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: qyfm7voAzvhXTOnJFevu2Y5HrPS5BJOj4A5+FuErpuOHxz8SeK3gee5fpWIgsUkYlesjlTGbW4+JhyIjrsBg9A8A1iN8RXvZp8rCr9QSxDwvgxF0BBI8Q/I1Inh7EGrSNIBYa9wzyRkMMiDsjEWJoQgunUOfXwMT8eXoR8toqtC2OaIaafJk0hqhUj1GI2u5G/C+h8Uotbjaw/aHCzeVRKEgbjvSZKjzmXbh/MLYhWFhNhIlI/W1bqtjc//oCCXCca654/3PGVivgG9JWMp6rJc/MN4HI3GoShqe1YvGkwLLX7wYi/Odo4ry26QlKMX3eyKPXgoILLfScTPqi504o/RWVpRIuzce5Np+032eJCnWiI4o0Jt3+jF/NGzeUaoAzexEooRt8d+f0RNx3oLwvXwfsht1Wjp4bIUwiSzgubF2eWqZpZnrGurDoltyeKYQ MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(39860400002)(396003)(346002)(1110001)(339900001)(199004)(189003)(6512007)(103116003)(70206006)(316002)(6636002)(76130400001)(54906003)(11346002)(6116002)(36906005)(336012)(70586007)(3846002)(14454004)(2616005)(110136005)(50226002)(8746002)(86362001)(1076003)(8676002)(22756006)(81166006)(81156014)(26826003)(446003)(478600001)(6486002)(4326008)(99286004)(36756003)(26005)(50466002)(8936002)(23756003)(2501003)(76176011)(25786009)(30864003)(186003)(5660300002)(6506007)(305945005)(102836004)(7736002)(66066001)(105606002)(356004)(386003)(47776003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4225; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 0d566fae-6401-4b2f-a56d-08d76e522ed5 NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eefSRbSz5lg0nmFaXgi8tK6Ya46yyHQBqZ6K+C/ZOgrZQEBp+UTTq8vempyFS80oHlp7sr6QgVBV5eszzp08thXtUgks90ijpDxeQh0UKZu75GF5NDnezTwHzTnO/JfWGC58GTHdXjRW8P8IF1Xt6GuA5bdI3YHjD3j7zRxCx+Z22l1bIGlpPWe0Mqc6dbtmTc3hBDAcDqHi2SjjIvhez/TBkErHmwHGAqTZF5YMh8cR4llrq0ur3Xodl6jwNTBG4Z6HEb40ei0iuRJN3WZKkOvgyqNag8vUfmbPfpup18n3hd1BWIKRJlPvoriCUo6dhNQ4gjjNj9gO0trFy/7itQeEE8E4wEQCdyUBjirYSIHXlW4a8YG18/tLpAuI3f7SxNncCincNnGJLOPcTnAjCQ9xpAhioaXAz/4ZFQaUoR3IsaD2oIOA0kXMUtdCezKU X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:43.6456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0eeb8e44-02fe-44a0-10c7-08d76e523424 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4225 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=u/OhMdzAJRV+IRQdte4BkdgRPzZxlKwzEQRrhZRPdE0=; b=KAy/nWBPOU57HCg91TgYooyg2DAotCg56o0a+lanImUNAiMFKFxn/xyrskzy+UNQZpZam9/Eac1FXI1db8SU2cJBdxkFHicWVtIJPcFfnLaTNxSIqxt6YhLKe4iHHQQfQ0HBLcffSP6EY8tKpiQR5uhZdPqGOT7EInHgvOJZhLQ= 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=u/OhMdzAJRV+IRQdte4BkdgRPzZxlKwzEQRrhZRPdE0=; b=KAy/nWBPOU57HCg91TgYooyg2DAotCg56o0a+lanImUNAiMFKFxn/xyrskzy+UNQZpZam9/Eac1FXI1db8SU2cJBdxkFHicWVtIJPcFfnLaTNxSIqxt6YhLKe4iHHQQfQ0HBLcffSP6EY8tKpiQR5uhZdPqGOT7EInHgvOJZhLQ= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. v4: Address Mihail's review comments. 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(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 20a076cce635..4c0946fbaac1 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -521,6 +521,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; @@ -532,22 +546,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 0930234abb9d..10a0dc9291b8 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1130,6 +1130,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_x + src_w - master->in_w; + else + slave->in_x = src_x + src_w - 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 98e915e325dd..2644f0727570 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -77,6 +77,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; @@ -94,13 +95,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 Nov 21 07:12:40 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: 11255389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D3E5930 for ; Thu, 21 Nov 2019 07:13:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B1F52089F for ; Thu, 21 Nov 2019 07:12:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B1F52089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92DA26EAEB; Thu, 21 Nov 2019 07:12:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130051.outbound.protection.outlook.com [40.107.13.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30B406EAEE for ; Thu, 21 Nov 2019 07:12:52 +0000 (UTC) Received: from VI1PR0802CA0004.eurprd08.prod.outlook.com (2603:10a6:800:aa::14) by VI1PR08MB3325.eurprd08.prod.outlook.com (2603:10a6:803:3e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Thu, 21 Nov 2019 07:12:49 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by VI1PR0802CA0004.outlook.office365.com (2603:10a6:800:aa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Thu, 21 Nov 2019 07:12:49 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:48 +0000 Received: ("Tessian outbound dbe0f0961e8c:v33"); Thu, 21 Nov 2019 07:12:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e26e6412fcc85120 X-CR-MTA-TID: 64aa7808 Received: from 23ca291189c3.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id D8C0C67C-3095-4F77-B271-DB44FDE2528B.1; Thu, 21 Nov 2019 07:12:42 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2059.outbound.protection.outlook.com [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 23ca291189c3.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6fO46BnDmynCkmpKjz4EJzOYuRqO4tlVlW6TOr7HOXwabnvCfCJpF9vIoIPtaV+f0QIYz+SGeFwCbVVvG7XCRIkoBED8h2E4cZBJ4Rrcm18k8TYpU2B5TRSACLqDs/vAVbfPuroNk3fCqHne3zHDQcPGEne7VjplZ1xVDfBHn0POXC89bmAW5ZZTWd9G5CW9vp97g0Z6nsmPPsDdKAXi4iAi3o/QfBbUA6+7vwxwmP9NvBI9RKltHViRyQo3AFmvYiaE4+nODrYlEodKantvgYv64xwRAYNroItoyiIw12Y9EADdAIzR5q2u4RAdaeu07zVmCDiWHRlTS4TiNSG8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=B7uV/JQbX0dTHeVrb9Lc49VGMoGROTO5YzEQF1RGQWzRJBs9Y3hxM/oRTay84BqjQKNTr8nzIVJzdc6XQOTc4ztJPCD/W0gFUNNTQ3foRWjC0nLwQ14fLDM6DB3lYdUzpvK3lK/C2N8YQP6rTuCq8CY6bWrjptUYBZsHfc62oBtsOPXro/JTG+DHz2I85o1UxOIV52No+q0jSxZs16JQQfwbRLUjWsseVQUcu8OopuXkPtA1Nf87IH6zEU9DpGXLHLe+00vz4H7jZ+2QC59izsEi0sCtq+QnK19X8Xe//MIQU1MaGkHF7puxRwVpWvIMWdfT5poQ6hCAYMMyfQzgSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:40 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:40 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 3/6] drm/komeda: Build side by side display output pipeline Thread-Topic: [PATCH v4 3/6] drm/komeda: Build side by side display output pipeline Thread-Index: AQHVoDsPyS6tdfETbEiQwe+7cItB+g== Date: Thu, 21 Nov 2019 07:12:40 +0000 Message-ID: <20191121071205.27511-4-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 60a2e76b-3dc3-4230-a9f0-08d76e52373a X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|VI1PR08MB3325: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:1284;OLM:1284; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: KfbHignnuu5mwjgCf6r0LMp6wfKyVyMIP0IIiiRA0oc05S7D2CmCR8Oy4JvA+mpB7EeY++k3jSR2wKtofgtOnABt4zih3GOfXnyTltYcn+pARGL7tcUno+7svoPJhje6pyEWRGW9CMxK2v0w484xUYzJ0hmxFXMyY0lSV8vQ5Jzc8aDeFn0R9qsgKI71oeE1m8ca8eksWk2f0J4AJgSKpZk8C1dBKCMeJ99DXxyMoGl5eHKb12Ry4qNnW1NbZLrXzh3ReuzYK7qyqeH0BDOapfF7tV/qClX3j5ZLbe17qCcYlgcpYN+612Ib3Dos3y/eGHZ/lz76NVf0fIHFzGXB/Lvld0O2+Qk9SWqaqBYdZdAkZEkocd3FA9TfGbjKvBk5tgJoBoU6sbLNAEAy0tqZ5/rTPhvvcHQyRRcU9F7gbOpdYjwMxp4AK8hXb/+T4cnW MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(136003)(39860400002)(396003)(1110001)(339900001)(199004)(189003)(110136005)(26826003)(105606002)(2501003)(478600001)(102836004)(386003)(6512007)(23756003)(6506007)(446003)(14454004)(2616005)(11346002)(22756006)(336012)(186003)(70206006)(70586007)(103116003)(66066001)(26005)(4326008)(76130400001)(3846002)(6116002)(47776003)(36756003)(8676002)(7736002)(6636002)(99286004)(305945005)(8936002)(50466002)(50226002)(81156014)(81166006)(2906002)(1076003)(36906005)(54906003)(86362001)(316002)(5660300002)(76176011)(356004)(6486002)(25786009)(14444005)(8746002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3325; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 80c29445-66b7-4826-e0d7-08d76e5231ff NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rEfcwwgMOpD/0NqWbG97fC5kOHVhxZU4dcCJ4hHGv76COdvD1Z7I3gtVrNodpefv0Z/VsotEY6Ay08cm8+CgbrnSg1cDTg91MHCySQBU6Iwc4JppUOPiYbNlR/RWrvItj2o8nveW+0N99GKTfjPAKfCMb8VZgS5lFf846OgawtnIAvsHtSOKpGc+sss7TEkp8YijuEZbwNX6jGmOYLkozO1kKVdpiBGp3qHJ26Jwz1arQeI5Li7hmXdJ2UeHT/E417qWKskEWh2wW0o7UWbcuQpq1o9JtZORf3Gmm6M8g1S8bE1qVpzuyytWfSHfEQib72yWYEOqx1Q1DD7RpO1+u45pP424tqH7ZVw3OkPHUDok1wsgsvBj9AiycG9e+8P01IfcSBiqzRFa5qR06E2vdSbTSTYkYDZi7U8GBlLSoFfKMHnEeXLCA7wrr2w0iCvQ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:48.8439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60a2e76b-3dc3-4230-a9f0-08d76e52373a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3325 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=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=y4Ub7pVegL5HP0dy2zoqT2asxYG7gv6qG9ODkWshTHUTSGcbFoNE3G4iA/2KNWeejFIs8xuiFK38x5P77P/9LWAaNk39Dx88RXC4l6pKnZI066k26tQ5QsPl5fmZenqQY69Zmuv1kkTzn/MVjWtKDb+LxxaoO1Ugm6U6Es6gF3U= 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=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=y4Ub7pVegL5HP0dy2zoqT2asxYG7gv6qG9ODkWshTHUTSGcbFoNE3G4iA/2KNWeejFIs8xuiFK38x5P77P/9LWAaNk39Dx88RXC4l6pKnZI066k26tQ5QsPl5fmZenqQY69Zmuv1kkTzn/MVjWtKDb+LxxaoO1Ugm6U6Es6gF3U= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 -> v3: Rebase. 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 | 18 +++++-- .../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(+), 20 deletions(-) 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 b6517c46e670..6dadf4413ef3 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c @@ -1085,6 +1085,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 cee9a1692e71..24928b922fbd 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -385,15 +385,23 @@ 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; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 4c0946fbaac1..59a81b4476df 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -540,6 +540,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 10a0dc9291b8..b1e90feb5c55 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -654,12 +654,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; } @@ -670,12 +671,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) || @@ -687,7 +690,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); @@ -721,17 +724,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); @@ -757,7 +762,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; @@ -771,8 +777,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; @@ -808,8 +814,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; } @@ -1146,7 +1154,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 @@ -1209,7 +1217,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"); @@ -1384,7 +1392,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; @@ -1400,7 +1421,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 e465cc4879c9..17ea021488aa 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -21,7 +21,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 Nov 21 07:12:45 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: 11255395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 065AB930 for ; Thu, 21 Nov 2019 07:13:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E156F20872 for ; Thu, 21 Nov 2019 07:13:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E156F20872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 300DC6EAFB; Thu, 21 Nov 2019 07:13:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00067.outbound.protection.outlook.com [40.107.0.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id AECA26EAEE for ; Thu, 21 Nov 2019 07:12:57 +0000 (UTC) Received: from VI1PR08CA0148.eurprd08.prod.outlook.com (2603:10a6:800:d5::26) by AM4PR08MB2916.eurprd08.prod.outlook.com (2603:10a6:205:e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.29; Thu, 21 Nov 2019 07:12:54 +0000 Received: from VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::202) by VI1PR08CA0148.outlook.office365.com (2603:10a6:800:d5::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:54 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT015.mail.protection.outlook.com (10.152.18.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:54 +0000 Received: ("Tessian outbound f7868d7ede10:v33"); Thu, 21 Nov 2019 07:12:52 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 448b6a653e5d64b2 X-CR-MTA-TID: 64aa7808 Received: from e29630e7d491.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 569D2F7C-CD4D-4EF3-9A12-592DF533411E.1; Thu, 21 Nov 2019 07:12:47 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2057.outbound.protection.outlook.com [104.47.14.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e29630e7d491.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/HwmQFeuZ4m9mfZGyfsvXFcn8bpPOqFLbYRs6/p6SKquh1DZ+ETIC11eKtVAWNC3cdX33W8L2inAU7gqAyCgCVDWJy7z5TomuOiNIXYJicO/qgYBKJ/pyCnEBf4pSKBRjNgfvPhdqBb3Ozu9MB2s/R9+1ELRj5ocMrrR2BUuQ9U4c1vX2kwRAz59Ihbbbv9WWhmFSn5s0AoaQut+CkATIMXB9W3xSblJNOyA7VV6DpVKdP0Mkh4O8r4JV4NBrSp+6dUtcfm7NXyIewmg+zDX5KwQx3tKMHZzsfCDSCQJyAFNDgPMju5VeEwExWGZMu3MpyUXoTTr/vIPq2lCQ30aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=gDQNE5pCServBUoxjVVWB+HmycIp09U2R+S1sOFda+cntsjxxFbdlrUs117wop/7LV008Wy1ARQYYNJqpkBturqSxAPYEI8JktkOzEHuWiEPfLgJ+kth2YJLlCuLUMM+Td63rsIGpfeUb0jlI96ChOFaoCToAZ38XblcxVsnKtqi1I80KxB5VHhPbsYXF+AL0heK9udja+ZeyWRJ2QlilpXUr4uOoL59Vaiv64aCDKpam/02Gp74nrSuKAH1ghP092ImVqqA8Hfq0tl7BivoyN/tfh2LDX7sx8IA+iP6KoTJ4ACRTR2CELf0cHicG279YeOzcT+YDm/giD4HkBI5kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:45 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:45 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 4/6] drm/komeda: Add side by side support for writeback Thread-Topic: [PATCH v4 4/6] drm/komeda: Add side by side support for writeback Thread-Index: AQHVoDsStpijpsQiP0y4YgTpq6Fi4A== Date: Thu, 21 Nov 2019 07:12:45 +0000 Message-ID: <20191121071205.27511-5-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 898c416a-2886-4caf-d21e-08d76e523a98 X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM4PR08MB2916: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:785;OLM:785; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: lBzoTroHGeo157bRzbhmiwpump8UiAdoGDTDdu1LHKSxoaWYvRaAMywkB3fSKP9ofQHCOm65PU4H4ffrfD3GiWK17Gnlrj47vITJndnwumUznJvRM+JMENQ6hCu1jCF5JKS+Ng5/kBh2lf8EmLpb2wmjyV6CCCDEh/j3SHDYT5vI6lY/zQQ30su8TLhZuKviDv6dq4U2bR7B8LrdADnJMBdJ2gVjcO4DTQmeaxi5FmslnXh8CafGeoupMq6Re3fgKALnUL2H5yPnIoLszOTXUNFL9Sh8SmSepyMDO2YCF/Rm3kvaOneHxA+o2JxlHHz9waGIvqWg8pG446RS/tRReYNyUpm7VNxQkJz+7cHDtSa12I7+sl9mph4nRPk99hzY0WTISLXlUWQ4s2fezuZpji+6xnd/KqOYB4ZcEmhkLmj+PC7k6GuStqArFODzfoVe MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(136003)(346002)(376002)(1110001)(339900001)(189003)(199004)(36906005)(478600001)(99286004)(14454004)(70206006)(26826003)(4326008)(103116003)(76130400001)(7736002)(186003)(6486002)(70586007)(305945005)(54906003)(110136005)(81166006)(2501003)(8676002)(50226002)(81156014)(6116002)(3846002)(23756003)(2906002)(102836004)(6512007)(2616005)(25786009)(6636002)(446003)(26005)(11346002)(86362001)(6506007)(386003)(105606002)(14444005)(36756003)(336012)(1076003)(76176011)(22756006)(8746002)(47776003)(316002)(5660300002)(50466002)(356004)(8936002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2916; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: c64a12e7-a0bc-40ca-3913-08d76e523503 NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z1FDptA7gz9FN9xfi89r4l6AekAWtjDpSJbkCBIYigPEpcF1QYs8DMnfrFBNH7ruM0VRju7v1HiFXHV7NtLdtuY69pU67VVnDJyvkur13Lg0UlKzUinqTGxdTc671etMCR7ePQSExH8u54SyPswk2hYDC/W8JGmkXar4FoI0D4NR95pCtUNj/ej8NcssTxsxrQwxjf+FcNEIKAgoSU3xNQnd27Q9nd7t+pUPrJnOM5UJX0z6XAv+O2thGi/QTwdS2d8c3IthhVnOk6228TCRNeolsJmVkjATyoZhrufeYkZWzt3oGawV/1Zi7L3gU7VsHZ9pm14YoPvdWhiXZMpU+kysk3+x3xxMR8KUCgInyD8IkWhqSPc96IIxGBEwOmZ9V01RokMeO3xIDqC8xydeNrGMoFk3DXesrPUn73J2+mVyYYDwr5w6MZWziia3HlZC X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:54.4621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 898c416a-2886-4caf-d21e-08d76e523a98 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2916 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=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=Uo6sRxoVF1XaErz2VSDdZJ7e8QXzIZJctWe4xrdixnfwwfH9XteVdcuplVq4J3sInElbsaABWiiDVmxONA6rfocC5ktwtxKERyhmtlcYzB/OUbzNCy3SfthwOqJo7JlIRzXYCjP7LoRYepwt3ojBF8beYr7G3Ns4Sn8kagSAvxs= 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=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=Uo6sRxoVF1XaErz2VSDdZJ7e8QXzIZJctWe4xrdixnfwwfH9XteVdcuplVq4J3sInElbsaABWiiDVmxONA6rfocC5ktwtxKERyhmtlcYzB/OUbzNCy3SfthwOqJo7JlIRzXYCjP7LoRYepwt3ojBF8beYr7G3Ns4Sn8kagSAvxs= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 59a81b4476df..76621a972803 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -564,6 +564,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 b1e90feb5c55..79f7e7b6526f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1377,6 +1377,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 17ea021488aa..44e628747654 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -37,6 +37,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; @@ -65,7 +66,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 Nov 21 07:12:50 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: 11255391 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88EA5112B for ; Thu, 21 Nov 2019 07:13:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FCC4208A3 for ; Thu, 21 Nov 2019 07:13:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FCC4208A3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33E936EAEE; Thu, 21 Nov 2019 07:13:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0609.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::609]) by gabe.freedesktop.org (Postfix) with ESMTPS id E567F6EAEE for ; Thu, 21 Nov 2019 07:13:01 +0000 (UTC) Received: from VI1PR08CA0140.eurprd08.prod.outlook.com (2603:10a6:800:d5::18) by AM4PR0802MB2257.eurprd08.prod.outlook.com (2603:10a6:200:61::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Thu, 21 Nov 2019 07:12:59 +0000 Received: from VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::204) by VI1PR08CA0140.outlook.office365.com (2603:10a6:800:d5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Thu, 21 Nov 2019 07:12:59 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT015.mail.protection.outlook.com (10.152.18.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:59 +0000 Received: ("Tessian outbound f7868d7ede10:v33"); Thu, 21 Nov 2019 07:12:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 42ac78c10f20c637 X-CR-MTA-TID: 64aa7808 Received: from fcc1ffd6d176.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 01C109A0-B95E-456C-88C5-079E43941A38.1; Thu, 21 Nov 2019 07:12:52 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2055.outbound.protection.outlook.com [104.47.14.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fcc1ffd6d176.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W4W7vO2CUU3IwMkxZ/ngLIkrKvIF9EWoWLUV1YhC/uD/zBy+ugru9XDQEVdeHdjW6zWtSJqVGq9eRqusUIUdhJl6TQuvbxWp+ltuVXf5helfMXZxybWbJQ3Ve68qOJvbvtnnlYfszzDywSTWdTPoP2oNWIEj3VLaIaC7KC95ysIRJihcBUuLVU8wUVHeky/W60YZN1f/mbSDKGYahQUQSkEpY/x0LyB1S6gjE6tm1ewL4kTrzCFsdgBlgQCfd3n1Nd70bFHeso63Ti0eh5gSH5+w36Lbjr778a/D+tx4mj9p3uOVd+P93YgbxeqSj+bywCoARMQX9PxEYwfPOJOCMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IIB/8z50vBuASSq6iSuVafx4DPXkwq7T4HlbSTTsATE=; b=GtFFxpLTFmNPt5SwTwKq5knXPZa+e7tJeZcjGX02fW5AI67hq/U1vm1WlPjE0FYtLUI0D9oRcfJhB+fwQuOJzo5hCaGWHA6YBVsLUDuTz1SsdOpgUUNwK5vTomnV1VMzIXIikCzl8QTO6SlSyNfNcgtx3TMfSWjzaRO93OVJrTsKrBkMLs324215bXvuHvkqcLXS4yQd5PT1odUhrWXMvf83PXInhZjboCxo0OY0w+ppxeo/4EkugV5SK59SWcquC32XAGio6HjkqbBqFCsNdAbIG+aPpZjCWNm18SFQzlzFD3fFlCIST/3B5B0tHbgaSDRYAub9IAS6RZth5noXaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:50 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:50 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Topic: [PATCH v4 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Index: AQHVoDsVP7DZARWDIkCVgBtVHxZ+nw== Date: Thu, 21 Nov 2019 07:12:50 +0000 Message-ID: <20191121071205.27511-6-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4663def3-0a40-4340-e627-08d76e523d81 X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM4PR0802MB2257: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:7219;OLM:7219; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 25JaAhMhi4pPfQfyhnS467tH9z3KJNSotjXLzoKX5EVMOVFwTEgAIcKeTsOz5cUHpwRm3jzDzo2qDyQKO21NG3iVU4VxygsXlb/WragdzNMKGOwR4KTyukIc8YhWlwUoyECs2AgoOrBbIiU1dPCISjI4FsoUIji6ou5F1pIFFavevf21MwfkY/S1Zo9usmcoE1RFH7TtQBD9ib1T1ejBTWzdTuEZ5qnpaGSuIxZm6AuP/j+6FxrRHF6NMI/AWZkMPuzM1dNnSNbtFDxBsaX65+F9dVgD9xqfTkFng+wr4VXDe6dOUX4xLpKxOZF4JZWga+d/12yc17/hMUFxUZ4ZnqmDWl3y1PW/5Fl2HSeYu3StKPSIxEViRWlDFpO8VfMoFPV84eAjtCHJmPqvymlEYhYtkXGPOpblTTk8T8ns7RFfPxMwKArr2wXJIcTAUX6Z MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(39860400002)(376002)(346002)(1110001)(339900001)(189003)(199004)(8746002)(103116003)(50466002)(4326008)(86362001)(6636002)(54906003)(36906005)(7736002)(305945005)(356004)(6116002)(66066001)(3846002)(110136005)(316002)(105606002)(47776003)(22756006)(23756003)(1076003)(446003)(2501003)(336012)(5660300002)(6512007)(2616005)(76176011)(76130400001)(36756003)(70206006)(70586007)(11346002)(6506007)(8676002)(14454004)(50226002)(81156014)(2906002)(99286004)(102836004)(6486002)(81166006)(386003)(8936002)(25786009)(186003)(478600001)(26826003)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0802MB2257; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 6fd09a5e-c187-466d-315a-08d76e52380e NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SZ9+nDLGmfDZ7tUVWdTAD/0bAq/0IsgJ1a0jPY1C6ucTWIag/Xh7KaASltyB0euVZsfchrrCsjeh2dXEETvtrsVLlQuzA3MuR1d9mJhdRtBDFtoKWgKCKCCFlY100tVU8mKH5YASeT9QeROkdRii/VFJrPiNdRjZBgCfUSCy8D+YDgSsHbOBik2r8zn5tffv1tOSVJZdX+5kqdcuDRm9Hyi5Y0ScWvmMhbhXe3jacRtaAGTr34n+1Qas2+ZmS1pvwejKC+i053TOe5Vu7PTVKzvBskpgYwhHO7NMYrz3zHzFpWnwF9+HBjxeeOIGWMGyU1sRov1bNfjCimOaWiz+GH0S+ZbeFHNJ74nbbdK0/r/exSzhl6C+DMknMPsRFqQ1kIn3GuKhwz5tMFaNlYYd8IPjFNM1M59jNInm1cMcSZ4/Gc5vB0RPcD3Ae416WNww X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:59.3440 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4663def3-0a40-4340-e627-08d76e523d81 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2257 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=IIB/8z50vBuASSq6iSuVafx4DPXkwq7T4HlbSTTsATE=; b=KtJUwB971rsWqetTIZzgt9sSjapcCf6AUMSD9s0a5ThUkvUESvbPFB0m0l/6FswTXHADxlNgdzDxK1BDJf5sQdltxtxErSDEAJKNiQRDP1GM0M+pogheIvnzwqwDjpPxnmu1hBt+rG3JNgcZPiTzY3AvGnSoqzVSvEXM0Gtf7c8= 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=IIB/8z50vBuASSq6iSuVafx4DPXkwq7T4HlbSTTsATE=; b=KtJUwB971rsWqetTIZzgt9sSjapcCf6AUMSD9s0a5ThUkvUESvbPFB0m0l/6FswTXHADxlNgdzDxK1BDJf5sQdltxtxErSDEAJKNiQRDP1GM0M+pogheIvnzwqwDjpPxnmu1hBt+rG3JNgcZPiTzY3AvGnSoqzVSvEXM0Gtf7c8= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 24928b922fbd..78351b7135f8 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -193,27 +193,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 ae6654fe95e2..174fb0a0b49b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h @@ -58,6 +58,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 44e628747654..d6833ea3b822 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -157,6 +157,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 Nov 21 07:12:55 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: 11255393 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ED91112B for ; Thu, 21 Nov 2019 07:13:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10FD220872 for ; Thu, 21 Nov 2019 07:13:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10FD220872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32EAD6EAF1; Thu, 21 Nov 2019 07:13:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on061e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::61e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A5A96EAF1 for ; Thu, 21 Nov 2019 07:13:06 +0000 (UTC) Received: from VI1PR0802CA0041.eurprd08.prod.outlook.com (2603:10a6:800:a9::27) by AM0PR08MB3361.eurprd08.prod.outlook.com (2603:10a6:208:db::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:13:04 +0000 Received: from AM5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::200) by VI1PR0802CA0041.outlook.office365.com (2603:10a6:800:a9::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.19 via Frontend Transport; Thu, 21 Nov 2019 07:13:03 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT038.mail.protection.outlook.com (10.152.17.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:13:03 +0000 Received: ("Tessian outbound a8f166c1f585:v33"); Thu, 21 Nov 2019 07:13:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f4880ec7cc266765 X-CR-MTA-TID: 64aa7808 Received: from 4a9d07b44583.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 721367F0-2AB1-468E-B7FD-1618019B0634.1; Thu, 21 Nov 2019 07:12:57 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2053.outbound.protection.outlook.com [104.47.14.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4a9d07b44583.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TjUnlFdCBcaGrQBGCq5G3f7DrS7NoBTwinxP3R/V/jDNIHwiXx4A5t3W69Zmj4+Ag6N/XcbPw66EMowMK15Z8ZTF/VZPEgYXkE5dA/L2K8dJUxl/BfIh2o190EyGZMs9JNm4CPayuxtMarOWO1UtErRycWnvQtRLdolqa4boJpCcIDbftDQ+eM+oQOsgxP5B+dOq8CLPfcXV2ZoPUmxyCajqCNjzVWLZ7wSxtTkjVOb8NhyoalTreYZJapc4kfzjHTyvXlPdOJ7VQgBEnANtecwvHh8wPVv/jijN5vn6yjOlkMC1e6u60tzXsOOarSyHdAHD7wMO1R+7vZMq46/Hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Awgo8mzDAScoElNVrNOTr423ZXzTsReQcbX4ga4vw0k=; b=MnBfew00yZpA4AwFWJ8RhyNGxDtEHeQZKEd5RgFA3bBbsck2VqYdkfa/bnOr+tVdWeJun/HkVU6IFdZYvmTiVfEyVh0Vb3PqpTgjYCz4IcKFMrdp5aJ7Vf4MMibEkUEZL63rlurvzH1FRIHcxBdgLzOioBdDNlKLMRCn/dfDNZ2kTWuC3pjHRX6umYrJ9CALp9korgGNs1aM1GdbObULfjSNbgeHETluInOMTex4eQANfHL7nQSURq/XBU2Q8SR26eDUS0sANFLEQdRQHxTF+uLeUzXr/SuV0ydNJ1Uljn+7kDhpnMhmMChZ9NlMwtAmNbKR68xeHmugg87qYw0v5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:55 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:55 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Topic: [PATCH v4 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Index: AQHVoDsY3wS7JXHxKU+92h5A5rXdAA== Date: Thu, 21 Nov 2019 07:12:55 +0000 Message-ID: <20191121071205.27511-7-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-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: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a277b613-0530-4fe6-b36b-08d76e52401d X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM0PR08MB3361: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:2201;OLM:2201; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.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-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZVL6Pefp/KpI9j1dlD5MFMEhTYbRJjNoxdsrboCru2D98uw0JOKWty9FQk00nMhsyDsLFLTGIw8o54K6BCyqasvYfsUkFKP4DIqIxtjh4JdK8mbSthEBmB6dQGVGUHFlZ8m8vwH1nrwnAbJLuyAZMqi2n3esi36xiU/u/8GtS35FztUYiOXJWR+Fy73nea/g55p1bdw+ehde/k4wRgbr1+qtZ7WHiJTYgZU7gKF4TPWgqWAA8gGj1KQlESWfOlbf/wukThzWPvHAUWx95SnemXfGHFADrpSv3UJEPjf5bBI8P6iWrVJmdL+qWB1tAbvmutAiXSvhtoELdcEgSDsGeQ2X5k706+zqpNj3ZerTsfZL2Nd4+hEbct0Gfau3e6qag/eG5FC46Thal7hv6WZiFBIKAhJoHbJ+A8ZCxqBBQENq9byqZZSYp8rEhNAWx7ww MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT038.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(39860400002)(346002)(376002)(1110001)(339900001)(189003)(199004)(54906003)(26826003)(23756003)(478600001)(356004)(103116003)(3846002)(36756003)(2906002)(66066001)(2616005)(47776003)(6116002)(11346002)(446003)(14454004)(25786009)(70586007)(70206006)(8676002)(8936002)(81166006)(8746002)(50226002)(1076003)(336012)(81156014)(7736002)(2501003)(4326008)(36906005)(305945005)(76176011)(6486002)(22756006)(86362001)(105606002)(50466002)(110136005)(76130400001)(102836004)(6512007)(99286004)(5660300002)(14444005)(186003)(6636002)(386003)(6506007)(316002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3361; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 16cc174f-07f0-41f1-9f65-08d76e523b10 NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HSWLjB7NLP+nPyjnqqW6oqFZKytDuIgJDTFgIgopt8P4bcPEWzVLoRXhewwEv+M7K014zV055zKnbZbV0t5u4BuWyuS8sJ/qAhyle2GFF6U+fVX0cDC3EIfheQacSOCzEvBhFu3AECEC96Ork2SPAgJ6txvPYZi9nTDA5KoX+z6Tyzo7mAl4orrkWb5irFrdx1s6wd9Ij/Mi6qNB7JOPIOsnxv078jB1bhBopS+DnHdF6Fqv/LVCNsAyt+rrRKejQuTbjV9Xqd42UxlQXfDNVpntdlUalD8Nu2iL3V+hpn9KnHjOy2nNfxW19Cokz3odRd9Mz8eebaVkwVL2GM+Ai6uA/TZRpGsObC7AiFqHJBrAHWrM7pWlp8MLDSDVk8OMzr0QO5ijLlmAsms9oU/XSjgrQCxSBh+4Z6KowLNcmFzco465ZSSaypWXm8mOfWjc X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:13:03.7696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a277b613-0530-4fe6-b36b-08d76e52401d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3361 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=Awgo8mzDAScoElNVrNOTr423ZXzTsReQcbX4ga4vw0k=; b=7vm3jIUmTSObHMUF7FSiImwjCcYyCxLDOxmQfOrTXDprYk0Q2yyFcHaCJ9PVC3/MXrlq7ffjxsmD4UnxDmJFVvIHvKt6rPKzVx5JrOIMqCfKk9YoiGD6wlRMCvSMDmEuEKfDnbGLpUqY+Ps6QdqTvW9OKToI09GOyXFH/3rv3rA= 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=Awgo8mzDAScoElNVrNOTr423ZXzTsReQcbX4ga4vw0k=; b=7vm3jIUmTSObHMUF7FSiImwjCcYyCxLDOxmQfOrTXDprYk0Q2yyFcHaCJ9PVC3/MXrlq7ffjxsmD4UnxDmJFVvIHvKt6rPKzVx5JrOIMqCfKk9YoiGD6wlRMCvSMDmEuEKfDnbGLpUqY+Ps6QdqTvW9OKToI09GOyXFH/3rv3rA= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=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 , "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\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There are some restrictions if HW works on side_by_side, expose it via config_id to user. 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(-) 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 c3fa4835cb8d..4dd4699d4e3d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -83,6 +83,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;