From patchwork Thu Dec 5 08:35:55 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: 11274355 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 51B4C109A for ; Thu, 5 Dec 2019 08:36:11 +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 38C8A21823 for ; Thu, 5 Dec 2019 08:36:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38C8A21823 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 3FAE96F5EC; Thu, 5 Dec 2019 08:36:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140073.outbound.protection.outlook.com [40.107.14.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 409E86F5EF for ; Thu, 5 Dec 2019 08:36:08 +0000 (UTC) Received: from VI1PR08CA0149.eurprd08.prod.outlook.com (2603:10a6:800:d5::27) by VE1PR08MB5261.eurprd08.prod.outlook.com (2603:10a6:803:10d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.14; Thu, 5 Dec 2019 08:36:04 +0000 Received: from AM5EUR03FT004.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::205) by VI1PR08CA0149.outlook.office365.com (2603:10a6:800:d5::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13 via Frontend Transport; Thu, 5 Dec 2019 08:36:04 +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 AM5EUR03FT004.mail.protection.outlook.com (10.152.16.163) 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:04 +0000 Received: ("Tessian outbound d87d9aeb44be:v37"); Thu, 05 Dec 2019 08:36:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ee81c2a020172c2c X-CR-MTA-TID: 64aa7808 Received: from e035e4a146e2.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9916CFFB-3814-4ED9-A464-FA45E4458BD8.1; Thu, 05 Dec 2019 08:35:59 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e035e4a146e2.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 05 Dec 2019 08:35:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N7UPgwn6nOxJ+ahKldlVvYA5y2WHTln6jQgfxv7rgw/j83LPocka6S6z/VcZvt0VDvU7gKHM/ZCpWjtmQSxsTf6H5gGuPQ9hOGBBlOSJqz2XqQsBd9/KRwvwLwNDXYQ7Awzu0W6oihD91NIXnhAa/ic/vj0hQh+WuDJtuFZ9gjJuEH9XSB/iqUEhwWbDvjKOYNCujV8/U/4K5Yc30ZK70OnNqzfD9DuOVjU4ToEZnRInaN3vd9VrhbFF8NiJA68ApmBy/XWA/r+zOs7S8FBPNLKRIEp0UNF6ZxCay67wnNM+gczCS41AFqewuO0CZiTM0/0qcFn5bHGhmZ0IIedBZQ== 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=lBtPaweMuerNYJWHNbkgDe9TgO94q+aI/KTAx0tWNCuukbr1G6+o1abahY+Vrg85oJ1e/5ZSXlC2hVwfrlx9dI1De26iazhrRGG3EUuLXnvus7fj1NPINZ+lVef1UXav0wRZK64aklWQYtcuJLu6qHAZbL3JvqORElIdt4fVhuwiSFzLqdTgmSeTq8n0LAlAhoHBvpV64Q6ZuNO/NGlUbbBBImF8kth/LE+G2m/JANDCNeCT+dt5Tnk5znlOyGN7XKshZ/SXZqxRY+7IJKkluc4BcHfhd0R82lDOTp9Ajy79OLhes3/8waFO3aDxZsk1/9TFrLYC2gyE6KDXW5hrNg== 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:55 +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:55 +0000 From: "james qian wang (Arm Technology China)" To: Mihail Atanassov Subject: [PATCH v5 4/5] drm/komeda: Add side by side support for writeback Thread-Topic: [PATCH v5 4/5] drm/komeda: Add side by side support for writeback Thread-Index: AQHVq0cCwYnEST8nokauTus8cyAHmQ== Date: Thu, 5 Dec 2019 08:35:55 +0000 Message-ID: <20191205083436.11060-5-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: 5df59bf3-3c62-4544-eaf8-08d7795e2ab6 X-MS-TrafficTypeDiagnostic: AM0SPR01MB0026:|AM0SPR01MB0026:|VE1PR08MB5261: 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: 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: 8iZeN2qZ8e1Ehz+eMP6Rd0b1cJ5DOk2IG7CJHjvEzSpMAsrJSY+5onI/AOoipevIbjHo2alyXw4N6DL8yC4aN+DBtiH1l4dG+ifLo3x463arq19D8kjQPWnrqxcWSHPjaRyuGzSYzxLzFZgb3f+WlRZsGWsvhf7e5Q47MWl7C15LCEn1BYkRWfnvD7fZG6vYlgf6h0/VhpgUoRf3r6sjiKJEDcHYupySzhz6ezx4pycUHEYAg0VlQU6EbXvDvxERT7YjN1onEW0WgqEc1Y8zgjgtBxQn+Bpc66ur+2Gp6F11o+FrcCDUS8j6Ijc6w1mhKzhfdqTLwj69i+sbFQUWOZFzFzIqnyrAH0uSLL/DrtsSU0EqP8r7nyTuqQY8Ak0njc1NMf1Dqm4KioKkFCcEwBSZUsGkxmxJFPy7w6fjAA9IuSi8kjOqh6UginqNVfjb 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: AM5EUR03FT004.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)(346002)(39860400002)(136003)(396003)(189003)(199004)(2616005)(25786009)(99286004)(11346002)(76176011)(356004)(37006003)(186003)(54906003)(316002)(36906005)(4326008)(6862004)(336012)(26826003)(14444005)(478600001)(22756006)(50226002)(36756003)(14454004)(6506007)(102836004)(23756003)(81156014)(26005)(6636002)(103116003)(70206006)(70586007)(50466002)(8746002)(76130400001)(8936002)(7736002)(5660300002)(6486002)(1076003)(3846002)(6512007)(6116002)(8676002)(305945005)(86362001)(2906002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5261; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; 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: e05dc87b-06e6-4169-392e-08d7795e2500 NoDisclaimer: True X-Forefront-PRVS: 02426D11FE X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +1eo6KFbE8dItwyCiq656gaHIRnpbYhN8IIjfxm9q8rw4rFNNfqsbwsMpD8TvDPl7R51b19j8N6UjsAdLZNvPojN1STQsPQbYOOoPUaHXKlYFwg19A12DjUz5BGOy35BJp7jQuN4ebdtTwk08ZVj99erG6cs5cowoukwrIykFH2a5SxaT9GzNcT7jaqlJkX2dlgoLARoMtWMUlIdVexXAI2K90+VccQcZiuhlpB67AvuqrOiQNO6LkLnW/CMA5sQucZ+CV+e46l7hyqdBPe93W32eycju3StbzLn5BS91qol4yxO4LP91TkGR+LagEdwn9ZjnZWn+3dfzNkWLH/JUiZgE1dW/Z5ynpzZqmMYMbjJPaRiLidiTEUpx/Uyp3ydh1i7MRDFpPq+5NXVsdOF7XUyU0bBgeRwPdFkxK2ujeXLxpcvP00A395yh8/QkvJI X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2019 08:36:04.6121 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5df59bf3-3c62-4544-eaf8-08d7795e2ab6 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: VE1PR08MB5261 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=r+XbWb5cpMHMW/6aubrULSjUUtmAEKqThXyCOR/IfnbbvCuptm/WgAr+tJAVK5KMTOgnvzZqPMFePQ/AtCvGW+fJngFWNuZlQPqLO3c2FgdgABDeP+LFSkKxEUhKvGgLlQQBL1/PxfKpG4rSG+PjXipmUdA0vrO3WoJRAWhZHY0= 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=r+XbWb5cpMHMW/6aubrULSjUUtmAEKqThXyCOR/IfnbbvCuptm/WgAr+tJAVK5KMTOgnvzZqPMFePQ/AtCvGW+fJngFWNuZlQPqLO3c2FgdgABDeP+LFSkKxEUhKvGgLlQQBL1/PxfKpG4rSG+PjXipmUdA0vrO3WoJRAWhZHY0= 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" 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