From patchwork Thu Jan 19 14:39:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108221 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 9A3A5C00A5A for ; Thu, 19 Jan 2023 14:45:51 +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=YDSNQbaZvm10HIjUWbl1nHjnheoQUX0rth0tmjjiH98=; b=yEALIP8+kPECP7 zA2mDYucrRTM6MgDVouQzBTXnCPBVDINtumjliXRnEIimRMRTz8bi+YWypPMGTOvwbQOhllV1d1YJ JKO+ef0iiihLJY3VJpRM4GZ2QwDuZIQS4u/9vXSpNZ0F+9vmp0x7ZeF2XzR7/oT9SsoUG3NrlTtAC QECNPOHrsvt7GPdsoS5FTE9+VjwiT1iNQtYPcBsrHAG4i6vWR4eYFgJs4j/UeK0fwh/crfID7NODB 68I0RniJ2/pz5tY3CLuhUYZZkTP6fmIVbj5LALp9Zq9jNo/Fi1bvKov/EJy0WmhV1hCrvNbpNoHy+ +GN+WoCMKzz7jf0BWA5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW9G-005PKM-JY; Thu, 19 Jan 2023 14:44:15 +0000 Received: from mail-db5eur02on2088.outbound.protection.outlook.com ([40.107.249.88] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4h-005N03-Qk; Thu, 19 Jan 2023 14:39:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mj+75FXRCjwFx9HkyLoSytfSbiB+Ilu07E8EhSdB07IM9YXvdH/EJYuvfJ/4nFXY2wruAmbs0xKDNgCAa8C12UWMZ4ei0gtoHdOcqCkxXXwxQbmypnLqA4Uj315DWSbH34Y0MyVPr0neNSAeM1hDc8JXN7yj4sSHs/UNQawJDa+XhgXwVep4GjK0KkeRQY2gVkrcNC04zE49zlaV2sw3yEDUUY1KQAE+SickklK3JYwIELRnJoozdaVHRLmxk+AGVRxBc94yGOjpLOexB1G8C5kcNN7YCd+7g6AwW/i3NOIsDJ3/G77laviZl0KxFHy+ZCia66sEJxkAWmQWttcUbQ== 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=YkmzXP433g36lmVGSWk0FObt+14496EMVIh7i4RMKLA=; b=jp+OHkxvaXKRE6sYQDo7pfItEEUawfk9zGk2/0jYqKEuis1PWEYQHSW/XMaX34fvrZ5Bu/gZ+KbxFP0KD3ipWzG/HMEgFhsSFa95OQrgxKqws9kHs1ybv1/4QS9CLyaJHiwLO3HJuExBJ+WNZXEEzzvLrycff9zIf6pHmr1yencaWiVep9+pZm+nZqdfIBzGtN6o6kSMJgDdg7p4Df38zs5/4Lsbr8CV/QNf/STSUwe5z+Xa0V2+KfabH8ULMeC81InZRCtzjKSdIcKmNxRpaQ2LJyNvaBkb2+alKINnh0vd78AUx4+Lo473hKXb7p+glgf+olZ5sGJEy0C4xLVH0A== 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=YkmzXP433g36lmVGSWk0FObt+14496EMVIh7i4RMKLA=; b=lffbv7IvJJ0pFhIdUqN4vpxl3s3uRGHWwBNUMFYsTj6ZhE5ttMZB7whm5a8ycHsQyK+Fg9QXlWmmjZUGiSjzrFpbcxpcDFSWvaW/yMm2pyGDU5ENdxJg8PEBereK1pzcyWsnL5+cev4iCHj5qI+jj0r7vgcPxsJ7EvFIzP0kANI= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:25 +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.024; Thu, 19 Jan 2023 14:39:25 +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 , kernel test robot , Dan Carpenter Subject: [PATCH v2 1/6] drm/rockchip: vop2: initialize possible_crtcs properly Date: Thu, 19 Jan 2023 15:39:06 +0100 Message-Id: <20230119143911.3793654-2-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: e307a077-75a8-4286-8e62-08dafa2af64d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pLIOIWTeCLGBbDJ3hBddCSGBttpzzT89GMkFepDXZ7ciDvjsnYRVN1rjN3pV/JQk4q0Fobe90+df+x3h5Ak/BHrJxcpnnz09DEm7o8DmFiSYAjAyuwSbuuKFGuX+EuYcVYnr4oPbMVXd2v47qgTPlbbCRrholk1KJzXGminnwp6FNLcPhX6Wxh2zyS1fRKbnT+HRdijV5kOwkM6zJup1/mUgnuJHXrk4nwHB2H+57F57tsoXkqTCPlGPrIl+E0aB6rM/+8i2BZyNnGWoC7miKusyfDxIap6odBKFwHXM+0uNtUMnzDZxTvw1BygE0lRNqAmuJ8W7t/6VlQ2c249Di4+cgKe6erbTH/oS9QtSAEiQEGNsFbrh2Ckvx+OI96TkHU20TMlSyZSwwbhBF+PIgaRM4+Dn/N9rvbhpjeDRqJBi+bprlKcV/wukl2bQ0ndtDuFZ5NvQ2YLr0ii9Su3Gre+aX5T2aLC6B9cQ5nv4+aemV5015eZWMX/IH3N+So7exnIyHhExELyL63FsDv3n6fuJUzcUKA3BZB5iOB+NcKdPDgpRFkc+yB2eGaHR6T90f0LCMjLDaKzq/zv6cSRr6JAzjP+toaa4Q0wJah298VtHvR7actCKbMbJGTHatriZw0Ud0maDf77IaGxs+JJ3nw== 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0lPkwXv+0eEWl9DI7JUrW8QFFLdYUgC0deK0Xvli06M/fhULcHjh2JIlafZ97NSyqLQRkvuopuRPaYBZEPz7OY0NbpfwEl95hbQdZSZVwEBC2+swUEqW03nmYNVwCyyGPmY1//C0vw/j/+nLE85larCeWPLJFhpzW5qrZdZrbEFxEkeF7Lqhck1JOnmzgeYklWEuKCgRab/WonUfv+k93+h5rSfN5Pex/V3e9BadBB1JVNQiA9IEyWEpce3XYj3ImGzUotSogizC/UvI3Tloph87HZA7Co7seuBAgRdQAULLL7S9Qo1Xh1bwpA8xJGxPJo/zTu8iUWjn6IB6q+CL6cNXVNIH6cp2KvfLZODsAG6mD9OZbm8k8FFOXXD+BbpmGMfrtogBpbDDguDO8lrUPPoXWpPqeM+rBSlxg4zWTWFZnJaT/eD/C4GRjFmNvxn2Q0AW+rYMRQIzTQxp4gzTuYkAP6zs0j8YVCrbMS/uEfb8EJQ1QKCekBbgKk6F96ZxWxD1cSqXbwED+9ZMdNFilMFctVJLNdVXbSvUzN6IaZx6PxjYQAnwGhi5d3o2s4PcyhK5vybemrQkEtTX0T8h2KLkimfDlZ5O3WV6Hzo0Iih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zNJ9/o= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: e307a077-75a8-4286-8e62-08dafa2af64d X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:25.5600 (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: Ev9n9lWn28ZvX4uLV7i+Q06HoBohrCitVJcOOUf75H63iqXjwkYFyXtooNJn58uGW+gfqyYi18kne+n6gEjVq4jeQLk9VZslfbN4toRxO+g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063932_038644_B023D8AD X-CRM114-Status: GOOD ( 12.93 ) 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 variable possible_crtcs is only initialized for primary and overlay planes. Since the VOP2 driver only supports these plane types at the moment, the current code is safe. However, in order to provide a future-proof solution, fix the initialization of the variable. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Michael Riesch --- v2: - new patch drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 8cecf81a5ae0..374ef821b453 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2322,10 +2322,11 @@ static int vop2_create_crtc(struct vop2 *vop2) /* change the unused primary window to overlay window */ win->type = DRM_PLANE_TYPE_OVERLAY; } - } - - if (win->type == DRM_PLANE_TYPE_OVERLAY) + } else if (win->type == DRM_PLANE_TYPE_OVERLAY) { possible_crtcs = (1 << nvps) - 1; + } else { + possible_crtcs = 0; + } ret = vop2_plane_init(vop2, win, possible_crtcs); if (ret) { From patchwork Thu Jan 19 14:39:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108223 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 25174C46467 for ; Thu, 19 Jan 2023 14:46:58 +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=xanbHeTHPb5e8y2LZXiUu6HI88xdGk2EZbg8dK0gsHc=; b=q/Mn6U3Pvn9zJY 38gnmVhtR4sBYMS58T3EQCLJezpCbm0Prjfsbzd+aNyohbD162G1joDHBcGns+TqMsr8CfoSOAn5t 7ppeVCu84zPLSOW9jFGeXIP0KI2W2DCH6Nr/jZycD/7baKO8eLhISadhmUspw4Ov5Avo8caOKsEyf P4tkEk/MCkLWFsS88OlCIK2m1nrIUouj5VTrs589vSVuQIJpmeYaMy8csszemgaF+xDa8ioaqarO3 Hqn+5c1yNex5e7Zy9mZUKpt/QSxr1D++HA16YGk9EVSLgn7+uE//4ZUQR1e8uOXzkOCnPrRy1aRsv /gZU5tMQizKAP1/0ts4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIWAQ-005Prz-3l; Thu, 19 Jan 2023 14:45:27 +0000 Received: from mail-db5eur02on2088.outbound.protection.outlook.com ([40.107.249.88] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4k-005N03-3H; Thu, 19 Jan 2023 14:39:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ayV5qIXazNASngfI171B1ZT3PPYX2D372uxnsL/r2KOHV+2j2S5TR430bq35f9QTPlVMFJn5/vBJ5UjveHE2ao3NwavUMJih9JCqvq65Yg1ZsVgoXlgNMq2gqp0HNtomImtt1Sw0KUBJxYWKhT8cAh6pPS/77LVh6R2i4UsV2Y4xGVnYQ/66z3HNqG9ro3LQ3yXX9QpVQQQGMRML781mswkZcGhmF7iK61z27jhtDCkORbUdnj7zS0J7LgC0cfl1wPZi6tfj4adgBbBoUySvVrbibMxirERQXMdZUJePs7ArtRGpcix9xw2G8NnQKSbfiuLiyv2KIbb/V3WzzOYjvw== 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=jymqeV+w4uIMgpBiV126XddF0BF4GjQeni91Q6nnFoE=; b=H/wozGDRoiS8QUZ18/0889lsCevgMpdtMuV0JLOlJ0ifSZcAoPfUmpQlCX83xmsV4Y45ua4lZkYwcpk1tj3J9+hQyhZ7G7xQ1oQZ+qKuxxmy/eeJnbOJJyl8+Iyr2wDoguvTu3nmAod655f/E9CvzmL9QKC0j2EzRcBObYEfPycSytbz0ezeBWe5o8E34EznDshUIFoBA6y4IAmNj95kOHxfNthDbvPULJMscTfZ8txS/fwJPBATXm11oqISFKwkwRsu80SBE3jFo2iY8VKopZFA0veaXzaizAb+UJnhPEFfzCpkl5/b6d2qxECscliOFOCgUGJoUXgjYeMaUDET7g== 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=jymqeV+w4uIMgpBiV126XddF0BF4GjQeni91Q6nnFoE=; b=AmhnmA0rq1q/Xb8mQkxWAy5QChybml45yzJVTmuDkn+fKHaQGw8NxinktuxjmEmWEK+Vc2ufvjGvBNUcmuO6ALpLI0IZF4mBlP5vrieQGkXXQb+4D8OF0ecxV27SH6df52OLUCFu/L3Ma6gFkbfE6JZ/5Tr72keoc8yyPBb6lx4= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:27 +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.024; Thu, 19 Jan 2023 14:39:27 +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 v2 2/6] drm/rockchip: rgb: embed drm_encoder into rockchip_encoder Date: Thu, 19 Jan 2023 15:39:07 +0100 Message-Id: <20230119143911.3793654-3-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b57ce7c-ca97-4c4d-8be0-08dafa2af756 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TAJnk7X8QtgkGwoduVBfjMKNhnFq14LamwkoS/cltUl75q6WiYWrv+/aMWqFS1tBLLs4L9kXWyvUceIQmAbIrdSOAHrm0TtN1KV1ABe72/VK4NSoD3Mcznyg7cCvwoh7cE3ekr6ses7EiOtQpcGE+KpJDP+1iHxYhblGg1AkNWflWHPlBQ2hJQ2aElP2NlYZiauDeZAHKbFkZQKy8y3KrtdZ+SWt2LKiz0CrvPo6iXevHxjDrZjIuSUhBbp29Larul0Q+HQWkmT9IixeJzfJFOLXDKOXf/QXYQSQrZb9P/0qWyDuUYXGHNn6eu2Dax5tiE6BdaSbk/uhOrQRP302y/i4vRtsOTRxvneSB2TW+6YEpK/DLpHGuI1t6t8XxKVD6nP9sHIyX7fBbZ7fOMHR2oSInQC116mEVTiA2UvD8HN/0KS0tb+QByvqnqs7SXsglGH3bwVyk40Zz62qpLjEH2avlmuvi720Bl9IDCs5RxcBiLzqE//YFjhlTTNGIdb6agRGgm8QV48bs4bO4Bu3zBQX3/yDtRuguN0J2QXLmNrdSavI+s3ZmlXjrfnOJsGtq0bji4djc0Rq9/s3Niru6yWjts35PuMvCTr4csgQml39BkVZl4dLOh8CYN9ZxcKR4Z+ARcXUNG3PFKdtcETGiA== 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(107886003)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YrGJpzRZqip2I4XoZ9BDrIPL/YBxu9Lo6krHzaNJHw18WT9cEWFItr+qHpqWnNKGgizcmFIwqRYq4SST087Ae+Lck7+kF0K6mAEEQj5X6x0h885N5AQCMHfF5NdIeIJQmdRF0VFLI5fnYJsYxRP8bFc0/kRg53lH3OPKi+JQAIVh14XjFP5m27vHdVSuWZ4/hu0AOHreS+avrYKYZnFKGEpuYhQhk5Y1XhzEVgMWfO9kjupRsTqswsN0iJh1cpIWxQKHzqdSycu3FPMNys0em0/Usn9TAz5XBFApSkspW/4A3ugZ9kC4XYKItgE6AX5c0jPVlg7JK/LflPYtjRGKA8lSaEdttm1sdtM7vOqPD4o0Sod+DAA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v97SksHZcywjuRS0cIHDXCiq+FevwoRPZ+GjnAsNzlaxIaB3eF6p0nJHxAKFr4RxXj3Vud3eM2+WX1wDzbBYgMUmd17qVKLadIdY0Xdc95wwq7grZwy1IXhG24t2+KX+10jQrVs7CTyyrK/6hmV0oKYqzQ/9JoaWnvs5EZox1iALfKubeqheHW2wMNLYOgTHAb5I2KTY6Y03WPG9kHB/slHTA5WcSdHLV4proAzuo7LfdsdAFUIqpXrq9kunf5WsVFimAl2syH9o0bRKM3iclybWKUH14= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 0b57ce7c-ca97-4c4d-8be0-08dafa2af756 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:27.2341 (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: XEVtC2F+TdNpyHT7S90e4zH8TTN+Rb4Y/UVU/dYY9Y2+0WxlmRtmd88wmeOCpw9b4NbFgMkCQ5BTugXhrBTqZ/7rl3SB8AsrBI+2wwtRX2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063934_211901_CB3C3169 X-CRM114-Status: GOOD ( 14.94 ) 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 Commit 540b8f271e53 ("drm/rockchip: Embed drm_encoder into rockchip_decoder") provides the means to pass the endpoint ID to the VOP2 driver, which sets the interface MUX accordingly. However, this step has not yet been carried out for the RGB output block. Embed the drm_encoder structure into the rockchip_encoder structure and set the endpoint ID correctly. Signed-off-by: Michael Riesch --- v2: - use endpoint id from device tree instead of hardcoded value drivers/gpu/drm/rockchip/rockchip_rgb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c index 75eb7cca3d82..5971df4302f2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c @@ -22,13 +22,11 @@ #include "rockchip_drm_vop.h" #include "rockchip_rgb.h" -#define encoder_to_rgb(c) container_of(c, struct rockchip_rgb, encoder) - struct rockchip_rgb { struct device *dev; struct drm_device *drm_dev; struct drm_bridge *bridge; - struct drm_encoder encoder; + struct rockchip_encoder encoder; struct drm_connector connector; int output_mode; }; @@ -125,7 +123,7 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, return ERR_PTR(ret); } - encoder = &rgb->encoder; + encoder = &rgb->encoder.encoder; encoder->possible_crtcs = drm_crtc_mask(crtc); ret = drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_NONE); @@ -161,6 +159,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, goto err_free_encoder; } + rgb->encoder.crtc_endpoint_id = endpoint_id; + ret = drm_connector_attach_encoder(connector, encoder); if (ret < 0) { DRM_DEV_ERROR(drm_dev->dev, @@ -182,6 +182,6 @@ void rockchip_rgb_fini(struct rockchip_rgb *rgb) { drm_panel_bridge_remove(rgb->bridge); drm_connector_cleanup(&rgb->connector); - drm_encoder_cleanup(&rgb->encoder); + drm_encoder_cleanup(&rgb->encoder.encoder); } EXPORT_SYMBOL_GPL(rockchip_rgb_fini); From patchwork Thu Jan 19 14:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108224 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 7F802C00A5A for ; Thu, 19 Jan 2023 14:47: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=waFbuW6E7jrEfkbdIXIpAH8tg9Ov+RhVedlJnqchVS4=; b=cAjU6S2Oqxl3wk RO7uSWA2QR6VVM8PjjM7uST+TQ5Xiq4KjdB5A20Kto3YX8UgBPhBqzl+U3krQOIIAxKr9jvm3mlmY t+XtiJFVIgHpiJfj7fw3c6LYC9z3N6MrDPOWFVRys0HASZrIDll/1iZJRBJ4K6amv3GkjNo8NS/BZ Nyb7pRvg+KpecXBETNMFdOUPQt+5GYTy/4wpd6hNN/OHbQwQljo+NaGjzTyzMjLeq21hpGb/3Dawl d4IFXgpwRA+stnScaLlVXKnY8GZ3N/ovbALqsBLuzf8pl0x1VxCxe2YkQYfAtvz2wezms3IqH397B cU+kjHFHRSHA+Yo13DUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIWBH-005QHG-LM; Thu, 19 Jan 2023 14:46:21 +0000 Received: from mail-db5eur02on2088.outbound.protection.outlook.com ([40.107.249.88] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4m-005N03-3j; Thu, 19 Jan 2023 14:39:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfoHa1dTlnrkK4AEJJY3i8j6zvQqYWaGG9l4/C83u9p0b3F5i4d94dlj8YRqJd2CRBi1rKTO7bAzK6d8cU1FcQGgITiHjYegK7nPaQK8TEZBGfxUTtta8qF0Gia4QXuiE878z5kgw6kqFOhC0oHXNWqJcDE2H1Ph5QQr/QeZqh6ZFDhgjTBQeXxYwORqA5XM/RJ3U+VaH+acRgPDnZY8H9yyKIY3rzH2l8tuFnQjiLyDybbDFZuukIm7di9wNiXU4kjyQ6SlAZUtm2m0rgJveI4TzlR4PXFe0C2FLc6RyqNGyOsVJFsTPn8j5/kLITok1y7Rs1ResZqHXb9X2UwX5w== 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=vBrPCmaMjMnV11cZ/AnUAfmHjG/9aWQuKuxz3sw7Fw0=; b=jAQbazX28MCepCwmic8RUO7g1nR+FrfWajkzNvnAKq8n287V8tsvmZuOQpHFAmRryzZCe4Y8RkilH5qFfOUUKCuv0xriRPfTKnxd1WTbJfhBG2JV19Use16dbHp68H35bQyDFv4fXOccnx4v/qJ5DIv5sfdFuxEnASIMfNF2FzA/SGvirg6aSut3PiocyVwaL71iSoKN+tjrYcJ1vrsdHTMqzU4N+ev/q/vX10vTsvZTytYZqytFbgKc31I/4g9yYlLk3+nZl6r0UQtRSrBM+xQaHwlnSSR79b/7pSv4jKZ24nCpcD/5QHbQY0vvVdHFqc4dNcid2BDsNzJaVSbVCA== 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=vBrPCmaMjMnV11cZ/AnUAfmHjG/9aWQuKuxz3sw7Fw0=; b=rHBfl+mJ9dS07jfLecGPw+3SnhJ2VzXVjjR9vN5JuE/hJBp9+1PDQFOT+TzNoHDUbMArM6M88VbFQysgAfrq70k1J+X3a9ShVt6LQAxF6wXQxEBd47g8XkB2Cx4/zl/cezOR3qPvDJoIkRAW1qQzZtDOz/kjrMs24B3rAtbnDc8= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:28 +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.024; Thu, 19 Jan 2023 14:39:28 +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 v2 3/6] drm/rockchip: rgb: add video_port parameter to init function Date: Thu, 19 Jan 2023 15:39:08 +0100 Message-Id: <20230119143911.3793654-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: 23c88aa3-7778-4c10-4abf-08dafa2af84e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1UWQl7Dloent6EuKeZPiLCYdg+TNO5/qB5AfuYsMcAoeGjUKJVrLjfGco8BTCsZMKQA1hIEhOmOAk8EZXIrGhV7xx5YC3gnJkcWj2j1CCVbQkKeKWtiExXLmXmfHlon/M/7WxTe4GJ7x3BBmQtKw82EOUA+eHmbT1vkzUI3SOZxEb+zEpa6kTcR7tnabg+xGZ9udVFGvrnPmTuHlDmkCGIqAWStw55Yux5++DSAUpADm9KUYuDVWllaWah0arUroGqUwktXy8XXeTrS0M4BTGbCm9i282BjrOIEBwQ2vxSsgyaFjUq5Cycsx6nfzOTmOz1dn8dHednsbChCOzjnR4fIVU8x+ZxLFrazSRIbSrx+1Hd2VWma8Gr4fQ2VxgnxuMtdd8WvvVvZ2K0/b4yYkmJ9xDbt33cgCVM7BRlpDTFqJBoXHuP55W3/Ago+V07x44cOZ9yNh1Tm3XPUnFMGWGqTPvnNYYx/qDVrrG862qT7FqagEjnItt1m0B0MaL/46FAoxDZEu8WfwKmsGIMxcarlGdq8040nEFEW1G4IqC26bh2MdH4E2QRQp6VXLel2x/Fz23kvW3rxjuwBdvCcgsOExMYF+SNqHX1SRJEFfPFNkZiMX+9vzR35T6EWS2YKCfr5tyURymd/m53Eh2DQFng== 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(107886003)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1NwomNwU50AuWXizTTrl4lhQ51wokTgX30l6YHuwTbew9opttdraaXntT6rETgdTBBEcwdHUNeN+HQ5KCIJZcJsqEdcCd+0P4zuqE9p8BZZOr3vFSZqHVIWAsoLq+CCf2FF9uySbxei0S5fCb0rbEvfINIQuSKCCKY+j0PzF4xWsp0qSY2xjqUb70onf1xGX3s5QWPI+zpHWssZ9oeLYJ/eIoUzF6fW/CeXY8or0p2OgAYmVF0w4MYgbmrVbcPigS5PnprncjawMwQcnu9T+38GRO3kO+uBNuMrR8n0gF6p3+CzLAPOt26VgiK8SARc1+tUjGvLpeBavTnwEpHdKsltiGLeVlhl2V6AlU3sXMUyd+mSq+9wrr2ey5SR+6YbMiYi29uxdUsXRTyQIV+XJUKkKfdHC4x0LOuy9v1mzox33c2Q05SUuRaSL5W3PnuysqUv9F2DSJh7o2pIJzkAsW02ANg3QkfcoCqajn3QLKAPJ35bsv0d7K8RZL5HRJ/fU656QUDawA6xlKz9xwsjBitXgu47nlunSBX/CUhPGjhlyw5oCA8QhBuU17qjX5d2HgXtr8tUz5lPLmUax6WsDraFE1VxE1+p43XwR57OjaE7r4xbwl+ubra9FTG1mfMMU18lRoOIzzxN5EGRL18PYtXZxN9G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aa3-7778-4c10-4abf-08dafa2af84e X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:28.8578 (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: XU7HtZSajHFt8J4yZmQLSoAy9hLN4T0icX7RZui8r7U6mOWg28eLiCrUPcElTPvFqoDV5LLYgcWX+dw2a8fBC0fIb7OO5EcYzQMS3kUilDg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063936_253045_25E01D72 X-CRM114-Status: GOOD ( 12.97 ) 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 --- 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; } From patchwork Thu Jan 19 14:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108235 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 7CC7CC46467 for ; Thu, 19 Jan 2023 14:50:45 +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=wZWkeHpZpjIhP4XLK9cYi6GdOHnrMA1OyGO+2J8CLR8=; b=U6THhH634IZEzA 0eZ8Z5BzWaeTZZ4ecYbxPvPn5K2rOuUHnLqN2Ou0e/oXwHV/TmsVqxgE9gLZH73nOcs7VJ9oiPAuS lGWva4Pi3rwJwTC+vhtTHos9JEciK3hHUGZouzOF9y03+IMlXe5aM3HCv+Db2egGxyiU1hoFUB4++ E6SyCGSIDeIszZUL6phHr376g4odbA5779ossEDJtkOI8ZKWaPa3QsFHjWt5rPiNFv5Q/xjhz/PJ/ qMvH8g0DprGGxn0LsKJ28jHGrcSJwFQqnNV2kJEQ67G6OxaPS4CJb6LSNMt0aIp7B/Ok3mFk/A0C9 591E6bfYIyJIG11CEAJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIWDt-005RUc-Ra; Thu, 19 Jan 2023 14:49:04 +0000 Received: from mail-vi1eur02on2079.outbound.protection.outlook.com ([40.107.241.79] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4z-005N6x-Rs; Thu, 19 Jan 2023 14:39:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DHcFwAwCG4SA05srllycvh56XvLHZtWeRmSUtNt4Fmc0iYpZEW/j1YjiDNlqoeoTcXIZDc1kqi/OgnH1/zkros44OvWZ6iIu98gVgDJ2d+HsqE0KRPQMq+v+3QMU8dI7PFANhtUnNtTZN1aScqyqIGhByWKB5pqEftbxsh+pjz28IH5j147t8kKAdQiaKMYC/tKTnzpOm7Y43zEaGjR/YamTsqzx2qWDHjWdl+8pmjM8X1XEgMblJi/fH4tAvYh56cWmSPD6kdrASaR/whtJ7ihkEdb44UcJEjOlx2zr3BGHf+AeTN5Uh0FaYq5FsD9RY9XpNIBBFvZlQOOTBE8jhg== 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=bTDa3bsgB3lbqNtRTVwHqGScdV7FWISBbpPdc4IEoFw=; b=j5sWQA4VfXtx6hbgHj4X6rZjQ/hwI1thp2AcU9lxDlCmII2mfeDVEwXrxECAtSpcW3vnximyPXelptwIsddATAKsrkJ9EbqE1tbFdIoLBspChPFl20ax9wQYrEi7o9TmYOr5R+DmypdIrB+9IBlyoH1/p6M3IGILWU0GX2mxBokXrrUwPbHNQv3obGFCEBKqW1OQIRM04/B8Km2PnRJZ5Y0lDK5lXoIs/GdGJuQq3gLEqg+lqf7OGslh9xz2oJRu+pyxFp1lMNw4hqgajKdE5nnOF+36h5GaQTs9emxLqGEiQLua242FKVTZoQ5ig/2rEzUo2Zo/rTReVA9Y11aQWw== 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=bTDa3bsgB3lbqNtRTVwHqGScdV7FWISBbpPdc4IEoFw=; b=habd9RtTyf0V9FqcvR7dlzJ93zOJeIl41zXRPls8d0kFX4GB1pM6QMFS/9P9Je3MyNDAR3bUmRcBz2JbTb3J+ci2M5oriOftXVhhEJxoaE950PjtfB3178c8/qa3uUj6QgabMBo4ljOl20rHKCtJUtGdQf3VV7bRCFAtopPbWbE= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:30 +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.024; Thu, 19 Jan 2023 14:39:30 +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 v2 4/6] drm/rockchip: vop2: use symmetric function pair vop2_{create,destroy}_crtcs Date: Thu, 19 Jan 2023 15:39:09 +0100 Message-Id: <20230119143911.3793654-5-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: e8eb3cab-14ab-4bff-c207-08dafa2af948 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Amhqask3UacCpQfY16L0PNn0CWQ0zY5gV8ajcbe28f04dG4P37TtNuWv/rKmcUy0i+uOb0UqgNyapJVY0ax1UV7YKhbdFlxqtDaBnkvDaZu+FYERkvhDzjcjFWAidg53/ghlGqdV7J6zU8lFvFYg7G5NKNXgNlq6BNFW5yYBLWNpk06b10zzCT5Hx1G35Pt1/HadThLxR808fmYvXugqZUD0Vm7DDG24NsdL6NtDtgFU0YqvImOT8/fAK84BERV6okiPy6u17mkQX7llzxLKRYxEuu10jMQk7sZs72l42dJLBWOyH7I3qROElbB5E4CarZGoAAAcV6O4RsXixABBXmWu82ilRkX7uKbx+qSBPHBHVaH2BnIQc+NbLRH9cF0smCsthcabqupchf4GeiSpFkxzhPqFIAXAbgeZoZTGuNi9ooJC0uS6AhzZqThxJ1IwuuxcvhbQ19ObzbFok3TSCLgJYiHxp0TN7c0cJZYDOAZPQ1DIM3cX3ofmHiOi+w4TLPUw7LrECn1/rfHte8SAxtOkSIlAEBqPUbyBT+B5EvIbP+Dv688/Q1DRA60zN4mUIQWqe6TyJ6SZco90wtNjrtMMK1WCiH9fQ3vNhPzx92hk8tI+spBI3lPTs3SppEgBzmed0i9xruBt/ulSqbbQRg== 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(107886003)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CIwsjhm+Kk8aFjXIY5PIHkB/OoIGHUNzn1s1BcKlPKanb8xUczLHioBTB24Bb9bG0LR1Xtw1n7YQlrKLBS1aFDHg2KQ9UaE4GSiJMxM40MS2l5uJHmXnowTM45tuNBN9Ia+67G3FqvUcA2zycIYZ0J97BtF7GkxG5oB8MrgDc3wjL9EiKmsqbexdi7fcBcks2J1aRRRJ/rrEx1tmRzsAl165bM07uH7wWoTlIc+ZsiSNyiuo494yu3q50H+0c2H2IIkXycuqFF/MY74yhdVsUO82w1gV8FWS4xhAQLCl79LXCwLag6IdXxESbbNUFS7sSt4K9P9A/1Q4jCUaTqeeKMT1uuDWyTtawhA0145r1RxueRqKil243gw7DhjHwgBuHmuTwRCDG0/fY55JloMOnGzU1UNa3bp4ad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vVonRJu020B9/OeM1LftIvf/MzSQRw2Yijl/j014TCjxNTU72DKBWFc/7jz4WA6iPsik7MXSSzSq2/U/cu9urEeZEsjoyWIfmjdv4Vn9KxeB/+os8U8AvreSRERJgF5pcglhwkyypeYddo/ydy7hRorMhkJe3429wN2OAq8rh1fbbWsHS+d8lWLaU= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: e8eb3cab-14ab-4bff-c207-08dafa2af948 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:30.5149 (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: rvkHGKFTReS6mnofLwKIEQXiukh0GANR+sMAMDSd8dM+DIoZ94B3Ume+uPxj5iMxqsS18DKYtaVEaNgWB3YLdQeu74tscgqqtYnMNpbS5+g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063949_953898_0876F6C9 X-CRM114-Status: GOOD ( 14.52 ) 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 Let the function name vop2_create_crtcs reflect that the function creates multiple CRTCS. Also, use a symmetric function pair to create and destroy the CRTCs and the corresponding planes. Signed-off-by: Michael Riesch --- v2: - no changes drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 31 ++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 374ef821b453..06fcdfa7b885 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2246,7 +2246,7 @@ static struct vop2_video_port *find_vp_without_primary(struct vop2 *vop2) #define NR_LAYERS 6 -static int vop2_create_crtc(struct vop2 *vop2) +static int vop2_create_crtcs(struct vop2 *vop2) { const struct vop2_data *vop2_data = vop2->data; struct drm_device *drm = vop2->drm; @@ -2372,15 +2372,25 @@ static int vop2_create_crtc(struct vop2 *vop2) return 0; } -static void vop2_destroy_crtc(struct drm_crtc *crtc) +static void vop2_destroy_crtcs(struct vop2 *vop2) { - of_node_put(crtc->port); + struct drm_device *drm = vop2->drm; + struct list_head *crtc_list = &drm->mode_config.crtc_list; + struct list_head *plane_list = &drm->mode_config.plane_list; + struct drm_crtc *crtc, *tmpc; + struct drm_plane *plane, *tmpp; + + list_for_each_entry_safe(plane, tmpp, plane_list, head) + drm_plane_cleanup(plane); /* * Destroy CRTC after vop2_plane_destroy() since vop2_disable_plane() * references the CRTC. */ - drm_crtc_cleanup(crtc); + list_for_each_entry_safe(crtc, tmpc, crtc_list, head) { + of_node_put(crtc->port); + drm_crtc_cleanup(crtc); + } } static struct reg_field vop2_cluster_regs[VOP2_WIN_MAX_REG] = { @@ -2684,7 +2694,7 @@ static int vop2_bind(struct device *dev, struct device *master, void *data) if (ret) return ret; - ret = vop2_create_crtc(vop2); + ret = vop2_create_crtcs(vop2); if (ret) return ret; @@ -2698,19 +2708,10 @@ static int vop2_bind(struct device *dev, struct device *master, void *data) static void vop2_unbind(struct device *dev, struct device *master, void *data) { struct vop2 *vop2 = dev_get_drvdata(dev); - struct drm_device *drm = vop2->drm; - struct list_head *plane_list = &drm->mode_config.plane_list; - struct list_head *crtc_list = &drm->mode_config.crtc_list; - struct drm_crtc *crtc, *tmpc; - struct drm_plane *plane, *tmpp; pm_runtime_disable(dev); - list_for_each_entry_safe(plane, tmpp, plane_list, head) - drm_plane_cleanup(plane); - - list_for_each_entry_safe(crtc, tmpc, crtc_list, head) - vop2_destroy_crtc(crtc); + vop2_destroy_crtcs(vop2); } const struct component_ops vop2_component_ops = { From patchwork Thu Jan 19 14:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108233 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 3BD21C004D4 for ; Thu, 19 Jan 2023 14:48:36 +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=08JpVKlHf/SF7jgDarDlkqGkekmqsHDY+iiL6A+1MrY=; b=HrlFUSO1GsNFuN TU3V0of3rQwuopMlwHHLifEgqIyk3ROqjvdac3EvAnrf47KXO7Z4BPyOeVBtPGz86osLgjwMlyevB sfFSlpZzl1KR/GnFPCGnri0IsqKx+02f+BxM2V26ttKDmT7ofxAV8ZgEJ+25sxcxnQE0t5YXT1Vjq BKN8SEtbw+s0xjQCqKtJIfHFgd6UWRuzdscgPFfqBEj+f4/8XGiDXPhwh7Gbddh/9htKjVqiUqpML NqsQw+HHZq48yOR8NfIHuto9KmkTI9GFCsZa+sOWsheeY26H9ZbJzYMwC5pu0FzG9aZBLGrvYwWGF nrIjVSPC3Dx+x4/lRzdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIWC8-005QhI-Pg; Thu, 19 Jan 2023 14:47:13 +0000 Received: from mail-vi1eur02on2079.outbound.protection.outlook.com ([40.107.241.79] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4s-005N6x-U7; Thu, 19 Jan 2023 14:39:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sya83KXQivjVB9BB/bQduH18notfoHUu62eXMS+XPOwsZyS7z5mDJyygNn2dERphOgDCKWPOvW51mGwyTtpz4ZaCgUeXqU66ol49zAnXOZqBzY/ziHooEpVvyzLnq8G93ZJPkSj5QiJN00YhD1uRBkt4hg6fJjRdv4c0nwZ2UccPPvDeX+zdmEhyVx/tdKITYtofGYUXQDh7nW1SxAVUDFkcbOQNbLqNSki1Z8DZUzNhR9KzhJ+6qxQHDG6p1H3PwBUWNIzqjYS+0bB+7VArFDpnsRw4SjQfBGCc5sGsxhvsdGiPw8CPym0EYtd3XDlBO+SGkJyTTQ4E2WVBodW3UA== 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=F2F3uF8cnXUZ/k+w9WKWhvCjJSIzUe3ncb1orqRKHaw=; b=iK2vDJkBS/bUcv23hJ4D49g8coOrCp+YizSsByURLpDJOdLzImZC1H6wXMEK11m1BFhUmQ2JLBrXGB5dGsPq7oPH734osIODZ3s9LMf00nSlJPyyqh7HC8jcXB0VvTCnel8vNV0jpYYehPUys3IbSVNdV/eDH3F7rnl7x9rONcela4w4vNEgLbVKyhb/PSkdnjGWAAWaJaFNOjqT9jC4U6fKaAU+5KTT+LZZU0WVbAmql/qvD1fPstajudu3yogOUAlx0+ScZiZF+G1Rv4FnUL3d8nNrFdo7k69fc4NQW1KGf/fMwLcy2AB6zSS2MSQYRGg1rUrYY83p6+mHHFVfRw== 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=F2F3uF8cnXUZ/k+w9WKWhvCjJSIzUe3ncb1orqRKHaw=; b=SoQLvlSykVHt4lK8zHp8aLK5nPADdgFzovqYnW11OZoiyaOwEuyGvfUxaEWs1ttmPJjFiyTmsz3U0BkbgsPjZU4DLxzTr8+LEjZ7KN/PVrYSEAiQo/NGYdaFzns8Ai8RsGwrSeH4qaPUj5ZYAW98EfM+4IBEXmz4c/h5F0BQQ9w= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:32 +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.024; Thu, 19 Jan 2023 14:39:32 +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 v2 5/6] drm/rockchip: vop2: add support for the rgb output block Date: Thu, 19 Jan 2023 15:39:10 +0100 Message-Id: <20230119143911.3793654-6-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a760ca2-9af5-4b15-c985-08dafa2afa2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ymJoOAT0If3YOtyos/ftcWA9CV5ptidQcWxX6oSRiUI672bG3d01MQjlodfeTWnQCmHMG0Zpp0Tulx9SflZ0a7uM4Vkrz6xJnfnNL6zy87IeXgPQdGdRFa0nHHBpe1H0tgF50zT+ToslxuPhb5ZWisH+O/eXJqWZbkIbBPfhz+dwhTFPp8wzUM2SApxwpk1rL/6XkLaBnVD5ua9nGGG6OhNdB7wTtfCsk+OjPHpnYW+qNMrWiFv80D/+JTr2CEPj4DmRYv+zhlYjtuXXoUgYOWmEIzYTvAIx5QBU30bhuvUIQcsEd0aJIxjfUmUXk58hTN6k/O4OZFYkE1+anVzt8TyeY1Y8hV+0o14nwuNG//OXPC9fDEkUiVwM0gWkbYu6aA9vCMxH5fKzAzJbQScFTXP1sxGRw60h1WkGEeRx1YG6lQP0g5IA8oAF63d5mJATkaZNlYavWym53HVZ6jSrBGbtqT06XMJZx8i9w9Fyko6Khcn/mfaqfG7VVi4QOrIrV57EFMssEpYiu+zIdJDIIRBt0hJewhJ7A77+M4evUS/TXhPpt5nHVfVKFDnqd+CYMikKlJdtNENaPhwnjgFVCrZz4lolKoTxzKz/6lj645AirEn7BhjnhmjfQbrf8JkAv5BR39fxs7FqC1TzHTHsKg== 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(107886003)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GoUxlm49HtaVXAY5j6tlkwI/1hp/4p/K5FQDNk05SivFVy2YAEl78IDNu/rBIcNtEIz69az93rajJqwZxmxrW2d3EJS33aSFTOIjxhDWlYUpqkV5eQ0nMWhvlqy+1F9WxGfsA7RDkfNOQC9sN0cE79MjrAN5hVI9MvibT34aOZVqaApAB2/B5KqC2QOxnTNXzhh54ckg6W9AoTG+o0FO5EHBtN35SnctGKXo7A2n8WABsQywiwKAf7tasBdxJIvQKRZffKbNy+UlEPJQZPdd4cTh1K63+XEESwg8iP7Zsh4Eoyz3Y/RqjRDsdjJA2imJN6ZAKiKJKpKHDCoRKI5Iuq7GjN2J2Exd6k84DHO7Q4X6NZtduze1LZiFZXnDti/f5hVOHDXt+3b8i8mY5ipt4A0QPYM8PxWrZscBFmJ4B4l06teePkI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TcThIacuv+zx81JqFebyRgaWqDaL9UJWJfo2jo7ONquG25VPQ46aCEgsbP7OF4Rj17jvXXYSa64xqITEZ08QODRz5igZny5HZzevVBiJdGSnIpbRNmikUVZskKpe8hEeEnkT1i8KTcrupntv5YO89GS/xcvoVxVz7FVGocQtTnkmR/6fiOePIkbKhe72C6U= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 1a760ca2-9af5-4b15-c985-08dafa2afa2d X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:32.0158 (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: G11G/7V5RklqhxwaG0Bixy7epljYqDrP1qaRaetJZzrgY0B4yUIXwtJW8KtBe5vdA+TsNnl5CeGPRAD6SxQlYhe8qQ6rmtRH7Xyai34GFRg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063943_113126_22D7DC4F X-CRM114-Status: GOOD ( 20.28 ) 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 Rockchip VOP2 features an internal RGB output block, which can be attached to the video port 2 of the VOP2. Add support for this output block. Signed-off-by: Michael Riesch --- v2: - move away from wrong assumption that the RGB block is always connected to video port 2 -> check devicetree to find RGB block drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 06fcdfa7b885..f30037d161ae 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -39,6 +39,7 @@ #include "rockchip_drm_gem.h" #include "rockchip_drm_fb.h" #include "rockchip_drm_vop2.h" +#include "rockchip_rgb.h" /* * VOP2 architecture @@ -212,6 +213,9 @@ struct vop2 { struct clk *hclk; struct clk *aclk; + /* optional internal rgb encoder */ + struct rockchip_rgb *rgb; + /* must be put at the end of the struct */ struct vop2_win win[]; }; @@ -2393,6 +2397,25 @@ static void vop2_destroy_crtcs(struct vop2 *vop2) } } +static int vop2_find_rgb_encoder(struct vop2 *vop2) +{ + struct device_node *node = vop2->dev->of_node; + struct device_node *endpoint; + int i; + + for (i = 0; i < vop2->data->nr_vps; i++) { + endpoint = of_graph_get_endpoint_by_regs(node, i, + ROCKCHIP_VOP2_EP_RGB0); + if (!endpoint) + continue; + + of_node_put(endpoint); + return i; + } + + return -ENOENT; +} + static struct reg_field vop2_cluster_regs[VOP2_WIN_MAX_REG] = { [VOP2_WIN_ENABLE] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL0, 0, 0), [VOP2_WIN_FORMAT] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL0, 1, 5), @@ -2698,11 +2721,29 @@ static int vop2_bind(struct device *dev, struct device *master, void *data) if (ret) return ret; + ret = vop2_find_rgb_encoder(vop2); + if (ret > 0) { + vop2->rgb = rockchip_rgb_init(dev, &vop2->vps[ret].crtc, + vop2->drm, ret); + if (IS_ERR(vop2->rgb)) { + if (PTR_ERR(vop2->rgb) == -EPROBE_DEFER) { + ret = PTR_ERR(vop2->rgb); + goto err_crtcs; + } + vop2->rgb = NULL; + } + } + rockchip_drm_dma_init_device(vop2->drm, vop2->dev); pm_runtime_enable(&pdev->dev); return 0; + +err_crtcs: + vop2_destroy_crtcs(vop2); + + return ret; } static void vop2_unbind(struct device *dev, struct device *master, void *data) @@ -2711,6 +2752,9 @@ static void vop2_unbind(struct device *dev, struct device *master, void *data) pm_runtime_disable(dev); + if (vop2->rgb) + rockchip_rgb_fini(vop2->rgb); + vop2_destroy_crtcs(vop2); } From patchwork Thu Jan 19 14:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13108234 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 320E6C004D4 for ; Thu, 19 Jan 2023 14:49:44 +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=n3lDJdUPlakYV+DSU9pdwtMPwJ2g4435AUm7zMtDKvs=; b=BHqV/Jsu6a1WWg +GN6P+qLCB5ZhMWIO5/p1XKgWH2Z13SNmEKMHxjhqrTLstziXOhZHmKPBzs2H2WTNVflTQ/YWLylb GXuqGot8ZpXwpFOvkLfA+its3Wfl93Of/WZlxmUfU1Yo0MQ+/l7CpnNNm9I2kZvH06s2yF0dbHac0 kaVXd4mIO49cDaGMaKnBqySwFVIB6oYNyr+UpTyq8P0CUpEEwMkULjDf9Mad1bvrCwmL4SiqdyYPL T11ZkgAtKbqRwqSiNin9gLKgiqJ/CCWVJoUv1WRvAM5MfFFvgXOSigu229d9Bfm2Vax2WzROAYzkp imnO26AYjr/tKXliWD8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIWD3-005R89-OY; Thu, 19 Jan 2023 14:48:10 +0000 Received: from mail-vi1eur02on2079.outbound.protection.outlook.com ([40.107.241.79] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIW4v-005N6x-6S; Thu, 19 Jan 2023 14:39:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HH5TqMvcakH6MsIcZ0KN0hM+OwqmL5WPidXggE2Br4RuZL67pn5BmTcGxjB/PFsHou++30fZntUIiDKkrfsY6LVOFR8u22Le7tM9lCPzBB4kcOHH+ETAqFUQ0wqEtYfC/Bj123Uhgtz006zAb9Xlc6xNAW7+L9OTnLfL5YbND5l4TUhecW5G0Ah75EuZsZQLKpZrUNK1am8wi+Tw7Cf75K/mKstJlO0LpjzF8rPg7oOMB6I8fnKcizdjdFwSpoSLi2zDe2+oh/mEVKR986XKlo4tvWwnRQoH7/g6xNMAxdJscGT+l8zJ1uGeRucMH+7epfsr+fIQLrbXI59Iml9/iA== 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=eEYoPRCiCB8m/KrOhtmvJIRuuqANDjXR6bpxvNkok4g=; b=RSgGiFSutrZHGKI/4o/0iBKZQ4T3K2EMhS4IYfv33msQuB+IBkHWp9+qrv6gXdHAGF2nmA54SNr2FB5oeDTbuvhvv3O0pH/3lRmYYTXDQW+fbfn+7cXf09DkWHFtbT10bD/XXibaGwED6bPytq2TAzswjEM2Kn1ItbUISZoXrLK3MAVNUcmOWVpbK5tgGjko0FUKZsd0TO8NA/SZ8JgwTRQ6Ax2sBqNzbbBECwdUYp/alq45KAbDOjZWcfxqGB27I+RAk6HK3fWr2JgFzhJg+u3FyN40TxlczHGad++bsS0MluarBNlCI0gat7m2yAlDCew2Pmt0jrFRSiZ3xw+ByQ== 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=eEYoPRCiCB8m/KrOhtmvJIRuuqANDjXR6bpxvNkok4g=; b=0kWaI6JxeUoxLx/H0TuMOdLtDWKPxs2F5yMlbXi3DmZ2dhnxDq9JtG8pumtbHf3UfvVQYg28BW2RU8OUAYqZF3LjhNCdRY09iKhQ5fLcEn2cHUiBmC7SF+P2wiRhkuhrEmrGeyfcfUhPMaJGQlAbp950xVvbotdK0mvFgPiCMsI= 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 DB9PR08MB6556.eurprd08.prod.outlook.com (2603:10a6:10:261::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 14:39:33 +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.024; Thu, 19 Jan 2023 14:39:33 +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 v2 6/6] arm64: dts: rockchip: add pinctrls for 16-bit/18-bit rgb interface to rk356x Date: Thu, 19 Jan 2023 15:39:11 +0100 Message-Id: <20230119143911.3793654-7-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230119143911.3793654-1-michael.riesch@wolfvision.net> References: <20230119143911.3793654-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR07CA0152.eurprd07.prod.outlook.com (2603:10a6:802:16::39) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6556:EE_ X-MS-Office365-Filtering-Correlation-Id: efcff33e-f4c6-4713-1849-08dafa2afb17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RQy5FKOgLZHyqR8ZnIc1lb/ic1GvKWFf006Bvm9JC+y81HNi2HWnEQALTewxlP09MHGI91+pz4J02ZDGUJ3J0KJ1Qv5NaDOdfy76Lx3Le81+Nk07vCpAanehp8Ls6MnM+i3O1BpwgGxCaMQUnTEdmEL3uPCKTs7BMBVbjO51xn2aPjuKsxiZHw+ufkcvmjTcw0+QMkL+ywtnXRW5m+XrTux06UtyBzWGjjmihrwKvCHxS5ZnR+mLQYCFkYoef4+ZCOSZYoWeZO/v67Rzz4aa3dbqFqHkAyCSbObWLMFhp6yUZmlQ9gL0zkdu7lV2SR2coK4bWtJbyRzddChOi4G2z/uvNRuF8R85kLxDONbqS4ZFBe+ckJsTmD3CiTwyDQzI7u4WNXRdnL03vIyXbyMqOoNUiZsIRSOTuPmJT2+ou8wPBx7rcD2BFH4gWyoClsrIHefjRsgKCysjtEvzthjgx+Kezxjbk+wgmUiY3vXLAkgeUEBR2GwN0QW2m7bPsy6G0jWnygn/NvY7Fc+IT80W6NX5I7xRbMbhrs6pMLOnuiJkywmgl7xi7bqCiGUjODnvTob4zwD5cLC7tu2K21w+gGo7kr9CHuKi3wxIuhOYejiMk03hFqC+rd0Vqn9jGMUayFsjwyU+mCi3xARjrQr8vUAR+SU4SlDKLzEtvpGYREo= 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)(376002)(366004)(346002)(136003)(39850400004)(396003)(451199015)(2616005)(52116002)(36756003)(966005)(478600001)(6512007)(8936002)(186003)(6486002)(5660300002)(83380400001)(41300700001)(7416002)(38100700002)(44832011)(316002)(1076003)(66556008)(66946007)(66476007)(86362001)(8676002)(107886003)(2906002)(4326008)(54906003)(6666004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lqSwEHA7XuhkBFUMjHdnVaTWE5NFU6XLPRRQHpiaEeOIvmNaiWPJGqSTt8IcgsP/nQy8S+92ZpjgiCc15qqBbskFwkrceJzZ+e9nXpi5VXkUBwmBHdv9Fexx+zsfxo/nXj9/0C6sxqnRI15bnN0M/SxgdX6eOUysxugFi4CHyiBUGiuJN7GWhrFCoEZumzNpC7CWHwa5L2RRFhg4ny2qcYBb2qOQzwFF/8EI6ifMOCblWEYQO6C8uIxykyz95i8aK3J0yz6cBZAJd5aEYX+f7CX7zVHg4+57zLw1Mx1Bne9c2Roih7yIdd9ehOSNWXOeCj46JWo6EVTZi44NPrK9ZPPGdn2mp5FX35Lvkz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w11p8zG4MEdRJ/Y1MVZ3NfB/FFLshc7z3B6UdBNY1gXwwFKV48ha/AOx1YdsHFbFWs+0/cmPLsZCJ/WEfLThtVLlkZjzgxEqwECVj8onap9+gxNdIatWYNdbptkDdXuimSB8c2jl/zRmx6xilbRd/BR/bn+nTNFEupVMjYIuZk8YGQ7wNw4foWRBiynJFXmXfPGYYkanuzVcyJPNqJS09zxDy7dO8M15ZlBdo0Yb/gwUODatbxQE3BYL2uRXzPi7DdJJ95E= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: efcff33e-f4c6-4713-1849-08dafa2afb17 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 14:39:33.5605 (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: 1bf+w3d9qsXuEx76v1XZcMz8bWcibC+Xl0dMVuDF6G8WVbPdU+9lW35aQP/CX/KPkhdDTDy3cH0eZOxN5b/IyV/2wo5dg7qQ3ccWFD34tVw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6556 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_063945_320839_2704AB81 X-CRM114-Status: GOOD ( 10.98 ) 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 rk3568-pinctrl.dtsi only defines the 24-bit RGB interface. Add separate nodes for the 16-bit and 18-bit version, respectively. While at it, split off the clock/sync signals from the data signals. The exact mapping of the data pins was discussed here: https://lore.kernel.org/linux-rockchip/f33a0488-528c-99de-3279-3c0346a03fd6@wolfvision.net/T/ Signed-off-by: Michael Riesch --- v2: - no changes .../boot/dts/rockchip/rk3568-pinctrl.dtsi | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3568-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-pinctrl.dtsi index 8f90c66dd9e9..0a979bfb63d9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-pinctrl.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-pinctrl.dtsi @@ -3117,4 +3117,98 @@ tsadc_pin: tsadc-pin { <0 RK_PA1 0 &pcfg_pull_none>; }; }; + + lcdc { + /omit-if-no-ref/ + lcdc_clock: lcdc-clock { + rockchip,pins = + /* lcdc_clk */ + <3 RK_PA0 1 &pcfg_pull_none>, + /* lcdc_den */ + <3 RK_PC3 1 &pcfg_pull_none>, + /* lcdc_hsync */ + <3 RK_PC1 1 &pcfg_pull_none>, + /* lcdc_vsync */ + <3 RK_PC2 1 &pcfg_pull_none>; + }; + + /omit-if-no-ref/ + lcdc_data16: lcdc-data16 { + rockchip,pins = + /* lcdc_d3 */ + <2 RK_PD3 1 &pcfg_pull_none>, + /* lcdc_d4 */ + <2 RK_PD4 1 &pcfg_pull_none>, + /* lcdc_d5 */ + <2 RK_PD5 1 &pcfg_pull_none>, + /* lcdc_d6 */ + <2 RK_PD6 1 &pcfg_pull_none>, + /* lcdc_d7 */ + <2 RK_PD7 1 &pcfg_pull_none>, + /* lcdc_d10 */ + <3 RK_PA3 1 &pcfg_pull_none>, + /* lcdc_d11 */ + <3 RK_PA4 1 &pcfg_pull_none>, + /* lcdc_d12 */ + <3 RK_PA5 1 &pcfg_pull_none>, + /* lcdc_d13 */ + <3 RK_PA6 1 &pcfg_pull_none>, + /* lcdc_d14 */ + <3 RK_PA7 1 &pcfg_pull_none>, + /* lcdc_d15 */ + <3 RK_PB0 1 &pcfg_pull_none>, + /* lcdc_d19 */ + <3 RK_PB4 1 &pcfg_pull_none>, + /* lcdc_d20 */ + <3 RK_PB5 1 &pcfg_pull_none>, + /* lcdc_d21 */ + <3 RK_PB6 1 &pcfg_pull_none>, + /* lcdc_d22 */ + <3 RK_PB7 1 &pcfg_pull_none>, + /* lcdc_d23 */ + <3 RK_PC0 1 &pcfg_pull_none>; + }; + + /omit-if-no-ref/ + lcdc_data18: lcdc-data18 { + rockchip,pins = + /* lcdc_d2 */ + <2 RK_PD2 1 &pcfg_pull_none>, + /* lcdc_d3 */ + <2 RK_PD3 1 &pcfg_pull_none>, + /* lcdc_d4 */ + <2 RK_PD4 1 &pcfg_pull_none>, + /* lcdc_d5 */ + <2 RK_PD5 1 &pcfg_pull_none>, + /* lcdc_d6 */ + <2 RK_PD6 1 &pcfg_pull_none>, + /* lcdc_d7 */ + <2 RK_PD7 1 &pcfg_pull_none>, + /* lcdc_d10 */ + <3 RK_PA3 1 &pcfg_pull_none>, + /* lcdc_d11 */ + <3 RK_PA4 1 &pcfg_pull_none>, + /* lcdc_d12 */ + <3 RK_PA5 1 &pcfg_pull_none>, + /* lcdc_d13 */ + <3 RK_PA6 1 &pcfg_pull_none>, + /* lcdc_d14 */ + <3 RK_PA7 1 &pcfg_pull_none>, + /* lcdc_d15 */ + <3 RK_PB0 1 &pcfg_pull_none>, + /* lcdc_d18 */ + <3 RK_PB3 1 &pcfg_pull_none>, + /* lcdc_d19 */ + <3 RK_PB4 1 &pcfg_pull_none>, + /* lcdc_d20 */ + <3 RK_PB5 1 &pcfg_pull_none>, + /* lcdc_d21 */ + <3 RK_PB6 1 &pcfg_pull_none>, + /* lcdc_d22 */ + <3 RK_PB7 1 &pcfg_pull_none>, + /* lcdc_d23 */ + <3 RK_PC0 1 &pcfg_pull_none>; + }; + }; + };