From patchwork Thu Nov 21 07:12:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Qian Wang X-Patchwork-Id: 11255389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D3E5930 for ; Thu, 21 Nov 2019 07:13:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B1F52089F for ; Thu, 21 Nov 2019 07:12:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B1F52089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92DA26EAEB; Thu, 21 Nov 2019 07:12:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130051.outbound.protection.outlook.com [40.107.13.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30B406EAEE for ; Thu, 21 Nov 2019 07:12:52 +0000 (UTC) Received: from VI1PR0802CA0004.eurprd08.prod.outlook.com (2603:10a6:800:aa::14) by VI1PR08MB3325.eurprd08.prod.outlook.com (2603:10a6:803:3e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Thu, 21 Nov 2019 07:12:49 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by VI1PR0802CA0004.outlook.office365.com (2603:10a6:800:aa::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16 via Frontend Transport; Thu, 21 Nov 2019 07:12:49 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Thu, 21 Nov 2019 07:12:48 +0000 Received: ("Tessian outbound dbe0f0961e8c:v33"); Thu, 21 Nov 2019 07:12:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e26e6412fcc85120 X-CR-MTA-TID: 64aa7808 Received: from 23ca291189c3.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id D8C0C67C-3095-4F77-B271-DB44FDE2528B.1; Thu, 21 Nov 2019 07:12:42 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2059.outbound.protection.outlook.com [104.47.14.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 23ca291189c3.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 Nov 2019 07:12:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6fO46BnDmynCkmpKjz4EJzOYuRqO4tlVlW6TOr7HOXwabnvCfCJpF9vIoIPtaV+f0QIYz+SGeFwCbVVvG7XCRIkoBED8h2E4cZBJ4Rrcm18k8TYpU2B5TRSACLqDs/vAVbfPuroNk3fCqHne3zHDQcPGEne7VjplZ1xVDfBHn0POXC89bmAW5ZZTWd9G5CW9vp97g0Z6nsmPPsDdKAXi4iAi3o/QfBbUA6+7vwxwmP9NvBI9RKltHViRyQo3AFmvYiaE4+nODrYlEodKantvgYv64xwRAYNroItoyiIw12Y9EADdAIzR5q2u4RAdaeu07zVmCDiWHRlTS4TiNSG8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=B7uV/JQbX0dTHeVrb9Lc49VGMoGROTO5YzEQF1RGQWzRJBs9Y3hxM/oRTay84BqjQKNTr8nzIVJzdc6XQOTc4ztJPCD/W0gFUNNTQ3foRWjC0nLwQ14fLDM6DB3lYdUzpvK3lK/C2N8YQP6rTuCq8CY6bWrjptUYBZsHfc62oBtsOPXro/JTG+DHz2I85o1UxOIV52No+q0jSxZs16JQQfwbRLUjWsseVQUcu8OopuXkPtA1Nf87IH6zEU9DpGXLHLe+00vz4H7jZ+2QC59izsEi0sCtq+QnK19X8Xe//MIQU1MaGkHF7puxRwVpWvIMWdfT5poQ6hCAYMMyfQzgSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5006.eurprd08.prod.outlook.com (10.255.159.31) by VE1PR08MB5069.eurprd08.prod.outlook.com (20.179.29.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.16; Thu, 21 Nov 2019 07:12:40 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::a809:417a:faf3:61a7%6]) with mapi id 15.20.2474.019; Thu, 21 Nov 2019 07:12:40 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau , "airlied@linux.ie" , Brian Starkey , "maarten.lankhorst@linux.intel.com" , Mihail Atanassov Subject: [PATCH v4 3/6] drm/komeda: Build side by side display output pipeline Thread-Topic: [PATCH v4 3/6] drm/komeda: Build side by side display output pipeline Thread-Index: AQHVoDsPyS6tdfETbEiQwe+7cItB+g== Date: Thu, 21 Nov 2019 07:12:40 +0000 Message-ID: <20191121071205.27511-4-james.qian.wang@arm.com> References: <20191121071205.27511-1-james.qian.wang@arm.com> In-Reply-To: <20191121071205.27511-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: HK2PR03CA0064.apcprd03.prod.outlook.com (2603:1096:202:17::34) To VE1PR08MB5006.eurprd08.prod.outlook.com (2603:10a6:803:113::31) Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 60a2e76b-3dc3-4230-a9f0-08d76e52373a X-MS-TrafficTypeDiagnostic: VE1PR08MB5069:|VE1PR08MB5069:|VI1PR08MB3325: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:1284;OLM:1284; x-forefront-prvs: 0228DDDDD7 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39850400004)(366004)(376002)(346002)(136003)(189003)(199004)(386003)(6636002)(55236004)(102836004)(6506007)(76176011)(256004)(52116002)(2906002)(14444005)(50226002)(7736002)(305945005)(66446008)(186003)(81166006)(81156014)(8676002)(8936002)(66946007)(6512007)(26005)(2616005)(71200400001)(6486002)(446003)(478600001)(11346002)(71190400001)(6436002)(64756008)(66476007)(66556008)(86362001)(66066001)(4326008)(36756003)(2501003)(6116002)(316002)(3846002)(14454004)(103116003)(99286004)(54906003)(110136005)(25786009)(1076003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5069; H:VE1PR08MB5006.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: KfbHignnuu5mwjgCf6r0LMp6wfKyVyMIP0IIiiRA0oc05S7D2CmCR8Oy4JvA+mpB7EeY++k3jSR2wKtofgtOnABt4zih3GOfXnyTltYcn+pARGL7tcUno+7svoPJhje6pyEWRGW9CMxK2v0w484xUYzJ0hmxFXMyY0lSV8vQ5Jzc8aDeFn0R9qsgKI71oeE1m8ca8eksWk2f0J4AJgSKpZk8C1dBKCMeJ99DXxyMoGl5eHKb12Ry4qNnW1NbZLrXzh3ReuzYK7qyqeH0BDOapfF7tV/qClX3j5ZLbe17qCcYlgcpYN+612Ib3Dos3y/eGHZ/lz76NVf0fIHFzGXB/Lvld0O2+Qk9SWqaqBYdZdAkZEkocd3FA9TfGbjKvBk5tgJoBoU6sbLNAEAy0tqZ5/rTPhvvcHQyRRcU9F7gbOpdYjwMxp4AK8hXb/+T4cnW MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5069 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(136003)(39860400002)(396003)(1110001)(339900001)(199004)(189003)(110136005)(26826003)(105606002)(2501003)(478600001)(102836004)(386003)(6512007)(23756003)(6506007)(446003)(14454004)(2616005)(11346002)(22756006)(336012)(186003)(70206006)(70586007)(103116003)(66066001)(26005)(4326008)(76130400001)(3846002)(6116002)(47776003)(36756003)(8676002)(7736002)(6636002)(99286004)(305945005)(8936002)(50466002)(50226002)(81156014)(81166006)(2906002)(1076003)(36906005)(54906003)(86362001)(316002)(5660300002)(76176011)(356004)(6486002)(25786009)(14444005)(8746002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3325; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 80c29445-66b7-4826-e0d7-08d76e5231ff NoDisclaimer: True X-Forefront-PRVS: 0228DDDDD7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rEfcwwgMOpD/0NqWbG97fC5kOHVhxZU4dcCJ4hHGv76COdvD1Z7I3gtVrNodpefv0Z/VsotEY6Ay08cm8+CgbrnSg1cDTg91MHCySQBU6Iwc4JppUOPiYbNlR/RWrvItj2o8nveW+0N99GKTfjPAKfCMb8VZgS5lFf846OgawtnIAvsHtSOKpGc+sss7TEkp8YijuEZbwNX6jGmOYLkozO1kKVdpiBGp3qHJ26Jwz1arQeI5Li7hmXdJ2UeHT/E417qWKskEWh2wW0o7UWbcuQpq1o9JtZORf3Gmm6M8g1S8bE1qVpzuyytWfSHfEQib72yWYEOqx1Q1DD7RpO1+u45pP424tqH7ZVw3OkPHUDok1wsgsvBj9AiycG9e+8P01IfcSBiqzRFa5qR06E2vdSbTSTYkYDZi7U8GBlLSoFfKMHnEeXLCA7wrr2w0iCvQ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2019 07:12:48.8439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60a2e76b-3dc3-4230-a9f0-08d76e52373a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3325 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=y4Ub7pVegL5HP0dy2zoqT2asxYG7gv6qG9ODkWshTHUTSGcbFoNE3G4iA/2KNWeejFIs8xuiFK38x5P77P/9LWAaNk39Dx88RXC4l6pKnZI066k26tQ5QsPl5fmZenqQY69Zmuv1kkTzn/MVjWtKDb+LxxaoO1Ugm6U6Es6gF3U= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MNE7+1y7dTmC5k0mi/fzuSuQhBHPcnvW+WNpDf6IaTM=; b=y4Ub7pVegL5HP0dy2zoqT2asxYG7gv6qG9ODkWshTHUTSGcbFoNE3G4iA/2KNWeejFIs8xuiFK38x5P77P/9LWAaNk39Dx88RXC4l6pKnZI066k26tQ5QsPl5fmZenqQY69Zmuv1kkTzn/MVjWtKDb+LxxaoO1Ugm6U6Es6gF3U= X-Mailman-Original-Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd , "Oscar Zhang \(Arm Technology China\)" , "Tiannan Zhu \(Arm Technology China\)" , "Jonathan Chai \(Arm Technology China\)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin \(Arm Technology China\)" , "Channing Chen \(Arm Technology China\)" , "james qian wang \(Arm Technology China\)" , "Thomas Sun \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , Ben Davis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For side by side, the slave pipeline merges to master via image processor slave-layers -> slave-compiz-> slave-improc- \ master-layers -> master-compiz -------------> master-improc -> v3: Rebase. Signed-off-by: James Qian Wang (Arm Technology China) --- .../arm/display/komeda/d71/d71_component.c | 4 ++ .../gpu/drm/arm/display/komeda/komeda_crtc.c | 18 +++++-- .../drm/arm/display/komeda/komeda_pipeline.h | 1 + .../display/komeda/komeda_pipeline_state.c | 51 ++++++++++++++----- .../arm/display/komeda/komeda_wb_connector.c | 2 +- 5 files changed, 56 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c index b6517c46e670..6dadf4413ef3 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c @@ -1085,6 +1085,10 @@ static void d71_improc_update(struct komeda_component *c, else if (st->color_format == DRM_COLOR_FORMAT_YCRCB444) ctrl |= IPS_CTRL_YUV; + /* slave input has been enabled, means side by side */ + if (has_bit(1, state->active_inputs)) + ctrl |= IPS_CTRL_SBS; + malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl); } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index cee9a1692e71..24928b922fbd 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -385,15 +385,23 @@ komeda_crtc_atomic_flush(struct drm_crtc *crtc, komeda_crtc_do_flush(crtc, old); } -/* Returns the minimum frequency of the aclk rate (main engine clock) in Hz */ +/* + * Returns the minimum frequency of the aclk rate (main engine clock) in Hz. + * + * The DPU output can be split into two halves, to stay within the bandwidth + * capabilities of the external link (dual-link mode). + * In these cases, each output link runs at half the pixel clock rate of the + * combined display, and has half the number of pixels. + * Beside split the output, the DPU internal pixel processing also can be split + * into two halves (LEFT/RIGHT) and handles by two pipelines simultaneously. + * So if side by side, the pipeline (main engine clock) also can run at half + * the clock rate of the combined display. + */ static unsigned long komeda_calc_min_aclk_rate(struct komeda_crtc *kcrtc, unsigned long pxlclk) { - /* Once dual-link one display pipeline drives two display outputs, - * the aclk needs run on the double rate of pxlclk - */ - if (kcrtc->master->dual_link) + if (kcrtc->master->dual_link && !kcrtc->side_by_side) return pxlclk * 2; else return pxlclk; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h index 4c0946fbaac1..59a81b4476df 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h @@ -540,6 +540,7 @@ struct komeda_crtc_state; struct komeda_crtc; void pipeline_composition_size(struct komeda_crtc_state *kcrtc_st, + bool side_by_side, u16 *hsize, u16 *vsize); int komeda_build_layer_data_flow(struct komeda_layer *layer, diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index 10a0dc9291b8..b1e90feb5c55 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -654,12 +654,13 @@ komeda_merger_validate(struct komeda_merger *merger, } void pipeline_composition_size(struct komeda_crtc_state *kcrtc_st, + bool side_by_side, u16 *hsize, u16 *vsize) { struct drm_display_mode *m = &kcrtc_st->base.adjusted_mode; if (hsize) - *hsize = m->hdisplay; + *hsize = side_by_side ? m->hdisplay / 2 : m->hdisplay; if (vsize) *vsize = m->vdisplay; } @@ -670,12 +671,14 @@ komeda_compiz_set_input(struct komeda_compiz *compiz, struct komeda_data_flow_cfg *dflow) { struct drm_atomic_state *drm_st = kcrtc_st->base.state; + struct drm_crtc *crtc = kcrtc_st->base.crtc; struct komeda_component_state *c_st, *old_st; struct komeda_compiz_input_cfg *cin; u16 compiz_w, compiz_h; int idx = dflow->blending_zorder; - pipeline_composition_size(kcrtc_st, &compiz_w, &compiz_h); + pipeline_composition_size(kcrtc_st, to_kcrtc(crtc)->side_by_side, + &compiz_w, &compiz_h); /* check display rect */ if ((dflow->out_x + dflow->out_w > compiz_w) || (dflow->out_y + dflow->out_h > compiz_h) || @@ -687,7 +690,7 @@ komeda_compiz_set_input(struct komeda_compiz *compiz, } c_st = komeda_component_get_state_and_set_user(&compiz->base, drm_st, - kcrtc_st->base.crtc, kcrtc_st->base.crtc); + crtc, crtc); if (IS_ERR(c_st)) return PTR_ERR(c_st); @@ -721,17 +724,19 @@ komeda_compiz_validate(struct komeda_compiz *compiz, struct komeda_crtc_state *state, struct komeda_data_flow_cfg *dflow) { + struct drm_crtc *crtc = state->base.crtc; struct komeda_component_state *c_st; struct komeda_compiz_state *st; c_st = komeda_component_get_state_and_set_user(&compiz->base, - state->base.state, state->base.crtc, state->base.crtc); + state->base.state, crtc, crtc); if (IS_ERR(c_st)) return PTR_ERR(c_st); st = to_compiz_st(c_st); - pipeline_composition_size(state, &st->hsize, &st->vsize); + pipeline_composition_size(state, to_kcrtc(crtc)->side_by_side, + &st->hsize, &st->vsize); komeda_component_set_output(&dflow->input, &compiz->base, 0); @@ -757,7 +762,8 @@ komeda_compiz_validate(struct komeda_compiz *compiz, static int komeda_improc_validate(struct komeda_improc *improc, struct komeda_crtc_state *kcrtc_st, - struct komeda_data_flow_cfg *dflow) + struct komeda_data_flow_cfg *m_dflow, + struct komeda_data_flow_cfg *s_dflow) { struct drm_crtc *crtc = kcrtc_st->base.crtc; struct drm_crtc_state *crtc_st = &kcrtc_st->base; @@ -771,8 +777,8 @@ komeda_improc_validate(struct komeda_improc *improc, st = to_improc_st(c_st); - st->hsize = dflow->in_w; - st->vsize = dflow->in_h; + st->hsize = m_dflow->in_w; + st->vsize = m_dflow->in_h; if (drm_atomic_crtc_needs_modeset(crtc_st)) { u32 output_depths, output_formats; @@ -808,8 +814,10 @@ komeda_improc_validate(struct komeda_improc *improc, drm_ctm_to_coeffs(kcrtc_st->base.ctm, st->ctm_coeffs); } - komeda_component_add_input(&st->base, &dflow->input, 0); - komeda_component_set_output(&dflow->input, &improc->base, 0); + komeda_component_add_input(&st->base, &m_dflow->input, 0); + if (s_dflow) + komeda_component_add_input(&st->base, &s_dflow->input, 1); + komeda_component_set_output(&m_dflow->input, &improc->base, 0); return 0; } @@ -1146,7 +1154,7 @@ komeda_split_sbs_master_data_flow(struct komeda_crtc_state *kcrtc_st, u32 disp_end = master->out_x + master->out_w; u16 boundary; - pipeline_composition_size(kcrtc_st, &boundary, NULL); + pipeline_composition_size(kcrtc_st, true, &boundary, NULL); if (disp_end <= boundary) { /* the master viewport only located in master side, no need @@ -1209,7 +1217,7 @@ komeda_split_sbs_slave_data_flow(struct komeda_crtc_state *kcrtc_st, { u16 boundary; - pipeline_composition_size(kcrtc_st, &boundary, NULL); + pipeline_composition_size(kcrtc_st, true, &boundary, NULL); if (slave->out_x < boundary) { DRM_DEBUG_ATOMIC("SBS Slave plane is only allowed to configure the right part frame.\n"); @@ -1384,7 +1392,20 @@ int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, memset(&m_dflow, 0, sizeof(m_dflow)); memset(&s_dflow, 0, sizeof(s_dflow)); - if (slave && has_bit(slave->id, kcrtc_st->active_pipes)) { + /* build slave output data flow */ + if (kcrtc->side_by_side) { + /* on side by side, the slave data flows into the improc of + * itself first, and then merge it into master's image processor + */ + err = komeda_compiz_validate(slave->compiz, kcrtc_st, &s_dflow); + if (err) + return err; + + err = komeda_improc_validate(slave->improc, kcrtc_st, + &s_dflow, NULL); + if (err) + return err; + } else if (slave && has_bit(slave->id, kcrtc_st->active_pipes)) { err = komeda_compiz_validate(slave->compiz, kcrtc_st, &s_dflow); if (err) return err; @@ -1400,7 +1421,9 @@ int komeda_build_display_data_flow(struct komeda_crtc *kcrtc, if (err) return err; - err = komeda_improc_validate(master->improc, kcrtc_st, &m_dflow); + /* on side by side, merge the slave dflow into master */ + err = komeda_improc_validate(master->improc, kcrtc_st, &m_dflow, + kcrtc->side_by_side ? &s_dflow : NULL); if (err) return err; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index e465cc4879c9..17ea021488aa 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -21,7 +21,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer, dflow->out_h = fb->height; /* the write back data comes from the compiz */ - pipeline_composition_size(kcrtc_st, &dflow->in_w, &dflow->in_h); + pipeline_composition_size(kcrtc_st, false, &dflow->in_w, &dflow->in_h); dflow->input.component = &wb_layer->base.pipeline->compiz->base; /* compiz doesn't output alpha */ dflow->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE;