From patchwork Thu Nov 14 08:37:24 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: 11243229 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 3EB32930 for ; Thu, 14 Nov 2019 08:37:40 +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 214AC2070E for ; Thu, 14 Nov 2019 08:37:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 214AC2070E 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 0CF246E3C6; Thu, 14 Nov 2019 08:37:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50084.outbound.protection.outlook.com [40.107.5.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id A0D196E3C6 for ; Thu, 14 Nov 2019 08:37:37 +0000 (UTC) Received: from AM4PR08CA0047.eurprd08.prod.outlook.com (2603:10a6:205:2::18) by AM6PR08MB3654.eurprd08.prod.outlook.com (2603:10a6:20b:4d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.25; Thu, 14 Nov 2019 08:37:35 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::201) by AM4PR08CA0047.outlook.office365.com (2603:10a6:205:2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.22 via Frontend Transport; Thu, 14 Nov 2019 08:37:35 +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 DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:34 +0000 Received: ("Tessian outbound 3fba803f6da3:v33"); Thu, 14 Nov 2019 08:37:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ef44006d2a0e0b86 X-CR-MTA-TID: 64aa7808 Received: from 3ea362dbe0f1.2 (cr-mta-lb-1.cr-mta-net [104.47.6.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id AB8C96AF-C819-4356-BFFE-22504439D382.1; Thu, 14 Nov 2019 08:37:28 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2057.outbound.protection.outlook.com [104.47.6.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3ea362dbe0f1.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:37:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BGY1Tr+IoapMO6nFGGZk1Di1nQeg/noQYNX8hDS71trYaUOmtWTLBykewlvxtJgCI5ip4DfbHc+EUBXgPhRJGLCfkH545pH2XaZPIkinqSNFr6J9OxBVjMs0KT9IxSASt7++A0m5XpG243etVprtkzSYlMvuM6tRh6t8MlM42vMuCwvzoDGrjaeJAOlj9KtpS3xtMaPCb67zI2ZpqDRQ/ylFjTwwXeOGKT1SQ0G8x2WWvRLCnkJmxatbh/uVsHN0aY3/uaQ57vNay0fAfA3KE8Zfp2g/G6XyDNuKsLDWbcaw75wnEzO0GeI1gvKvUXFh6OjjX4aPqc9vQaQ4KUNFmQ== 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=VfRrN9zG0R9vsCdDN0qllC9m5lLXfe/glA5/Tke77uQBeetIjucJDlaWQiEejLsje2lQshXSKGhQr9pj3c87xlLYaNCk04BGH9t4q4YkpOj9kDXuenkK6aOhkXLpX2KoBxOQt+MqOQGNj9X9xUpIUZhVLvYwWQLwIwWtJYRPT9NsXA4wL8RKNO+sXdvMcFOVnMBTV03GaUAbZVWAY9+H/Od3oRFycMSZym75zhyY09O7NJcfRtWRZ6cLOAtV9GTWbcpIhk+EnMB5PvQe41zRKdUk11aHwSLOOLq0vWHM+77OV6C85kvpSRkDDj4xDfGKMJm+Ss2Yo41HPOLFM2psLQ== 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 VE1PR08MB4782.eurprd08.prod.outlook.com (10.255.115.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Thu, 14 Nov 2019 08:37:25 +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.2451.023; Thu, 14 Nov 2019 08:37:25 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 1/6] drm/komeda: Add side by side assembling Thread-Topic: [PATCH v3 1/6] drm/komeda: Add side by side assembling Thread-Index: AQHVmsa9UkYGk9o7O0O+920wharNZA== Date: Thu, 14 Nov 2019 08:37:24 +0000 Message-ID: <20191114083658.27237-2-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: 081fc7a1-46b4-4117-be52-08d768dde5d7 X-MS-TrafficTypeDiagnostic: VE1PR08MB4782:|VE1PR08MB4782:|AM6PR08MB3654: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(39850400004)(366004)(396003)(189003)(199004)(25786009)(486006)(66476007)(66446008)(66946007)(66556008)(64756008)(66066001)(11346002)(4326008)(386003)(6636002)(8936002)(446003)(2616005)(476003)(305945005)(14454004)(2501003)(478600001)(36756003)(7736002)(1076003)(5660300002)(54906003)(256004)(14444005)(316002)(6436002)(6512007)(71190400001)(52116002)(71200400001)(110136005)(76176011)(8676002)(102836004)(6506007)(6486002)(2201001)(55236004)(50226002)(103116003)(26005)(86362001)(186003)(3846002)(2906002)(81166006)(81156014)(6116002)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4782; 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: KVe4BfeS7WEdRZ90f2As8N+RcKkFWSeROha2cSQNjLMU4uWrplslVjct+5o2KYyZ8gc/dPbbrdlj06FqN8edISH6z4Lk0tWW1SsnxgmDM6qpov/oxBI+se70xmLTTF9aE4iVRoVF7TgXMRLbSBMSjblfw5qNrq2H/1PWLefZCIg2NEUH6rNMQ6gaaLodKiPZjQGWu+/c+OeO70dcJKnmmVFCt0OtZdEcGdS4ueD2Qp1FjQ+8N6qIKastw6CnqNCaa6rQuJCu7RAg4XyEfh+E4B5JCharKsMiRA9RgNpJPhkR5yjgGHgI8LHxEZD6tG2cgHqYx3cHpueQOjO+WTxB2iOf4hSkDItiU9NQjzDH135nR/qfH/fgfkoUE+FGB2SyJTdtiiapLGlIZQoSbb8Jo6xN5nFVXheFbqdpKJ5CIBNP+uIJV3za30dnN7jELX7a MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4782 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT045.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)(39850400004)(346002)(376002)(1110001)(339900001)(189003)(199004)(8676002)(81166006)(8936002)(54906003)(1076003)(22756006)(81156014)(6486002)(70586007)(105606002)(6512007)(305945005)(76130400001)(8746002)(5660300002)(110136005)(99286004)(7736002)(70206006)(316002)(50226002)(86362001)(50466002)(26826003)(478600001)(2906002)(23756003)(356004)(6506007)(2201001)(26005)(36756003)(2501003)(6116002)(6636002)(66066001)(14454004)(47776003)(386003)(186003)(25786009)(336012)(2616005)(476003)(103116003)(486006)(76176011)(4326008)(126002)(14444005)(11346002)(102836004)(446003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3654; 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: db6ed058-2e0e-4029-4a3a-08d768dddfbc NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ITyu6yqYBKzt/4ZUeV8T/UR+GEVGv3U6nRLv5hK4t5Ifj3DFVWceSyPSX9oMVszyXkgxthDHRlwOSsgdGgDLepCZKes5bslziVQUPAv5EIMQgRtU1cxr+C6P5uV/FrcnyzMBjYHeevVUvpo4xMlgFIQn8HcynqQPC0OO0PaAq9ByF23rjhcv23uXEsZ9aa+bydPCxwqJ1fCZ5il9pPNbcGBFktjCzflaYR+NQ4tKjxuSiq6B1gSP5HWYrQY/UhNDKaQNz85EkRiQNUkezOE2inUm6AiauQ2M2jDFZv2IoGYxxdpiT0wkfAjm8XS+er9qojU/tjm2J+T4KCQIOvhFMJP5x0DyD88kkqtHPb8OKpWaKE7w4T4DyScGVjclKqUjA6P1A6brnYo6RJtqEtqk7TZ8utUQHheatBjTnTTKPsylIbo2udv94bf2gN4ux0W/ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:37:34.8826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 081fc7a1-46b4-4117-be52-08d768dde5d7 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: AM6PR08MB3654 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=rS0OBR4p14/DJju/VzEVcfPJYYl0h6oAFyTlcYVGc0XjKwIx/+d+OWRZXtOjUb8pp7YP17XXbYaqVgasyhxfG5QTX1vhZoJv8aFGAkQavkB17NawyP2rxRl1l1leW4mhsqYy3X8aBEnyN4ywX8GG2sXZ72PS20r9x/GxX0e/e5I= 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=rS0OBR4p14/DJju/VzEVcfPJYYl0h6oAFyTlcYVGc0XjKwIx/+d+OWRZXtOjUb8pp7YP17XXbYaqVgasyhxfG5QTX1vhZoJv8aFGAkQavkB17NawyP2rxRl1l1leW4mhsqYy3X8aBEnyN4ywX8GG2sXZ72PS20r9x/GxX0e/e5I= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 14 08:37:31 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: 11243231 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 37393930 for ; Thu, 14 Nov 2019 08:37:48 +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 1ED4B20718 for ; Thu, 14 Nov 2019 08:37:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1ED4B20718 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 486A36E402; Thu, 14 Nov 2019 08:37:47 +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-eopbgr60084.outbound.protection.outlook.com [40.107.6.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEDDF6E402 for ; Thu, 14 Nov 2019 08:37:45 +0000 (UTC) Received: from VI1PR08CA0226.eurprd08.prod.outlook.com (2603:10a6:802:15::35) by VI1PR0801MB2062.eurprd08.prod.outlook.com (2603:10a6:800:83::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Thu, 14 Nov 2019 08:37:42 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::200) by VI1PR08CA0226.outlook.office365.com (2603:10a6:802:15::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:42 +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 AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:42 +0000 Received: ("Tessian outbound 851a1162fca7:v33"); Thu, 14 Nov 2019 08:37:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f5177b4959325318 X-CR-MTA-TID: 64aa7808 Received: from 8070f748806f.2 (cr-mta-lb-1.cr-mta-net [104.47.10.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 406F1985-65D6-4018-92A5-055851AC78B8.1; Thu, 14 Nov 2019 08:37:35 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2054.outbound.protection.outlook.com [104.47.10.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8070f748806f.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:37:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AczfD67exZWKdOPNUrUwO4/oB92Y6mFzuUf43DzAquaKROmZL7VAHeHSJFDWZ2g4MDpYfCmgeY9q1ZqrSx8A/4GKYLV57Wx6k+AtRNWwNA/ZfKExjCBO0o21lcKgV6NWHImfdSmKg2UXKtYga76EhGrOqGEC5qa9evqEDhiV/RpPtMfmhrxc9jbWsufPIgeSMo3sSHi3dMZX97ZlaQ9ErBdtDCNJZ0a8vmSMkrQcPv9B5PNSend5mqp411Ydonl63J2of5ZiTad7DzUu37phOMAG7tOCDb3RhxHinqPycHUNTKhkP2HQwz1FJB2iaZOj32oVDuYzmY9Yzbc/fOMiag== 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=zXaZQA7UF04Za11ENfBrPY7rcZqwyDjhxx+VWI/tpIc=; b=gLfy6m8ymXoGkQAo//NNZw5Tvu13kZfeOUkFo30eJAgV3bfkoVr/YTz0/bYEP2NPVwOHMSeOZvLpOVUYFCVYJ8/h4bGoOaSvhbCbPKLG6eJbz5yHLcZ3f1ZWT1p3tzKUr0wcxPqhUJyskW6pHTUO2tWlR1jkrQ+KYKYezl2o7ADSSFjSOcqtcZieVDJ4W37XwUcxLEV7IAm1891ceHzQQ+pUlS5d4pnLT7Nk07wI2zZSL67Y1NEy107Nhgv/b3UYluByp3vCk7DyuQwuY11eBz2F0zGXfNF9os1SdduBaQYlwN7x7DkXpntRBU7xQCidKXesXzJNwWaJq7xVgCYvWA== 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 VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.114.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Thu, 14 Nov 2019 08:37:31 +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.2451.023; Thu, 14 Nov 2019 08:37:31 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 2/6] drm/komeda: Add side by side plane_state split Thread-Topic: [PATCH v3 2/6] drm/komeda: Add side by side plane_state split Thread-Index: AQHVmsbB0qq5bjF9AkuUGZwZ2Z2ZNw== Date: Thu, 14 Nov 2019 08:37:31 +0000 Message-ID: <20191114083658.27237-3-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: e9db9e7c-c0b4-44d8-f52a-08d768ddea1f X-MS-TrafficTypeDiagnostic: VE1PR08MB4768:|VE1PR08MB4768:|VI1PR0801MB2062: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(979002)(4636009)(366004)(376002)(346002)(396003)(136003)(39850400004)(189003)(199004)(71200400001)(71190400001)(36756003)(305945005)(2906002)(7736002)(110136005)(54906003)(6116002)(316002)(3846002)(99286004)(103116003)(446003)(11346002)(30864003)(6486002)(8936002)(2616005)(476003)(6436002)(66476007)(66556008)(64756008)(66446008)(66946007)(478600001)(6512007)(50226002)(66066001)(486006)(14454004)(2501003)(5660300002)(76176011)(52116002)(256004)(386003)(55236004)(25786009)(6636002)(102836004)(6506007)(8676002)(4326008)(26005)(81156014)(81166006)(1076003)(186003)(2201001)(86362001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; 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: Z2UwdOGojHSTDCvTrwp1qcy7dVgiuMy2E5Xn4ei4byl7h5pqh3P96T1/FbWhc5QSbauUyamwJJrUdyTxWyyy0QmnCnweQZlRLl0KBv051s9dpel15frWxe3hiFuDuELNsOvcqGi95xvaNfAeCk9hk7l/kh24jbJpgZO2wPEN/M53WvTyzEr2FppakikI4CwgML1Xjuh1gdUq5EVbBmclqQ2C1k25q/jRVMIo+ofE+xTCnYgCrhfDZSseSExCrJco/w0QtxKyFDPxSixsABp3YkZ8XcUy0iAcUIFBkvkL0Q+MkKsVbgqk0sZ0FqSF+bfUSy5WUfBe/TEgI4+il7mxeY85ok7guN8DPmlEJ2XDZBqLLNNWRq4ZXnzeQdHblvZkivfCswSMf5iEiAx3B2l5lLvQP2wg8TzSl9QhJeCae/YPggjmd/l5nlo3PaBm3h8e MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.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)(979002)(4636009)(136003)(39850400004)(346002)(376002)(396003)(1110001)(339900001)(189003)(199004)(14454004)(26826003)(478600001)(105606002)(50466002)(2906002)(186003)(3846002)(2616005)(6116002)(446003)(486006)(11346002)(76176011)(26005)(126002)(476003)(336012)(386003)(6506007)(102836004)(2501003)(66066001)(4326008)(86362001)(2201001)(47776003)(356004)(30864003)(6486002)(1076003)(76130400001)(25786009)(70586007)(70206006)(5660300002)(6512007)(36756003)(22756006)(110136005)(8936002)(54906003)(8746002)(50226002)(99286004)(316002)(81166006)(7736002)(305945005)(36906005)(81156014)(23756003)(103116003)(6636002)(8676002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB2062; 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: 914ebf95-08d9-4411-4c53-08d768dde3b7 NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wJLcMc2lw1n1gKIvGQZMfm+gvXb0baNUxUI9YW7G6WXHClc2jhh3puYVWXlbBtTH0J/b0yQHA1llyFj7oCEiwEa+Lb+RCBC2hOQzx09T8ROy5+2nQ3GmZkg7RQsAQPv3ERuoBxW5g00WUIIYgIkbrvPPgNNw+8M7plWeo6KFOQUZDbWUhJgfbSbo5ICR3lpYXOHMmEu4G6GcecA5fc20VBmKrTaPfu/aQJm0i4/Zrlg/sa7AYXThrw1RtpUa3OfMRUUa136FGA3RcWjYlpsSd5RqR3mSl6hRQrA6ybsYlNv0niYY8WdXrKJEyqOAxINJKINYY8EI/yVgYY3QWqbQSk0x+N04ufUBLD2bkZRQbElD0Rmu55bkgM6EOP1GlXzEyQEk8AGFBm27T9kwSBN+g5Fn2TbtzkctNtXSu1bnEGN4Ho0Wwi/j3/IKm09EtVaF X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:37:42.0377 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9db9e7c-c0b4-44d8-f52a-08d768ddea1f 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: VI1PR0801MB2062 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=zXaZQA7UF04Za11ENfBrPY7rcZqwyDjhxx+VWI/tpIc=; b=gYULTnweHQemebVjJv7hheJGrTqfS70mKuVwllTVv8e1Y8sJTkSdW02Va0GqhSHzZn6YUqjASQjuOpUUrndjpOWQz3K2Lk0V+v9fTOTToSR/Rk9yRPwM6mxJiq4H3TMw19o6tEDgVZgZZzNwtX6bNcVbfUzIypqkU/5gV8zAH60= 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=zXaZQA7UF04Za11ENfBrPY7rcZqwyDjhxx+VWI/tpIc=; b=gYULTnweHQemebVjJv7hheJGrTqfS70mKuVwllTVv8e1Y8sJTkSdW02Va0GqhSHzZn6YUqjASQjuOpUUrndjpOWQz3K2Lk0V+v9fTOTToSR/Rk9yRPwM6mxJiq4H3TMw19o6tEDgVZgZZzNwtX6bNcVbfUzIypqkU/5gV8zAH60= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On side by side mode, The full display frame will be split into two parts (Left/Right), and each part will be handled by a single pipeline separately master pipeline for left part, slave for right. To simplify the usage and implementation, komeda use the following scheme to do the side by side split 1. The planes also have been grouped into two classes: master-planes and slave-planes. 2. The master plane can display its image on any location of the final/full display frame, komeda will help to split the plane configuration to two parts and fed them into master and slave pipelines. 3. The slave plane only can put its display rect on the right part of the final display frame, and its data is only can be fed into the slave pipeline. From the perspective of resource usage and assignment: The master plane can use the resources from the master pipeline and slave pipeline both, but slave plane only can use the slave pipeline resources. With such scheme, the usage of master planes are same as the none side_by_side mode. user can easily skip the slave planes and no need to consider side_by_side for them. Signed-off-by: James Qian Wang (Arm Technology China) --- .../drm/arm/display/komeda/komeda_pipeline.h | 33 ++- .../display/komeda/komeda_pipeline_state.c | 188 ++++++++++++++++++ .../gpu/drm/arm/display/komeda/komeda_plane.c | 7 +- 3 files changed, 220 insertions(+), 8 deletions(-) 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..5de0d231a1c3 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_w + src_x - master->in_w; + else + slave->in_x = src_w + src_x - slave->in_w; + } + } else if (master->out_x >= boundary) { + /* disp_rect only locate in right part, move the dflow to slave */ + master->out_x -= boundary; + *s_dflow = master; + *m_dflow = NULL; + } + + return 0; +} + +static int +komeda_split_sbs_slave_data_flow(struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *slave) +{ + u16 boundary; + + pipeline_composition_size(kcrtc_st, &boundary, NULL); + + if (slave->out_x < boundary) { + DRM_DEBUG_ATOMIC("SBS Slave plane is only allowed to configure the right part frame.\n"); + return -EINVAL; + } + + /* slave->disp_rect locate in the right part */ + slave->out_x -= boundary; + + return 0; +} + +/* On side by side mode, The full display frame will be split to two parts + * (Left/Right), and each part will be handled by a single pipeline separately, + * master pipeline for left part, slave for right. + * + * To simplify the usage and implementation, komeda use the following scheme + * to do the side by side split + * 1. The planes also have been grouped into two classes: + * master-planes and slave-planes. + * 2. The master plane can display its image on any location of the final/full + * display frame, komeda will help to split the plane configuration to two + * parts and fed them into master and slave pipelines. + * 3. The slave plane only can put its display rect on the right part of the + * final display frame, and its data is only can be fed into the slave + * pipeline. + * + * From the perspective of resource usage and assignment: + * The master plane can use the resources from the master pipeline and slave + * pipeline both, but slave plane only can use the slave pipeline resources. + * + * With such scheme, the usage of master planes are same as the none + * side_by_side mode. user can easily skip the slave planes and no need to + * consider side_by_side for them. + * + * NOTE: side_by_side split is occurred on pipeline level which split the plane + * data flow into pipelines, but the layer split is a pipeline + * internal split which splits the data flow into pipeline layers. + * So komeda still supports to apply a further layer split to the sbs + * split data flow. + */ +int komeda_build_layer_sbs_data_flow(struct komeda_layer *layer, + struct komeda_plane_state *kplane_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *dflow) +{ + struct komeda_crtc *kcrtc = to_kcrtc(kcrtc_st->base.crtc); + struct drm_plane *plane = kplane_st->base.plane; + struct komeda_data_flow_cfg temp, *master_dflow, *slave_dflow; + struct komeda_layer *master, *slave; + bool master_plane = layer->base.pipeline == kcrtc->master; + int err; + + DRM_DEBUG_ATOMIC("SBS prepare %s-[PLANE:%d:%s]: %s.\n", + master_plane ? "Master" : "Slave", + plane->base.id, plane->name, + komeda_data_flow_msg(dflow)); + + if (master_plane) { + master = layer; + slave = layer->sbs_slave; + master_dflow = dflow; + slave_dflow = &temp; + err = komeda_split_sbs_master_data_flow(kcrtc_st, + &master_dflow, &slave_dflow); + } else { + master = NULL; + slave = layer; + master_dflow = NULL; + slave_dflow = dflow; + err = komeda_split_sbs_slave_data_flow(kcrtc_st, slave_dflow); + } + + if (err) + return err; + + if (master_dflow) { + DRM_DEBUG_ATOMIC("SBS Master-%s assigned: %s\n", + master->base.name, komeda_data_flow_msg(master_dflow)); + + if (master_dflow->en_split) + err = komeda_build_layer_split_data_flow(master, + kplane_st, kcrtc_st, master_dflow); + else + err = komeda_build_layer_data_flow(master, + kplane_st, kcrtc_st, master_dflow); + + if (err) + return err; + } + + if (slave_dflow) { + DRM_DEBUG_ATOMIC("SBS Slave-%s assigned: %s\n", + slave->base.name, komeda_data_flow_msg(slave_dflow)); + + if (slave_dflow->en_split) + err = komeda_build_layer_split_data_flow(slave, + kplane_st, kcrtc_st, slave_dflow); + else + err = komeda_build_layer_data_flow(slave, + kplane_st, kcrtc_st, slave_dflow); + if (err) + return err; + } + + return 0; +} + /* writeback data path: compiz -> scaler -> wb_layer -> memory */ int komeda_build_wb_data_flow(struct komeda_layer *wb_layer, struct drm_connector_state *conn_st, diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 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 14 08:37:38 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: 11243233 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 6110A138C for ; Thu, 14 Nov 2019 08:37:51 +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 47E9A2071B for ; Thu, 14 Nov 2019 08:37:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47E9A2071B 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 7CCED6E434; Thu, 14 Nov 2019 08:37:50 +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-eopbgr60072.outbound.protection.outlook.com [40.107.6.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82ADD6E434 for ; Thu, 14 Nov 2019 08:37:49 +0000 (UTC) Received: from DB6PR0801CA0048.eurprd08.prod.outlook.com (2603:10a6:4:2b::16) by DB8PR08MB4060.eurprd08.prod.outlook.com (2603:10a6:10:a7::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.26; Thu, 14 Nov 2019 08:37:47 +0000 Received: from DB5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::209) by DB6PR0801CA0048.outlook.office365.com (2603:10a6:4:2b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:47 +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 DB5EUR03FT042.mail.protection.outlook.com (10.152.21.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:47 +0000 Received: ("Tessian outbound 0cf06bf5c60e:v33"); Thu, 14 Nov 2019 08:37:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d691436bd38737d0 X-CR-MTA-TID: 64aa7808 Received: from 80036d3a1b23.2 (cr-mta-lb-1.cr-mta-net [104.47.6.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 35374780-B310-4321-9BF4-484ACFA5DAA5.1; Thu, 14 Nov 2019 08:37:40 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2055.outbound.protection.outlook.com [104.47.6.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 80036d3a1b23.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:37:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xz8TGmBtQ8CyinHK4JjAs/uQT4m7VOOi9RwL9HtT4BY+2SeZvnEpUPe9Qr+jd/wqYjZ2ToZOKNQfM6lwBDqPh1r6TwQnjSE6kiAWkuPEim1nX5fIXEtK7tPJP/GGZ0b6UkHgfKiE9VTBbwBFHXlKIbmBqNiHvxOqrg88k+UnKb63k936NoO1hhkbwjIt21zqC7KsFIybN/wMZrOCdCfAjeenvZ4ne+umATldpQp/v7vJeIt7QpLIENQgDEwyjigjxXqYIs+bSFvPEEfxlhWSuyZucAwWbQ67PnuTiNq4vc4Y32qtjwPrD6/Wm5vJIZbr9vUwd5l1I36IXTHXsLKHkQ== 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=3++1QZdC80NGy6G5njjTcDA6GCim0mGQCIXwovXYvEE=; b=h0XiO6ZqIdY82Da6lcKTLWoof2bxBPuL6xZIVoW5P2dlbdOt4cglsC5sDkMyIb9x7gaRsjuCPVJK672zN/sQLXwAHuciuxEgDiEf7XgY73cPMnNiYphhEl/srry7K+6Xz9rp6wM5PDRODQi5j3o6NOctahmT1n1oJ53snPmtJNu/QQXa1p/VuNfweu0MD9qTcoMDPYxZRgVrmn6o4n1R4PpaHv3nt9XPl4uJ98QVe05nBRGsBs9W245Oy58CfSjJ2BNof9aFE8p+Ih3RSPN2DQGubIdue0uMJLjL7wlxGHBKYtW2+2qTBgaPN5yQV5m+iL07teygOLNim9T7b28auA== 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 VE1PR08MB4782.eurprd08.prod.outlook.com (10.255.115.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Thu, 14 Nov 2019 08:37:38 +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.2451.023; Thu, 14 Nov 2019 08:37:38 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 3/6] drm/komeda: Build side by side display output pipeline Thread-Topic: [PATCH v3 3/6] drm/komeda: Build side by side display output pipeline Thread-Index: AQHVmsbFPlVD5fCaoUuaMu14YyMtdg== Date: Thu, 14 Nov 2019 08:37:38 +0000 Message-ID: <20191114083658.27237-4-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: 024e313d-dcaa-4a43-da4c-08d768dded28 X-MS-TrafficTypeDiagnostic: VE1PR08MB4782:|VE1PR08MB4782:|DB8PR08MB4060: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(39850400004)(366004)(396003)(189003)(199004)(25786009)(486006)(66476007)(66446008)(66946007)(66556008)(64756008)(66066001)(11346002)(4326008)(386003)(6636002)(8936002)(446003)(2616005)(476003)(305945005)(14454004)(2501003)(478600001)(36756003)(7736002)(1076003)(5660300002)(54906003)(256004)(14444005)(316002)(6436002)(6512007)(71190400001)(52116002)(71200400001)(110136005)(76176011)(8676002)(102836004)(6506007)(6486002)(2201001)(55236004)(50226002)(103116003)(26005)(86362001)(186003)(3846002)(2906002)(81166006)(81156014)(6116002)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4782; 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: m9v+1TC8Nyk7tYssII/MOs6xNDuLqiFamvEiPHfOYeGLijW+FaKqcfNZk7MCNpxqj/O5R4CkMZfs9jmrXGFvEPwfJTNRBfb0ShH051FmaO67u4Pce5R3kRi5ju4byHM5TS9sc93D2KVMUmJybYmBgUyfnxI27ETKHUhI4q4Ny4yuJ1TBXvEPxEDkpvdJqKTXfmBhdvt0pGI97j+raVGMRlecCKDeLIgBb8PmTMK1cHFcM/h2U12oeEU6QM7OCZ94EzrGGAlteU91Lqg5wPX9AKd0HJND4ynaPaXvjwpx9ynBXMSO+0MSIh9UwQ5d9uCya8gPo8YT8Q19mQ1arc1+p6Z9DoRdrnt6N7ekf5xJ0rG0zi3H3lU5W4SzRg5wooe9GyJEAmavicYOMvvQ17R3zTUDWQNIABfsvnUKEPTDszX2F7scTFNT1FJhuQV7c8LN MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4782 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT042.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)(39860400002)(346002)(376002)(396003)(136003)(1110001)(339900001)(199004)(189003)(47776003)(305945005)(66066001)(1076003)(22756006)(36756003)(356004)(105606002)(7736002)(2501003)(99286004)(14454004)(4326008)(486006)(23756003)(81156014)(81166006)(25786009)(86362001)(126002)(2616005)(476003)(50226002)(446003)(11346002)(8676002)(8746002)(8936002)(76176011)(186003)(26826003)(478600001)(386003)(6506007)(336012)(50466002)(6486002)(2201001)(102836004)(26005)(6512007)(316002)(5660300002)(110136005)(54906003)(14444005)(3846002)(6116002)(70586007)(6636002)(103116003)(70206006)(76130400001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB8PR08MB4060; 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: 15fa1217-cc37-4e47-84d6-08d768dde7ce NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NBDgF+eEHvx0XpHjdUArch0NgpeZbYecB5nQiB0METI7a5jmvKw8tpd8MRJZ3exnjRgVPm4ao5GfoWfuXn8wdYQsRPdLA9LEiAYzVjstK+X1k67345TMhFseXQXQLrr+GirXZBFjFTX3wt5DDG8VV6jSEDbH/WLxUflbk3UAZuZqisKjveIRLTFmUIyF0rHb3Pji45vDTh3o93f2+jX8dCXop5DJoMbedQbQXl3PFIRGU5ujmZSkTI2h9v/r5rAHjP1Vvvg+ts+tIZE5ugubbUUqpVvYYGIByCIuImOZ3ygnDiJv+RiFFJzseAyU8fsfsGwtlJxtfJhRzjhSbxY65gOHQyZx4r2OizV3eBxQRQsvvty37sbHWFwsMLvXSktbHd/BrdXvzP3iXuVIhFLT0JTPT6GQ8/66iokTTcK6vSfzKVVvq1V2sNdhQS3BBSkK X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:37:47.1402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 024e313d-dcaa-4a43-da4c-08d768dded28 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: DB8PR08MB4060 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=3++1QZdC80NGy6G5njjTcDA6GCim0mGQCIXwovXYvEE=; b=CIgzUwOcwMpdVL6p5YeyT6h2wjSZF1skpGTjnNOs1vgI54UT3SWXc/zAKxe3UsXJhwjJO0/H4cNz3ps5qGbHqAUFeiKqyUY3Dtf79fVyCAPTzSWBZ1JmMrQTc+Q3gNN4eHM7a46XjNQxQwHgnFNms3w9hGib3yVBUOv6p2Fb7RA= 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=3++1QZdC80NGy6G5njjTcDA6GCim0mGQCIXwovXYvEE=; b=CIgzUwOcwMpdVL6p5YeyT6h2wjSZF1skpGTjnNOs1vgI54UT3SWXc/zAKxe3UsXJhwjJO0/H4cNz3ps5qGbHqAUFeiKqyUY3Dtf79fVyCAPTzSWBZ1JmMrQTc+Q3gNN4eHM7a46XjNQxQwHgnFNms3w9hGib3yVBUOv6p2Fb7RA= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 5de0d231a1c3..4dbf71455d1d 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 14 08:37: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: 11243235 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 1DF00138C for ; Thu, 14 Nov 2019 08:38: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 015152070E for ; Thu, 14 Nov 2019 08:38:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 015152070E 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 B2E2F6E43F; Thu, 14 Nov 2019 08:37:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30071.outbound.protection.outlook.com [40.107.3.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D04A6E43F for ; Thu, 14 Nov 2019 08:37:56 +0000 (UTC) Received: from VI1PR0802CA0016.eurprd08.prod.outlook.com (2603:10a6:800:aa::26) by VI1PR08MB3230.eurprd08.prod.outlook.com (2603:10a6:803:3e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.22; Thu, 14 Nov 2019 08:37:54 +0000 Received: from VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::203) by VI1PR0802CA0016.outlook.office365.com (2603:10a6:800:aa::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.22 via Frontend Transport; Thu, 14 Nov 2019 08:37: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 VE1EUR03FT062.mail.protection.outlook.com (10.152.18.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:37:53 +0000 Received: ("Tessian outbound 0cf06bf5c60e:v33"); Thu, 14 Nov 2019 08:37:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c1345366ad8226f6 X-CR-MTA-TID: 64aa7808 Received: from dd3debd63a60.1 (cr-mta-lb-1.cr-mta-net [104.47.10.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 93E11345-17E2-48F0-A2AB-35C6EB4C1C3A.1; Thu, 14 Nov 2019 08:37:46 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2055.outbound.protection.outlook.com [104.47.10.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dd3debd63a60.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:37:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oaTbobBjPYl1M+1N7VGauGIwbJptptuWTx3iMmqLpd7vgaWNnVKGnJcdeHMuATr08VJ0uqGtyvd+Wy2G0wA6bnpmj7sVbIwxDyd/e8ThFnrpShKraxW2X4Riq3G7JITSWZOMyWadEKQrHlpwmsAQuC64vvoNMUDbds9ytzUUKYOV5ROenLSFV8Fsrv1bDrwDB1XRRd2lx8WFyyndagcgtDtEPMKpsQ853S4XIBpdFnAnFZtjZlNX8tXbsw/SEB2R+HdfwTQk7Cw2Ti406SoYmitvQBhnAgUItXnW0NTixGsd+4T90zHux04C7rZA5X775xA5OyZ/B3ykfTsmR/skEA== 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=I6+a5Psi7mCFZ/4vt4yM7Jk/O+MZAzQ5WNcQIh0wvKA=; b=gUShl2LaT2/iO9ZcfUllMbZWle+L8hXF2ArMb0NhVw1vHhL+G4RuXVPU7PCSsoLUlpMD+2BgC9PzvG0SB2EVvGqxYd83haw4EQ8tirWF9B+DNVMOX7z3tgp/AbTv9IbeB4TEzxNNcOf5JOda+pZPY4d5dTn/pis1F9+UKzgZ4JAlV1+dMnkd5+vdJsTlYp+JImUBs95csdqizvM/CtezgzwiN2kDAzCl3Lb9zWtne/3ofKUwkBfCrz7K7tDMh2ho8BDUHr7f+TEiR0Jv7E4XjJXviguo8kX1W78OeB3Y8CRpFuoJ7WHWrKSYHe40ED4T42h0shj4TdTmGreu9Nj6xQ== 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 VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.114.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Thu, 14 Nov 2019 08:37: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.2451.023; Thu, 14 Nov 2019 08:37:45 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 4/6] drm/komeda: Add side by side support for writeback Thread-Topic: [PATCH v3 4/6] drm/komeda: Add side by side support for writeback Thread-Index: AQHVmsbJAUP90/z/aUK+AT3UlbeKyQ== Date: Thu, 14 Nov 2019 08:37:45 +0000 Message-ID: <20191114083658.27237-5-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: 5d3f7a1e-2959-4214-6ce2-08d768ddf11a X-MS-TrafficTypeDiagnostic: VE1PR08MB4768:|VE1PR08MB4768:|VI1PR08MB3230: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(346002)(396003)(136003)(39850400004)(189003)(199004)(71200400001)(71190400001)(36756003)(305945005)(2906002)(7736002)(110136005)(54906003)(6116002)(316002)(3846002)(99286004)(103116003)(446003)(11346002)(6486002)(8936002)(2616005)(476003)(6436002)(66476007)(66556008)(64756008)(66446008)(66946007)(478600001)(6512007)(50226002)(66066001)(486006)(14454004)(2501003)(5660300002)(76176011)(52116002)(256004)(14444005)(386003)(55236004)(25786009)(6636002)(102836004)(6506007)(8676002)(4326008)(26005)(81156014)(81166006)(1076003)(186003)(2201001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; 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: oOY6FzM6hdZTUvcgfTojVJ5vEBWcT5yHj5U2wl/PvpK4XcPepIw40kZOZGqjuvmrwxCvPYo3c+UGBq1ui/VwcYhB7zaftNXQmG89+muH8AW7UrxP/5/r8ym88s+Zt6GyvUMhx94nJGoGGu7OgIW7CeokSAvYrHe7wHio0FKtGPU9wa6XBUjavhYg98s/aiSglYIFbZwbDtiWz8868fJUdBrrZ0FwgMqRj2qpP1TnimRscoEBDIR2ogvxD9R7k9Ld72UH0sRTK3Qw49Kf5sRnUqcuNhF65Y+Iy61WpKRvfBSVmQO+2fLtn1U9ruIb3k/KuOeUVgkb0aCKl/lf37MTnG9DtlLxaVFNP0qoClHZu4yn9/xR+IMr9Vk07TOgE4fI4/O/ACYir65tB29Z4qrST0/yKMDUCPy6Zbs/1nr9ROvZBKhTbgw58t7RL/HLf/EG MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT062.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)(396003)(39860400002)(346002)(136003)(1110001)(339900001)(189003)(199004)(76176011)(186003)(2201001)(26005)(36906005)(6636002)(2906002)(486006)(66066001)(14454004)(70586007)(6506007)(102836004)(14444005)(105606002)(36756003)(70206006)(5660300002)(6486002)(86362001)(76130400001)(26826003)(1076003)(386003)(478600001)(476003)(81156014)(81166006)(2501003)(25786009)(8746002)(336012)(8936002)(305945005)(446003)(7736002)(50226002)(11346002)(99286004)(23756003)(103116003)(4326008)(22756006)(6512007)(54906003)(126002)(110136005)(2616005)(47776003)(316002)(3846002)(6116002)(356004)(8676002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3230; 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: 15078e7f-8e87-402d-ae93-08d768ddebc0 NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NyDogK6fjRLx6kHBBT5d3EZN7+vl6L6xqTKI70x/UwqR//HlrS2cEmrBRl7t5H+YXVhn+wk/AfQ3dOvzDVUxzNz9+SK7QMnCLxUDDT14YMfcimuPvUAht7lc+8GPb2qgXWU91uNAB/on7WofOHY9uT6CWIDsMBdwF3cnXBZA3erpXrOuMxmuT9HemiKy6xDa1iFavcV3nfvKtMfzW7Kj58UdIWhLo9TwvxHJm1rqPMPuKKIDKTB4QV0hRl6Jf7GKE43p7I+NQ6CtARZrvMrrz3p+YXeSGYJA4KF2T7g+p46A/XacbeRrSEsudgIFEQVVGWgG55TFuQZwOP0oP63IUxfBPdz8F7Q1Ofdr/MQdxiymLSGSD8FdWfXHET/JOvLkGxxD/p3BhKdwBmd0iH21esB9YJ/mkgLlO1HHMZ9Crs3riJ6wgBlHuQGJ9wORxDWb X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:37:53.7205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d3f7a1e-2959-4214-6ce2-08d768ddf11a 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: VI1PR08MB3230 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=I6+a5Psi7mCFZ/4vt4yM7Jk/O+MZAzQ5WNcQIh0wvKA=; b=jlJb+NgWuAA+RGJY/eCb4GbyucGJT/0JIWHx+zdskEESUOmZd3rY+wJA4J/IrNuKIwUjC0anfAzrWQ0TMks5s7mahSyII+ma5zdb0nFtXN6ezZoXAl7skQ0Y6iu6x+q25UI+imthZ8oO2EnPPhfMwrUwQ+MSUKTOY1wkRL0ajXo= 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=I6+a5Psi7mCFZ/4vt4yM7Jk/O+MZAzQ5WNcQIh0wvKA=; b=jlJb+NgWuAA+RGJY/eCb4GbyucGJT/0JIWHx+zdskEESUOmZd3rY+wJA4J/IrNuKIwUjC0anfAzrWQ0TMks5s7mahSyII+ma5zdb0nFtXN6ezZoXAl7skQ0Y6iu6x+q25UI+imthZ8oO2EnPPhfMwrUwQ+MSUKTOY1wkRL0ajXo= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 4dbf71455d1d..ab4d9ad79083 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 14 08:37:51 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: 11243237 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 1C8BA930 for ; Thu, 14 Nov 2019 08:38:09 +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 F1FFB2070E for ; Thu, 14 Nov 2019 08:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1FFB2070E 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 040706E44C; Thu, 14 Nov 2019 08:38:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10069.outbound.protection.outlook.com [40.107.1.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F6D76E44C for ; Thu, 14 Nov 2019 08:38:04 +0000 (UTC) Received: from VI1PR08CA0152.eurprd08.prod.outlook.com (2603:10a6:800:d5::30) by AM6PR08MB3526.eurprd08.prod.outlook.com (2603:10a6:20b:4e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.26; Thu, 14 Nov 2019 08:38:01 +0000 Received: from VE1EUR03FT056.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::207) by VI1PR08CA0152.outlook.office365.com (2603:10a6:800:d5::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:38:01 +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 VE1EUR03FT056.mail.protection.outlook.com (10.152.19.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:38:01 +0000 Received: ("Tessian outbound 927f2cdd66cc:v33"); Thu, 14 Nov 2019 08:37:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d850798c1982cdac X-CR-MTA-TID: 64aa7808 Received: from 11f31d2f9a69.2 (cr-mta-lb-1.cr-mta-net [104.47.10.51]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id D3868E3C-8638-4D8E-B6D8-8E5581D41AFC.1; Thu, 14 Nov 2019 08:37:54 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2051.outbound.protection.outlook.com [104.47.10.51]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 11f31d2f9a69.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:37:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hv0Un6YLFSi5Ac2pk4Pct8vRCasS6ko/prnftcfbwu0nLXSUi6R2wMW/CXABgxbVfhyby29AL1S61gQKLfEt22LQYX/Tpg7aG+vRpmUWi9u2kvvM9xWqCcGgqEsT1XhKPDtbva+5HUYxaXhdQXwirsCaBh4uoAKDF3F4byUppJr4+RNBSt8YPdn7X8g++dPbKMBkCvBeQcTLhWFYmyxb/hC+uDMhfN86lNlXXCwYaWN7CkMsHgqqA0yr0ej2VvE8/86JMqij8kid/RzN69JS0qRVrYImjew7tYkuV+poKgcmtdYQ+7/nFa9qkKWiknyBorKOIf9G5thQuKfq6aNp1A== 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=SQqv3tv7QLnVa3mzd7J5/qwv25KquamnvE7QrY/zhfeg8w6T0ZFeUf0xj7zCjPCUm2qy3EOlIUMgcCNslP3dhudgEuxEg/izjfdlg68KioXXz2j6ZY7PjkNt5loBJrQ7ys01oI1S8WrIsRqMbMUKatXyO99UVFUOfCtqANT/Ooi0kGpP6EWjLGkx/dYMQ3aL8BSOwKz+DHHKqoKwOMhvfYLsXfGL4kDSAlKxvHmmy4qdc5f/6QFZzq7d7DVIZ19T9HyjttXYMueXqbBGSeBXdt3XGPzI3oGbXafZilpCOfQGkgwvo9yNs1R4Rx1ELu4K9lxWWgWusTLbZx/N2CnaCg== 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 VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.114.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Thu, 14 Nov 2019 08:37:52 +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.2451.023; Thu, 14 Nov 2019 08:37:52 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Topic: [PATCH v3 5/6] drm/komeda: Update writeback signal for side_by_side Thread-Index: AQHVmsbNlRubU2tfgE+DaVY2KN4Vzw== Date: Thu, 14 Nov 2019 08:37:51 +0000 Message-ID: <20191114083658.27237-6-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: 19bd0a13-e4cb-48a3-100b-08d768ddf585 X-MS-TrafficTypeDiagnostic: VE1PR08MB4768:|VE1PR08MB4768:|AM6PR08MB3526: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(346002)(396003)(136003)(39850400004)(189003)(199004)(71200400001)(71190400001)(36756003)(305945005)(2906002)(7736002)(110136005)(54906003)(6116002)(316002)(3846002)(99286004)(103116003)(446003)(11346002)(6486002)(8936002)(2616005)(476003)(6436002)(66476007)(66556008)(64756008)(66446008)(66946007)(478600001)(6512007)(50226002)(66066001)(486006)(14454004)(2501003)(5660300002)(76176011)(52116002)(256004)(386003)(55236004)(25786009)(6636002)(102836004)(6506007)(8676002)(4326008)(26005)(81156014)(81166006)(1076003)(186003)(2201001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; 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: MEsGhWJrshKKYBlpp5akMZgcpvQ6hX2rSiV/hWIINbp4UJb9pCzBRp+FkOcrkBLAuHXJYV00zbjSwzATwCxDz3jB89WklghTyApHhwm4MHjAEQUpYneB0bGO3QsbNoQ4uG02/hlpzK9J4rQNA/KQAZi6nu3ZelmCZnogFEldVFP0vM2yAanM7Bz660BkieL8BAe1tgEUhCUFboiu1XoZroM1fG/A9qwz2SBo3OxE+TB7C0zuCbyC8MM8XCYAB3n4sVOW4BBP8gi5vVSjtAmb7qM6tcONnZF/JmxSxNdERpOkuiiAdKvLSTEvFhtJWLDkUuboZpNnu+tT62Axf1c69F4yDZfHjdGs2zuRdY40S/pUuXoaZ6kGS3uDnHpOnaiBleoWOFdK2M44EZ/MzPLj89ooEBOq9E7htqe67xj3JMqYHn7FYjld/rfCsRrOqQyR MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT056.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)(376002)(346002)(39860400002)(396003)(1110001)(339900001)(199004)(189003)(66066001)(356004)(478600001)(105606002)(110136005)(54906003)(3846002)(22756006)(6116002)(47776003)(103116003)(14454004)(2501003)(36756003)(2201001)(2906002)(26826003)(36906005)(23756003)(50466002)(4326008)(99286004)(25786009)(316002)(70206006)(305945005)(7736002)(6636002)(70586007)(76130400001)(5660300002)(1076003)(6486002)(86362001)(386003)(6506007)(8676002)(76176011)(6512007)(81166006)(81156014)(8936002)(8746002)(486006)(126002)(476003)(50226002)(11346002)(446003)(26005)(102836004)(186003)(336012)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3526; 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: 40cf5903-5bd3-467d-49a6-08d768ddefe9 NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qH6v2a+a8K6/iYVW+qffwzqN4PP1s90EtU+HqC/ZZ8HusY4p1VEUIOnX4aEzz5SBKqveEqlGzN9tXOubvzU5CpW5dV9vJLWGDDRI9hCWPtLzRMafjUu29LXT0YzJEx/KYIJpl9gZiH8w1+rp1sJcTJvPSZFB39820vE/bIMBJo0OF+Uyo8K/bET7zAUqtqSHeGMJwHEKSSctpY6fHLpf4E3Bn5UsUrdQHVT68Kr77T0cCnfzyv5fOnXLusmLXRk955VY+nGSh8AWQRGqCOwtn82mnpKtkIyaNm0I9iZlx7UInAHMwe8AjvRJXNNIXUHEMyFwMm+anaycoZITu7Ao5ZpX87UDp4eCgxSNN5pMSrRgLZM86arosFOdH5yC3ztCeTfLg6Sl5VQrFADqPm2q7R2GKqvbtMIQzwTMj4DawKMpsdI4Te4C9zkEPVuHrPoN X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:38:01.0952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19bd0a13-e4cb-48a3-100b-08d768ddf585 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: AM6PR08MB3526 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=ksXJ9Hwk0sZefHfMGkFPiAIwugHad7dQGrzM0c5e77vKS4tcRKVxTz/N5qbrq06uL5EDVKek6gXyMTa7dC20KZvo8VWGh/y5OLOJUIlclKS3t+k8YHt8SVHB8w3lKM+xUjQWsGRTXldrbM10bVrVCEVMuyrDZwF6AR8OxklmenI= 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=ksXJ9Hwk0sZefHfMGkFPiAIwugHad7dQGrzM0c5e77vKS4tcRKVxTz/N5qbrq06uL5EDVKek6gXyMTa7dC20KZvo8VWGh/y5OLOJUIlclKS3t+k8YHt8SVHB8w3lKM+xUjQWsGRTXldrbM10bVrVCEVMuyrDZwF6AR8OxklmenI= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 14 08:37:58 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: 11243239 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 606EA138C for ; Thu, 14 Nov 2019 08:38:16 +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 47C742070E for ; Thu, 14 Nov 2019 08:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47C742070E 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 632226E44D; Thu, 14 Nov 2019 08:38:15 +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-he1eur01on060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::60e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 016186E44D for ; Thu, 14 Nov 2019 08:38:12 +0000 (UTC) Received: from VI1PR0802CA0044.eurprd08.prod.outlook.com (2603:10a6:800:a9::30) by AM0PR08MB3524.eurprd08.prod.outlook.com (2603:10a6:208:de::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.25; Thu, 14 Nov 2019 08:38:09 +0000 Received: from VE1EUR03FT045.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::203) by VI1PR0802CA0044.outlook.office365.com (2603:10a6:800:a9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:38:08 +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 VE1EUR03FT045.mail.protection.outlook.com (10.152.19.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.23 via Frontend Transport; Thu, 14 Nov 2019 08:38:08 +0000 Received: ("Tessian outbound 0939a6bab6b1:v33"); Thu, 14 Nov 2019 08:38:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 69003d00aee04017 X-CR-MTA-TID: 64aa7808 Received: from f462d7ae725a.2 (cr-mta-lb-1.cr-mta-net [104.47.10.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 708EC68A-99CA-4C08-807A-AB2EBCDE3179.1; Thu, 14 Nov 2019 08:38:01 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2054.outbound.protection.outlook.com [104.47.10.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f462d7ae725a.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Nov 2019 08:38:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATTWuPjdRBeX/mrOR7ziH/LXObhLZItp4+lCPuBlReMlTHcI0eP94vfgWPKQ4WD1JWxs01Hciw7P3SIe/adl/CphsjxYKTQyTHZehIImdFZGU+xeAlo0kFSVv610Snes5HUpmsel6cboPLy0LojF3bomRDlMY5F/gEm/RE8V/Wf8dONxtTO5KN/LsZ+fHJdhRSQ41Shd9u3/pliIRI48bsC0qqUUkEOz430r1pW9FOeCfbRLT4H6OlduLucqLtVqhms4TQePx+4nbXJoXrxHOWq/J5T56iAo9DzZya2hA45Uujk2UaHdA+rP4QXCHrYcQQovCgWmX0LbI6GlRZGCJg== 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=aufO+bHCBV8MLJJQqAr671VTsoAl1Lq2j8StSG3uUKUjUc7Fi0+mZBPVmHQa5UCwPoR/uogfPtvUYHiCMkjyLvNC75JTvlY9nkPhrBDn1DAgZV5IHYRJSz5sk4JwqLw/NWWDfUHu6kNBFSgk0/85yOQpCD6x2vGa381wkccNgN+yeZ5UccEp8cA3CbH90LYJOKcW9l/X4+epL8WyqLhVwe6u3xF6saqzNQOe+8042b8UzSB7Rn8eZ6PfVmsP/+B1+Lbv1J/L0wcx/HRlVpebD2A7PnSEqcchXA5QRlZEg8GSXVt4m7pyfuqaYSGSFXvwRkOBgOdgTtzE/152nsv0Hg== 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 VE1PR08MB4768.eurprd08.prod.outlook.com (10.255.114.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.27; Thu, 14 Nov 2019 08:37:59 +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.2451.023; Thu, 14 Nov 2019 08:37:58 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , "sean@poorly.run" , Mihail Atanassov Subject: [PATCH v3 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Topic: [PATCH v3 6/6] drm/komeda: Expose side_by_side by sysfs/config_id Thread-Index: AQHVmsbRCzpCw/jsq0ibptLi8SePxg== Date: Thu, 14 Nov 2019 08:37:58 +0000 Message-ID: <20191114083658.27237-7-james.qian.wang@arm.com> References: <20191114083658.27237-1-james.qian.wang@arm.com> In-Reply-To: <20191114083658.27237-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: HK0PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:203:3e::26) 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: 3bd53c9d-576d-448d-df33-08d768ddf9e9 X-MS-TrafficTypeDiagnostic: VE1PR08MB4768:|VE1PR08MB4768:|AM0PR08MB3524: 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: 02213C82F8 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(346002)(396003)(136003)(39850400004)(189003)(199004)(71200400001)(71190400001)(36756003)(305945005)(2906002)(7736002)(110136005)(54906003)(6116002)(316002)(3846002)(99286004)(103116003)(446003)(11346002)(6486002)(8936002)(2616005)(476003)(6436002)(66476007)(66556008)(64756008)(66446008)(66946007)(478600001)(6512007)(50226002)(66066001)(486006)(14454004)(2501003)(5660300002)(76176011)(52116002)(256004)(14444005)(386003)(55236004)(25786009)(6636002)(102836004)(6506007)(8676002)(4326008)(26005)(81156014)(81166006)(1076003)(186003)(2201001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4768; 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: uxWJBK2FNuHy+XpfXqh1dz4UMc6Rh8NyurPVA/k4IFMEzR2XnDbaom/pjm/3hq+3+ytAIveH+OBQ2T9osjw0Ma/mj6Lq0qzMFAK8FXXZ1rh2Rrgq/ZcZg4kipDXgdj07pADhLj1KySp3aUtdr00VVjzOOCZzA8AVDwr2pTpHM0/jsDEPO64A7a13wVTpWORXt82dJFf+pH3YvyO4wRC44etoAJZZ+PQeWG4hzs0l9sxQ1zqHDy8RZgT9rESmad9xPf6PEYW61j8NwvBDiu6VHMhIqgbJhpZZ+acMr3+Ja199g44hzY2JpJrLq2C+iQRDX8T7myAcg8PFTJU1ZMfocnjRjioUIhN0C+UaSu9HxpEwXy5pB5EjbP6NvtQjugb38sJpMgej9Zh8ylMuzKfr424hYd/lO8KaD0uEjwt/HgJObH9s7dhuHDmlFp2urFOg MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4768 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT045.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)(39850400004)(396003)(346002)(376002)(1110001)(339900001)(199004)(189003)(105606002)(6636002)(8936002)(103116003)(36756003)(81166006)(26826003)(22756006)(8676002)(50226002)(81156014)(3846002)(6116002)(7736002)(356004)(36906005)(54906003)(2201001)(478600001)(2906002)(2501003)(76130400001)(8746002)(336012)(186003)(316002)(86362001)(14454004)(70586007)(5660300002)(476003)(4326008)(486006)(110136005)(126002)(14444005)(70206006)(2616005)(26005)(386003)(1076003)(23756003)(6486002)(66066001)(6506007)(102836004)(446003)(6512007)(50466002)(99286004)(76176011)(47776003)(25786009)(11346002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3524; 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: c2c8f05f-7838-4c0b-069a-08d768ddf3e0 NoDisclaimer: True X-Forefront-PRVS: 02213C82F8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aWUdoNbPKzWwiBA+gI3hV2mr4JIF4KdrV0TnnIm+KsC9T1AzOIdnEIgtDba1UokLevUmYIqAaGRpyCQn5Q7L8+9IbpylAAAeveTniqRA2OFhV4MXTK/Eq7Qn7/LOjWezQTbX09qg6DJ7fU7vIOy66zRs5JadHX4tLl5WOuRplnyNY8LQ6KQAaYzJ+AZgBCrWAMuQIEVHvhBNnpB5ouNDjDkPBZNNFBqLFy7mhIq30CzZrqai8IEsdi68/9Sn4QzVCygVA6DWY9sSBnr2XONIkHvT5EmsIrPM3k3SiKMHbTaYOdsRTMJhUToLOx8s/1ql9p6s78skVl1d4KvOc1MoemksCZ+DkhcZaMf2z+YzXBCrnfFTyEC44HD+XOTFDOCoOXpU9T3Oc5q6Iyt3Ee+nsPDh8eh24VM+WuhWM0CKW89Pl5B2rDuN5Ak4WBQQijzc X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2019 08:38:08.4988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bd53c9d-576d-448d-df33-08d768ddf9e9 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: AM0PR08MB3524 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=DG/SbwJL5aBUBqnYQ27d8+wk05JPaJSUWgqErDMd1C7yRsGGCZSm+vsSdC6BuSHHzCnj5/0kJCXrRewAlBWwogDjtpx5IJy/2fM3bePuKwLFdHikVnTaVia+RDNHnJAxNgeSgnrjMIYFWaRtGun+UICTYMpDHfxf6LKU4WfbGrU= 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=DG/SbwJL5aBUBqnYQ27d8+wk05JPaJSUWgqErDMd1C7yRsGGCZSm+vsSdC6BuSHHzCnj5/0kJCXrRewAlBWwogDjtpx5IJy/2fM3bePuKwLFdHikVnTaVia+RDNHnJAxNgeSgnrjMIYFWaRtGun+UICTYMpDHfxf6LKU4WfbGrU= 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 , Ayan Halder , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Yiqi Kang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;