From patchwork Thu Dec 5 08:35: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: 11274353 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 9B849109A for ; Thu, 5 Dec 2019 08:36:06 +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 826A4205ED for ; Thu, 5 Dec 2019 08:36:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 826A4205ED 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 B5B156F5E2; Thu, 5 Dec 2019 08:36:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40083.outbound.protection.outlook.com [40.107.4.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A56C6F5E2 for ; Thu, 5 Dec 2019 08:36:04 +0000 (UTC) Received: from AM6PR08CA0032.eurprd08.prod.outlook.com (2603:10a6:20b:c0::20) by AM0PR08MB4468.eurprd08.prod.outlook.com (2603:10a6:208:145::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.12; Thu, 5 Dec 2019 08:36:01 +0000 Received: from AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::204) by AM6PR08CA0032.outlook.office365.com (2603:10a6:20b:c0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.12 via Frontend Transport; Thu, 5 Dec 2019 08:36:01 +0000 Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 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 AM5EUR03FT030.mail.protection.outlook.com (10.152.16.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18 via Frontend Transport; Thu, 5 Dec 2019 08:36:01 +0000 Received: ("Tessian outbound 25173d5f5683:v37"); Thu, 05 Dec 2019 08:36:00 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2a6b0409a2bad344 X-CR-MTA-TID: 64aa7808 Received: from bf5a46e4d812.4 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2CAB80B6-F600-4403-8CE7-BA339EB32632.1; Thu, 05 Dec 2019 08:35:55 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bf5a46e4d812.4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 05 Dec 2019 08:35:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ELb55Zv8J1bvjhImmX+7nrZN0XvIPkVoWwqFARt6GvUe/5tUOgpn54c391DVDGwlk5jKPNt//xTvZXHCtLXr6PAKXvZOxMR2B8AMwc1l438OV25tZ7yh/3FJpHfsSWv4STYMfnmvE9ExURe9C7a5iTrluTwp5Qyr37v2tR9prvyWGT/JA4GHyb1V+oHkwEvb8a5m+skc6ttD9/11p9APK0frh57lk3mipGvPM6KU41DLihjfEzs/E2JTFwgcHrnzwhICRl96r689OlbzrAJk86z/MglHFVUfax19kfwkW0qzDZv7SRHyJ1M7CK7JAmywHzYmhsULkAPVOuhptX4g5Q== 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=Vg2cjakBM4qFODjAjiFNrd3FLLjZVC2/5A5msjwiERiYUqavCYML9PJ9eAoOR4hvAvpkcM0uYmHqajm1T33G9AZ6SVb6ahxJX7dK+YuNEttAqmsQsacvOgaD0Lo54Jz+sqX3Hh61m70rsROJ6KD5hRAuQU6yU24N4XZIyjzhmN8QOxSL+IUjgYjXH1RQQQIN3IHoH+Jsy297H7qWGyJ0a/j7jdp5oh5CdTA9EIINni1+oI6SE9pmDfuoVjj56JaX3VvT6O0gJT2+GMaC5Nwna0Zqr39Ate2xVh6zpkS2UlQ+GBEsZoT4Z5Xq2Cjw/4tBga1uV1FUbori+x+IPCv+eA== 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 AM0SPR01MB0026.eurprd08.prod.outlook.com (52.135.152.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.12; Thu, 5 Dec 2019 08:35:51 +0000 Received: from VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::f984:b0c7:bce9:144e]) by VE1PR08MB5006.eurprd08.prod.outlook.com ([fe80::f984:b0c7:bce9:144e%2]) with mapi id 15.20.2495.014; Thu, 5 Dec 2019 08:35:51 +0000 From: "james qian wang (Arm Technology China)" To: Mihail Atanassov Subject: [PATCH v5 3/5] drm/komeda: Build side by side display output pipeline Thread-Topic: [PATCH v5 3/5] drm/komeda: Build side by side display output pipeline Thread-Index: AQHVq0cAtaKlsvJA1kSs3IYKkTMm9w== Date: Thu, 5 Dec 2019 08:35:51 +0000 Message-ID: <20191205083436.11060-4-james.qian.wang@arm.com> References: <20191205083436.11060-1-james.qian.wang@arm.com> In-Reply-To: <20191205083436.11060-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: HK0PR03CA0105.apcprd03.prod.outlook.com (2603:1096:203:b0::21) 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: 649b1c63-427f-4259-805d-08d7795e28a5 X-MS-TrafficTypeDiagnostic: AM0SPR01MB0026:|AM0SPR01MB0026:|AM0PR08MB4468: 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: 02426D11FE X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(39860400002)(136003)(396003)(366004)(199004)(189003)(8676002)(5660300002)(71200400001)(71190400001)(7736002)(86362001)(305945005)(2906002)(316002)(36756003)(103116003)(50226002)(1076003)(81156014)(81166006)(6862004)(8936002)(55236004)(6636002)(4326008)(99286004)(186003)(478600001)(11346002)(2616005)(102836004)(26005)(25786009)(76176011)(52116002)(14454004)(6506007)(66446008)(6116002)(54906003)(66946007)(66476007)(66556008)(64756008)(3846002)(37006003)(6436002)(14444005)(6486002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0SPR01MB0026; H:VE1PR08MB5006.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: NK1o6x8zWlGzhx1pdK2jpoUp3ydsJVhto+F5qIMlc0V7aX0v/dNZImAjwUdnwOwEgjY5UgUwVgtvswO9GQTicikQFgWPH8jP+f48oWIS98g3MdOjXE+n5jt4ZodCK1FH15SjYXUveFag7ADLQVyw2RxMK4tO9ACrhzQMEdYXNv1i9EadL3z3aVfzB/YwwmCa3MefqODV8OvylCmJ0iRyh09WmMtPmhf4Q4HzMyTaLlMqGDgtHKBeKQNkLSfvNfDK9w+zBZvwRaFj0GsCIEcqAHYtSplgs8yGTXMPxw+kd/9r2uiWNaN5Rw5MyR8mrdpUUojHITx08VWL5wCLF6qn9GD6Wxsa940PaPmtn0aAzU1xZfhLZ8o8w4Z0wuUTVbvlWszUEJwPzNBQL2Nk8iVC8lS1KC/LLASjFYIqHfnlKdd8rKqApsOnVwCZPhHEXqwi MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0SPR01MB0026 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT030.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)(396003)(136003)(376002)(346002)(199004)(189003)(50466002)(22756006)(4326008)(26826003)(70206006)(6862004)(356004)(478600001)(11346002)(76130400001)(3846002)(14454004)(103116003)(6116002)(6486002)(316002)(36906005)(6512007)(23756003)(54906003)(37006003)(6636002)(70586007)(305945005)(86362001)(25786009)(36756003)(6506007)(7736002)(5660300002)(336012)(2906002)(102836004)(26005)(99286004)(1076003)(8746002)(2616005)(8936002)(50226002)(76176011)(186003)(8676002)(81156014)(14444005)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4468; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; 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: a9afa293-b141-40ab-1bf0-08d7795e2288 NoDisclaimer: True X-Forefront-PRVS: 02426D11FE X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HLq68WEQ8Ibj8HX8Fqj7/+vYPLtDiIEt8VRdgTWvXZSSk67KVOMRxNfGaXXbiiNOtEopLpY6/tdAQdz1qrSh3bdDMIAOdHb1FH3zgLX7zu3/qnXm5n9N9E1yfpZ9SIPnFj1/CkAW/w37Q4h5VWGF9gaXZAYLXOxKTp39EBpjOaqdZMz/So4WLLM0ad9ay0cvu4QcPlfYc7yGw72qtbsl4KzG/gtHjTEpoYWwvhM1w4Yph25dzrTUgA5O6gdJQZxi9nf8KtTocY7icHE/riuxqLe0Kzjn2yLzt6ZombWr6JLPr6KDTj5i2ps6xfa8PE0miWUGQCI8lqI2POvUNUuipKUHeXf9QqI6qz63MLpqgjiYso4T+YYshPQjOy0qcadUEaMefdrgfKieH5QOhDUObpwKHodqHatKiaJA3nya7U6Oy9+G6R/cXNDlqhA/7L85 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2019 08:36:01.1135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 649b1c63-427f-4259-805d-08d7795e28a5 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: AM0PR08MB4468 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=YgugMVQw3wg3iG1rEvvDfl5fmBAHtD+2QfCMPJLo007NUXu3UgpmGwoWF83AREsU75XRNdarbhZb3UK30urj2x2cOJyFivd80iTAse7xJjpl48p3gHkTpxzt64ohpTz+j/IFQfTjq7/lHKgxKoF3qymBb9JF5xCJJiWyWyZlLG8= 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=YgugMVQw3wg3iG1rEvvDfl5fmBAHtD+2QfCMPJLo007NUXu3UgpmGwoWF83AREsU75XRNdarbhZb3UK30urj2x2cOJyFivd80iTAse7xJjpl48p3gHkTpxzt64ohpTz+j/IFQfTjq7/lHKgxKoF3qymBb9JF5xCJJiWyWyZlLG8= X-Mailman-Original-Authentication-Results: spf=pass (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=bestguesspass 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;