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: 27815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp943025wrr; Wed, 30 Nov 2022 06:06:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf600uid5hUcMS12x9cTqVNoEIAz1VDI9LUwZw/fbPSQ8FzIIw3I+pIVkjDvzi3l/DTbRT8k X-Received: by 2002:a17:906:6887:b0:7c0:a728:6aeb with SMTP id n7-20020a170906688700b007c0a7286aebmr853402ejr.438.1669817192444; Wed, 30 Nov 2022 06:06:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669817192; cv=pass; d=google.com; s=arc-20160816; b=csRWbHyxOhe3zg5p+axOfLTftix9tdjv4hDQKjaXqYTcQr+1j/E7WrgOtpyGSp/7Cy 0XTQabC7l8y4ghp1ATHepuD705/UZUIuZk5LRmeVfO0kSSm7VC3OXX5HgRlgUmZIIMCE Nnm5a27/YvxdrPk6mCGtW1zI0iGLhBBXeG3x7ElWoTgEfZ8+KS2f8MebwsbR0QgYCJAU sY2hxJ2H6mJC1gDa7DXdD2nluwhhhE59W95CK2A1oUndvCyJLTTDerEIrlAUlqoR/Szr 55x26MMCmFYlHKurJ+FONv096EKakbsBFx0KQbidjYDeW64Ld37EWPbp+xozW7fpblW3 kkNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6QnMkoj/qIu2VnXnxmUTbYZrKmW6PqlhIrdh+PAaceU=; b=WcZdBuw0YddZLFElR1qA3fYYlBPqkj0Y9M+mfU3MPFFTmvW7yp7v55hSD4nnAgaJo0 qSMegru56pb994ZI6s7sen35F/BeJzda8IP4IK4bIX6RuG5UkY9v3L3Yh0VE7vkTpGf6 TkAVx7QcTjT3DptfxRvwqUKs+ao6HEttNteKXDnYrJYN6QsUJDDTdDcbcI87LJTWIyHH lTu6RHQsVz2tQOlx6Ft042I/yz0a6l3km4fdzjI4swODegIPfV0LZlDhbJ7WCErWL2v4 wWtyNJ8jDnrclpZ0vhwr4ZvQLsDqHa9XJebafjhvajdiLM3L7DOBasMcu10Bol3jTUOW hZuA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=lQvFdH76; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb8-20020a1709077e8800b007bd8ac3aebbsi1398987ejc.812.2022.11.30.06.06.08; Wed, 30 Nov 2022 06:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=lQvFdH76; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbiK3ODG (ORCPT + 99 others); Wed, 30 Nov 2022 09:03:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiK3ODA (ORCPT ); Wed, 30 Nov 2022 09:03:00 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2040.outbound.protection.outlook.com [40.107.8.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF5E31DA43; Wed, 30 Nov 2022 06:02:59 -0800 (PST) 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+eu1txGyOqsmiOUK4vcBNxp0BTl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lulosp0IugVs/Pnj4hA== X-OriginatorOrg: wolfvision.net X-MS-Exchange-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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750930231984067899?= X-GMAIL-MSGID: =?utf-8?q?1750930231984067899?= 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; }