From patchwork Tue Jan 24 05:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13113544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CBB5C25B4E for ; Tue, 24 Jan 2023 05:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OWG08wZjJnmdSka2V5P9a5luSq0ukEFVuPLXGnC7i0s=; b=sqOCacgVwx51s/ ls1uFKmZnOKCmboBRELNCfMgTqRB0rICJWhJ2Sf/Oy+gVK/lZOharDGlnnvhPRv0oLOOCx5K9Do8Z iRTC1Zwp/43gpS2RRQLSF9lZkqx3UCG8xUp7YFnQ40MDahuxXsQGxhTNrxr+YuBylQGLuwSmLLRSw S4Uf0WhrQreRBacpz7wK7xnmc7awBTkxlnUi8aInkBFk/q3GHjfd+Uqoih4xsSoO0qhqGmG+w76gD fOq1nTHzcXdrr+OxdgTsQKeumN1/tMroLaCoQMhqvwwweItEnVuZio8s8Vs03koHhxxjryngBsjOS y5WGClXdvliX7muzdamg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKCCk-002R3o-15; Tue, 24 Jan 2023 05:50:47 +0000 Received: from mail-vi1eur02on2053.outbound.protection.outlook.com ([40.107.241.53] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKC9a-002PTL-O3; Tue, 24 Jan 2023 05:47:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eeOB6808hX9iVKs1Oo7JTAPGkJnJX16WVorU4zkxsb5+1lgpXWGqt0l4fGQKTVfxiX3BJ6LyAOoML7AZU6lsn76c8TNbvFpTQWGpCVYqxHsmEbIRMcKFXiiwLJEHQmNSi3LyHZ6jztu5gT6ku1KtKDQeEbAdGx1iY0Ssdvo9s3PU4yQTHstizH/sVvKlSs8qWT4jgz/jY9i5ZOcvvYqeFOgXdzlKJlk/sMtT981iJ43604qwKYj5F/e3YrRT+NtcyA77H9wS6b0gqjUyFOjPb7u30P84KyrSkydFAIInAuJu2PpTQLWwK8xQi+fOCB9iu3xtTHDe6xwXwTKN3pNLKA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dgr7kEURxIEnma+AY7Da1nbfb3Zw5t63LYtMVyPER6g=; b=ZWS1YApEL1sAUCAJoEMuTbaRcDZdHORuq51qlZz6CtIx3fluvDE49W/ki7asOI/aU+xnHjAh/pPg/G+2wGVJXV5ppNgFmgN4v8OM6iNIiJlmpreYvksIsWKUy/UR5jsZUsoCuHAxjTk0UffenuUUw7cgtJ/K+fiah25/i75t0XDj1YbFBCo8iEHt68wMobTcPUg3CZZ/76/QyR0OFuSdfFYMYpJjB6A0QfOOgKhnB89hNbbUGR0Mp15D3QGSWeU+zsrjDfYwK+m41bGy5cAo89iaD4gP9Y8ZwXVqyty4GW1vU+l7UYyGFbbk0BW0RdhQsUPcl4jpJCd0XLvIUB7clA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dgr7kEURxIEnma+AY7Da1nbfb3Zw5t63LYtMVyPER6g=; b=iPepEZxFGc213iMwZQil0QqSHj2nag4cJZ3GIh+Hv3SoL/fhwcmRus9Amwbw//kpo6F94yxxKXHSeCcrRW4BKoHhtBLcektxhqTiHCEY+TacM3Wku+L6dyO5JsEPZJrz6iKKDO3iY9s2pfrFTAKkACN5fRM6J9sKtULvG2uUO74= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by VE1PR08MB5678.eurprd08.prod.outlook.com (2603:10a6:800:1a0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 05:47:21 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4718:6092:e763:4219]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4718:6092:e763:4219%2]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 05:47:21 +0000 From: Michael Riesch To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Sandy Huang , David Airlie , Daniel Vetter , Sascha Hauer , Michael Riesch Subject: [PATCH v3 3/6] drm/rockchip: rgb: add video_port parameter to init function Date: Tue, 24 Jan 2023 06:47:03 +0100 Message-Id: <20230124054706.3921383-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230124054706.3921383-1-michael.riesch@wolfvision.net> References: <20230124054706.3921383-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0189.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::6) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|VE1PR08MB5678:EE_ X-MS-Office365-Filtering-Correlation-Id: c11522e3-3241-4b4d-9e73-08dafdce75d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /pvDcCWeuQnPUwo8rLX9ICKgrFMwZfmrfRThOnfI1uE3HZaEB5OEolsJmXQeZjOYG2Fecil7zq5zOxJ5vj88wsBwHcWzEQjX6oCuAxCe1RoUuHQUv0uICJ0cQhMJyXnwZl54TOfOkZqt46EY84w67Qme73y/55UOgN3z7qJ1MtlBL6T6xq3c85SzjeNA57qmMFx8owTyT4isKyC4Gdpt9C41WWxHQ8UBgegyovkJnOfGSihhj2rJ/JfPHa4CzktpMTr91KkrnzBi6htpcdXfygsUxlmQniPsrYfS9jWE93X3uWdB8tWS/jcjHntFT1SQ9i0woE/Qys/MbScwNR9fDUl52yJphqJnCK1csowPI5s68EMNxg1JwhD4PFvj8Xvvt+holC+zTKygHOIw8+TPTN16HMevlJFMfbvDME96yM8KQdvK2Dlamzl+zTs44Db1dVAifhNEs2nd2SitSpqvGHi3Sew18ayFeYY6vpW6F7KCKoVjoLO0KoKBgWsIK+/lHrvv5wh3gYuXM2UpmsKgw+XnV9YzxyNe+RzuVdfzV6m0rPmJEQrKLiRmptZLv5NI1GtE/+Q/eXKodOTRs7N7VjXeXOQITS5RJOpyPdk4SADG6wP3K1VuUzfvT4DqjdxgBMfTfImNfND6yOUi/n+JLw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(39840400004)(396003)(376002)(136003)(346002)(451199015)(1076003)(66946007)(4326008)(8676002)(66476007)(6486002)(66556008)(52116002)(2616005)(6512007)(107886003)(6666004)(44832011)(186003)(5660300002)(8936002)(7416002)(41300700001)(83380400001)(2906002)(6506007)(38100700002)(54906003)(316002)(86362001)(478600001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NR1latieBuacntSYM29WwHBGVuxUP/XWbBEKp1sefNcTQKMqV7N7Gx8ooM9VFJ+tNPLz9t+FTdPP2LlJujMO1BMMBXFIQK72Q/VFZTB4GHiCVu0c8uJ/tRjo/uqCsg2qj5LmZuoKmCOHPQqvxFhlJiKcPtUyIBtpi2jb6iHhUmmTIr+PyT0mQ+sj0ZCLJ9L0HTmOm25POKsTWevGkvpy25Vht5ezKB1VO1mFUo6vJ0nMWugtuYu4zyBOZYSPj8Euz31pQBVKWNSlTn+mmuqiCKeElWJiBI/UycQ2b0cmXYjMLRrZh1kkMCHaOzQUdeOxYeJuMM+o44lBSp9QKA9JUsYn1h2Y+I4fy1DfQt8rJfBl9VCRKvhkt1VXocsCrzgr/4VN+CYJl7FLujooQh+gwJ5Tw8r/do3vkkkjr5esPZb7bLYotvuAGCIbNbMHeikJZAiXmLn3n7Uj/lsN0Ys3ddF3O5Du7ob6IyXrZhvS2sK1bKLjSGElhVt1bMwGodF0vGrYcH8QJfRzeAVUVVljYmZ7+cqKu1FnRUc6S7npZxZNIUIkjs5hBFwjytMcBCvq7rUfQXO16X1X3pB8jXRmoZuFnt9nGUxQ5XcjErEsr+qX3cKG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ev1SSck= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: c11522e3-3241-4b4d-9e73-08dafdce75d7 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 05:47:20.9439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +43JjAKZf4nzlB8/jWhvD0SiNBnEFn22+qHNAP6vGWP/qPzSJwvUr9N3fcgwALPYFDxf/8UTbywjRPZBHahB/Wq2eazxdGHndioTmuNIDDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5678 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_214730_854886_8864D2FF X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The VOP2 driver has more than one video port, hence the hard-coded port id will not work anymore. Add an extra parameter for the video port id to the rockchip_rgb_init function. Signed-off-by: Michael Riesch --- v3: - no changes v2: - no changes drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/rockchip/rockchip_rgb.c | 9 +++++---- drivers/gpu/drm/rockchip/rockchip_rgb.h | 6 ++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fa1f4ee6d195..5d18dea5c8d6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -2221,7 +2221,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data) goto err_disable_pm_runtime; if (vop->data->feature & VOP_FEATURE_INTERNAL_RGB) { - vop->rgb = rockchip_rgb_init(dev, &vop->crtc, vop->drm_dev); + vop->rgb = rockchip_rgb_init(dev, &vop->crtc, vop->drm_dev, 0); if (IS_ERR(vop->rgb)) { ret = PTR_ERR(vop->rgb); goto err_disable_pm_runtime; diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c index 5971df4302f2..c677b71ae516 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c @@ -72,7 +72,8 @@ struct drm_encoder_helper_funcs rockchip_rgb_encoder_helper_funcs = { struct rockchip_rgb *rockchip_rgb_init(struct device *dev, struct drm_crtc *crtc, - struct drm_device *drm_dev) + struct drm_device *drm_dev, + int video_port) { struct rockchip_rgb *rgb; struct drm_encoder *encoder; @@ -90,7 +91,7 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, rgb->dev = dev; rgb->drm_dev = drm_dev; - port = of_graph_get_port_by_id(dev->of_node, 0); + port = of_graph_get_port_by_id(dev->of_node, video_port); if (!port) return ERR_PTR(-EINVAL); @@ -103,8 +104,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, continue; child_count++; - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id, - &panel, &bridge); + ret = drm_of_find_panel_or_bridge(dev->of_node, video_port, + endpoint_id, &panel, &bridge); if (!ret) { of_node_put(endpoint); break; diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.h b/drivers/gpu/drm/rockchip/rockchip_rgb.h index 27b9635124bc..1bd4e20e91eb 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.h +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.h @@ -8,12 +8,14 @@ #ifdef CONFIG_ROCKCHIP_RGB struct rockchip_rgb *rockchip_rgb_init(struct device *dev, struct drm_crtc *crtc, - struct drm_device *drm_dev); + struct drm_device *drm_dev, + int video_port); void rockchip_rgb_fini(struct rockchip_rgb *rgb); #else static inline struct rockchip_rgb *rockchip_rgb_init(struct device *dev, struct drm_crtc *crtc, - struct drm_device *drm_dev) + struct drm_device *drm_dev, + int video_port) { return NULL; }