From patchwork Wed Nov 30 14:02:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13059874 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 DB45DC4332F for ; Wed, 30 Nov 2022 14:03:38 +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=nWG/kZ8qJP4kFI4cEJ+KZdlvHqfDel4NrNNY35G/Wgo=; b=LhUUTzKaxkCUfH DZQcI5r2tvIWU3OOl6BFbSJmeVkLBxgnCAaIrLU8eHZDexQv5nqFtiVQUExQZimjYaj+uya0YCPVc 2yU6ogeavM0OrJ8thNhxk3QT8yqLkoNqI3WQzz0c7Dw+3Icd6dgPHtBcEqLNOP8WlJtbDIDtgEskG moj4ScC7NAiEXd2PgR2AbbLW8O3HD1ribXbaysVUvZn8OplO41Es5Mac7P4cnzl4BU48Cb6ucWh7O Hzd6gVOHsnPE9YkobvCJtxVl8wWxW++HcinzCb7Cxpqy0/KN7CIYRF/NhM8vgg26/puyrMSN06t5a fAOLrHrmX0Aclu/HaTEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0NgO-00GgPN-KG; Wed, 30 Nov 2022 14:03:28 +0000 Received: from mail-vi1eur04on061c.outbound.protection.outlook.com ([2a01:111:f400:fe0e::61c] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0Nfs-00Gg2K-Jy; Wed, 30 Nov 2022 14:02:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YmwGQ2k6oJMS97IBgw6nMFb8NzPImZw2uHPcHoW1Z1cxK03vpB0g6HYeldN0az/aZz7R5QTB34+jsO3QtQwAM8pJOpn99yubIt5BKUvR90z3z5/NO63Sr6w8E2TvxpqXy85YvZl4IQQQO3JoPn4umIbhmPmk6BndWPyjRPGy2OKHlHmkPAeha7PUQb6aKHJSjoTXVUNj8Ta419k6u4n9J9+4LYZYzzgUMFy8YlhMC8LahWKre4tjH/fI4Q6p0uLuqc2+iMKQgpg8U5HPtEzkTmj7YURD6spm+d3A1pveQI/7SRDqt3A9xrpZc2lQSPpK9B7JXsZfuoP3DB6MRDcpbQ== 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=6QnMkoj/qIu2VnXnxmUTbYZrKmW6PqlhIrdh+PAaceU=; b=PEYX81wbAeUVy2k71K+gge9VVCqVq1a+viDUJ2m/Oq2xX9vW9viLdY5h1NYF2Bo+53/jjhvoYx8wa1hUgd+/sTYfIQGltrFXVcSRXw8iP59XhJpOvfbiubnhwMG6M4Xfgcz1I1PwBGGGzQFhQ0OQcHn7EKAlu51I9atwafuleT7HmADJ1ZZESUM52pk1pO2rjJWFm0PJck3jbX7pd7wdknEA1X9ncGxbOfNp1o05phXWfyjn12kDSplozFxO5/rVkSl0/gRRP2BGBoBFjamTdKjNcGq+2KmrjyAZgA4pcHXEYqfbPbuFvXCy83LiAh0wwseZnVij5XT+wMRK9Q/Pcg== 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=6QnMkoj/qIu2VnXnxmUTbYZrKmW6PqlhIrdh+PAaceU=; b=lQvFdH767oqVxqulN+Yse2JszfNGNJzl3ntI9tMirwTX//v+2T2vM41urIw+jw2doKzT87ArqFfiHpFNxjhJN6Iegy9CY1SLtoO+78TJV8xeu2ugRNk3Cj1bKV0DqXQhpFj06U/a7EylQo89w8jMEpVwjLQSRpsfAxKq+WC311w= 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 AS2PR08MB8695.eurprd08.prod.outlook.com (2603:10a6:20b:55e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Wed, 30 Nov 2022 14:02:50 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::3643:6226:28c:e637]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::3643:6226:28c:e637%2]) with mapi id 15.20.5880.008; Wed, 30 Nov 2022 14:02:50 +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 2/5] drm/rockchip: rgb: add video_port parameter to init function Date: Wed, 30 Nov 2022 15:02:14 +0100 Message-Id: <20221130140217.3196414-3-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221130140217.3196414-1-michael.riesch@wolfvision.net> References: <20221130140217.3196414-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0182.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::15) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS2PR08MB8695:EE_ X-MS-Office365-Filtering-Correlation-Id: 492e764c-5c54-4ba9-ba85-08dad2db911f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l0OT7zrdmhpkUf8YeMbupjJxM9LWBc0jG8+95gtWMuBBs/DEJgHeac4p8oEua896fSshZkPqOaxnM0FUMXLiaSMIYqJznxXWF5ebEgv+SIbw3HO3NRq3kpX+kQqb+LmDFgailNizTtWVHH5+OtqdfB135d4zAVAnqPWdQnpr0yiYA+wohovumtsvQY0RTiDzzq416dQqStKLF7D3db8JxzBiaqF0AKijma/Rz6ZC02EdRzvj1tav7BeK3ybWpCY+EpHWIQ0PHW6T91Khvu3xW3faz1fyMIyW7YxuNbt5Yz5W69ThVzT2kAh5HN2IWe/gB58C2n14MhYdCcgnR/Xl1ftteTdQ0rOzH3gtf5TLQssfsHplsLriRCNBOXusnWClK9CGgyqo+OCwkk2Yv9oxXJa0rR23SI4m6Oom/3Hx53a4NIm4EzPLefZANZZYaTEN3DIO08b0PeOOj9QaJF/eJV/SRYh+wxe52Xt4zhvLXB9oE9NP3riCqC8/aZJfe72lzarwC1TUqJKakDwvufU9hKUF56uRtco9hHCFOQWfWV1tqz0AlABKL8O3S5+TuHdEw1mGh/uO3jBzgGXiGq2WP+ABLEHmU01/i+08sm+pRppLbvm0dy6rWPiBb+7NTmA7VUtsQOaY6xMeRLOCxjym+w== 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)(346002)(366004)(136003)(396003)(376002)(39850400004)(451199015)(38100700002)(6486002)(54906003)(478600001)(316002)(8936002)(2906002)(41300700001)(83380400001)(1076003)(2616005)(86362001)(6512007)(107886003)(6666004)(36756003)(52116002)(6506007)(66556008)(7416002)(186003)(8676002)(66476007)(44832011)(5660300002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4tXNZjmbHP9igB7KKZukdjBuat2924PM9+7dH1zXXYHiBTzcFZ41xN2I9G4kTUvBxPPCnDEP67U8Z9JLMVh9u1xzDfrxqnxatdmqmM8zltUUiGDh1b/UgGS9zc1dneshZ8JhE5OcGc3iup1Qp5OlgRInsshjpHpe+1knCUeoW42T5Y46dCwykJvASSHbGCH9UWGgqdJbEtSIOC9ooUO+o0YB9Q/CholWeQQZpm8UnDibRONnqzvFF17M8J0tDNvesX0FWqyquSsLKDmaBBhMA3PZN1NOWYODf7k8Pr9xTCrwGBYaNJ7azCrjnlW1J79XuG7lJ5Eg+odkvv8DBXMNb+1UylfZeZ2BuqQzn9wtI+9jfD8oKhj5YO6Hv8+KxknA6TXcXNPQUmm1y1NbTG/Cwvahyiu5O99P6Of++mIYQvCdTV9ZQmmRk02WH01ujA6VKLhZOniJVUVZOosXGoTyn0bKGRB10FVTfzUdoLRzReXHc82w7hMHMO1kn7VI5affO8Mgakx1Vqwhb8ChsdH99kfZDloJ4UfuB2Idk5Orsmog+eu1txGyOqsmiOUK4vcBNxp0BTlahQt0tesR8FHoY1nVEL8SPJbuAsWmufsCTwkYBweibDM++id1mm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ange-CrossTenant-Network-Message-Id: 492e764c-5c54-4ba9-ba85-08dad2db911f X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2022 14:02:50.1417 (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: 9N8R8MhXGv9atloN/xSEorCxaou5H/6KuvmnfUM0mSE1NX6U84/YQTIiE9oUgI/zwjv0B9ICj/8/lljv4niqRN89/137jw6YtI0rBBnBBhI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8695 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221130_060256_683047_A7ED8992 X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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 --- 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 c356de5dd220..f7335f9cac73 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 16201a5cf1e8..ed6ccd1db465 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c @@ -74,7 +74,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; @@ -92,7 +93,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); @@ -105,8 +106,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; }