From patchwork Thu Nov 21 07:12:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 11255395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 065AB930 for ; Thu, 21 Nov 2019 07:13:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E156F20872 for ; Thu, 21 Nov 2019 07:13:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E156F20872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 300DC6EAFB; Thu, 21 Nov 2019 07:13:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00067.outbound.protection.outlook.com [40.107.0.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id AECA26EAEE for ; Thu, 21 Nov 2019 07:12:57 +0000 (UTC) Received: from VI1PR08CA0148.eurprd08.prod.outlook.com (2603:10a6:800:d5::26) by AM4PR08MB2916.eurprd08.prod.outlook.com (2603:10a6:205:e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.29; Thu, 21 Nov 2019 07:12:54 +0000 Received: from VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::202) by VI1PR08CA0148.outlook.office365.com (2603:10a6:800:d5::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:54 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT015.mail.protection.outlook.com (10.152.18.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:54 +0000 Received: ("Tessian outbound f7868d7ede10:v33"); Thu, 21 Nov 2019 07:12:52 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 448b6a653e5d64b2 X-CR-MTA-TID: 64aa7808 Received: from e29630e7d491.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 569D2F7C-CD4D-4EF3-9A12-592DF533411E.1; Thu, 21 Nov 2019 07:12:47 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2057.outbound.protection.outlook.com [104.47.14.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e29630e7d491.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/HwmQFeuZ4m9mfZGyfsvXFcn8bpPOqFLbYRs6/p6SKquh1DZ+ETIC11eKtVAWNC3cdX33W8L2inAU7gqAyCgCVDWJy7z5TomuOiNIXYJicO/qgYBKJ/pyCnEBf4pSKBRjNgfvPhdqBb3Ozu9MB2s/R9+1ELRj5ocMrrR2BUuQ9U4c1vX2kwRAz59Ihbbbv9WWhmFSn5s0AoaQut+CkATIMXB9W3xSblJNOyA7VV6DpVKdP0Mkh4O8r4JV4NBrSp+6dUtcfm7NXyIewmg+zDX5KwQx3tKMHZzsfCDSCQJyAFNDgPMju5VeEwExWGZMu3MpyUXoTTr/vIPq2lCQ30aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=gDQNE5pCServBUoxjVVWB+HmycIp09U2R+S1sOFda+cntsjxxFbdlrUs117wop/7LV008Wy1ARQYYNJqpkBturqSxAPYEI8JktkOzEHuWiEPfLgJ+kth2YJLlCuLUMM+Td63rsIGpfeUb0jlI96ChOFaoCToAZ38XblcxVsnKtqi1I80KxB5VHhPbsYXF+AL0heK9udja+ZeyWRJ2QlilpXUr4uOoL59Vaiv64aCDKpam/02Gp74nrSuKAH1ghP092ImVqqA8Hfq0tl7BivoyN/tfh2LDX7sx8IA+iP6KoTJ4ACRTR2CELf0cHicG279YeOzcT+YDm/giD4HkBI5kQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:45 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:45 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 4/6] drm/komeda: Add side by side support for writeback Thread-Topic: [PATCH v4 4/6] drm/komeda: Add side by side support for writeback Thread-Index: AQHVoDsStpijpsQiP0y4YgTpq6Fi4A== Date: Thu, 21 Nov 2019 07:12:45 +0000 Message-ID: <20191121071205.27511-5-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 898c416a-2886-4caf-d21e-08d76e523a98 X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|AM4PR08MB2916: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:785;OLM:785; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: lBzoTroHGeo157bRzbhmiwpump8UiAdoGDTDdu1LHKSxoaWYvRaAMywkB3fSKP9ofQHCOm65PU4H4ffrfD3GiWK17Gnlrj47vITJndnwumUznJvRM+JMENQ6hCu1jCF5JKS+Ng5/kBh2lf8EmLpb2wmjyV6CCCDEh/j3SHDYT5vI6lY/zQQ30su8TLhZuKviDv6dq4U2bR7B8LrdADnJMBdJ2gVjcO4DTQmeaxi5FmslnXh8CafGeoupMq6Re3fgKALnUL2H5yPnIoLszOTXUNFL9Sh8SmSepyMDO2YCF/Rm3kvaOneHxA+o2JxlHHz9waGIvqWg8pG446RS/tRReYNyUpm7VNxQkJz+7cHDtSa12I7+sl9mph4nRPk99hzY0WTISLXlUWQ4s2fezuZpji+6xnd/KqOYB4ZcEmhkLmj+PC7k6GuStqArFODzfoVe MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(136003)(346002)(376002)(1110001)(339900001)(189003)(199004)(36906005)(478600001)(99286004)(14454004)(70206006)(26826003)(4326008)(103116003)(76130400001)(7736002)(186003)(6486002)(70586007)(305945005)(54906003)(110136005)(81166006)(2501003)(8676002)(50226002)(81156014)(6116002)(3846002)(23756003)(2906002)(102836004)(6512007)(2616005)(25786009)(6636002)(446003)(26005)(11346002)(86362001)(6506007)(386003)(105606002)(14444005)(36756003)(336012)(1076003)(76176011)(22756006)(8746002)(47776003)(316002)(5660300002)(50466002)(356004)(8936002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2916; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: c64a12e7-a0bc-40ca-3913-08d76e523503 NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z1FDptA7gz9FN9xfi89r4l6AekAWtjDpSJbkCBIYigPEpcF1QYs8DMnfrFBNH7ruM0VRju7v1HiFXHV7NtLdtuY69pU67VVnDJyvkur13Lg0UlKzUinqTGxdTc671etMCR7ePQSExH8u54SyPswk2hYDC/W8JGmkXar4FoI0D4NR95pCtUNj/ej8NcssTxsxrQwxjf+FcNEIKAgoSU3xNQnd27Q9nd7t+pUPrJnOM5UJX0z6XAv+O2thGi/QTwdS2d8c3IthhVnOk6228TCRNeolsJmVkjATyoZhrufeYkZWzt3oGawV/1Zi7L3gU7VsHZ9pm14YoPvdWhiXZMpU+kysk3+x3xxMR8KUCgInyD8IkWhqSPc96IIxGBEwOmZ9V01RokMeO3xIDqC8xydeNrGMoFk3DXesrPUn73J2+mVyYYDwr5w6MZWziia3HlZC X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:54.4621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 898c416a-2886-4caf-d21e-08d76e523a98 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2916 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=Uo6sRxoVF1XaErz2VSDdZJ7e8QXzIZJctWe4xrdixnfwwfH9XteVdcuplVq4J3sInElbsaABWiiDVmxONA6rfocC5ktwtxKERyhmtlcYzB/OUbzNCy3SfthwOqJo7JlIRzXYCjP7LoRYepwt3ojBF8beYr7G3Ns4Sn8kagSAvxs= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYH3lh3p96aYyG0U7lY8+jPIWzUDqW/V2y01c6fakes=; b=Uo6sRxoVF1XaErz2VSDdZJ7e8QXzIZJctWe4xrdixnfwwfH9XteVdcuplVq4J3sInElbsaABWiiDVmxONA6rfocC5ktwtxKERyhmtlcYzB/OUbzNCy3SfthwOqJo7JlIRzXYCjP7LoRYepwt3ojBF8beYr7G3Ns4Sn8kagSAvxs= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In side by side mode, the master pipeline writeback the left frame and the slave writeback the right part, the data flow as below: slave.compiz -> slave.wb_layer -> fb (right-part) master.compiz -> master.wb_layer -> fb (left-part) Signed-off-by: James Qian Wang (Arm Technology China) --- .../drm/arm/display/komeda/komeda_pipeline.h | 4 ++ .../display/komeda/komeda_pipeline_state.c | 42 +++++++++++++++++++ .../arm/display/komeda/komeda_wb_connector.c | 6 ++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 59a81b4476df..76621a972803 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -564,6 +564,10 @@ int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer, struct drm_connector_state *conn_st, struct komeda_crtc_state *kcrtc_st, struct komeda_data_flow_cfg *dflow); +int komeda_build_wb_sbs_data_flow(struct komeda_crtc *kcrtc, + struct drm_connector_state *conn_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *wb_dflow); int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, struct komeda_crtc_state *kcrtc_st); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index b1e90feb5c55..79f7e7b6526f 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1377,6 +1377,48 @@ int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer, return komeda_wb_layer_validate(wb_layer, conn_st, dflow); } +/* writeback side by side split data path: + * + * slave.compiz -> slave.wb_layer - > fb (right-part) + * master.compiz -> master.wb_layer -> fb (left-part) + */ +int komeda_build_wb_sbs_data_flow(struct komeda_crtc *kcrtc, + struct drm_connector_state *conn_st, + struct komeda_crtc_state *kcrtc_st, + struct komeda_data_flow_cfg *wb_dflow) +{ + struct komeda_pipeline *master = kcrtc->master; + struct komeda_pipeline *slave = kcrtc->slave; + struct komeda_data_flow_cfg m_dflow, s_dflow; + int err; + + if (wb_dflow->en_scaling || wb_dflow->en_img_enhancement) { + DRM_DEBUG_ATOMIC("sbs doesn't support WB_scaling\n"); + return -EINVAL; + } + + memcpy(&m_dflow, wb_dflow, sizeof(*wb_dflow)); + memcpy(&s_dflow, wb_dflow, sizeof(*wb_dflow)); + + /* master writeout the left part */ + m_dflow.in_w >>= 1; + m_dflow.out_w >>= 1; + m_dflow.input.component = &master->compiz->base; + + /* slave writeout the right part */ + s_dflow.in_w >>= 1; + s_dflow.out_w >>= 1; + s_dflow.in_x += m_dflow.in_w; + s_dflow.out_x += m_dflow.out_w; + s_dflow.input.component = &slave->compiz->base; + + err = komeda_wb_layer_validate(master->wb_layer, conn_st, &m_dflow); + if (err) + return err; + + return komeda_wb_layer_validate(slave->wb_layer, conn_st, &s_dflow); +} + /* build display output data flow, the data path is: * compiz -> improc -> timing_ctrlr */ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index 17ea021488aa..44e628747654 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -37,6 +37,7 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_st, struct drm_connector_state *conn_st) { + struct komeda_crtc *kcrtc = to_kcrtc(crtc_st->crtc); struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st); struct drm_writeback_job *writeback_job = conn_st->writeback_job; struct komeda_layer *wb_layer; @@ -65,7 +66,10 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder, if (err) return err; - if (dflow.en_split) + if (kcrtc->side_by_side) + err = komeda_build_wb_sbs_data_flow(kcrtc, + conn_st, kcrtc_st, &dflow); + else if (dflow.en_split) err = komeda_build_wb_split_data_flow(wb_layer, conn_st, kcrtc_st, &dflow); else