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