Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1162015rwb; Thu, 19 Jan 2023 07:20:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXtrd8teLzv6MfVNhI+CL6CZwvTHq+xQPYQtTINQCLCh0BT4YfBSiHhEVqbF+JybT3Ti3MUw X-Received: by 2002:a17:902:aa97:b0:186:748e:9383 with SMTP id d23-20020a170902aa9700b00186748e9383mr10990896plr.46.1674141607466; Thu, 19 Jan 2023 07:20:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674141607; cv=pass; d=google.com; s=arc-20160816; b=kQ8FiISsA8NhGYqQsgUF36jEsJ0vfegor/7xzC0zy6nE0eeJQwRr29/vBEsa6HDgfl pIa6UKekQ9sp4gK+ZZ/RH8LbfU6xkYjXrC/RuCdUbQf/Eiavm6qxK4MW41wZJibbNBsw TpSWlWS03eQKFVYuRREwBtXzgmNxxe5RgYXUkHmooXtTpQUivIyG2iJBRiQKCuZryior veelKhp2vGwEMg7m/sCjbinz3MJRueKt9UGZGoTl/MVJmG7nGTeLPW9dCLBkpJnt+T+h +P1mzSfYIeLgjBqQpH4BxsR9i3zbAafc2P6shcXEP2vJy3Ggj5FLyDO8SMovaou9kQO+ HLEA== 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=jymqeV+w4uIMgpBiV126XddF0BF4GjQeni91Q6nnFoE=; b=C5MUdXPXtHuBJgkSfzJdVz/fOJ0YZSVZmgNraInJEPXW1ylotChtx/c1rxvMFHsseN gtRkkWr9ZXZm4v54qRJhw2G0iJ58vFM9stDrZbMtfsPeKqr1TU1vxNXsgI5YjuidRVFA C6pVx8LCZiJwUyGCGeG+Gfpn42ofBAJ3rDap5B2l/L7zzz7tFUlUqCi0fFoHoYxuj1hr 3xhBJExzqh5a43JihaEyBk9AltvRyiocQrpCZymB0BJ9zBjJs2La/JtqR2SArHmaR2qz 64p+LFs1QtOJ8qh/u7zJnrXEvL3bswMhs/zlhaXPfnxi62LylBzD42QcEUcoqG2mdVSB D6Vw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=AmhnmA0r; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902bd8700b00194548ad2c9si14936303pls.61.2023.01.19.07.20.01; Thu, 19 Jan 2023 07:20:07 -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=AmhnmA0r; 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 S230436AbjASOls (ORCPT + 45 others); Thu, 19 Jan 2023 09:41:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjASOkq (ORCPT ); Thu, 19 Jan 2023 09:40:46 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2066.outbound.protection.outlook.com [40.107.241.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E4B87297; Thu, 19 Jan 2023 06:39:33 -0800 (PST) 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?YrGJpzRZqip2I4XoZ9BDrIPL/YBxu9Lo6krHzaNJHw18WT9cEWFItr+qHpqW?= =?us-ascii?Q?nNKGgizcmFIwqRYq4SST087Ae+Lck7+kF0K6mAEEQj5X6x0h885N5AQCMHfF?= =?us-ascii?Q?5NdIeIJQmdRF0VFLI5fnYJsYxRP8bFc0/kRg53lH3OPKi+JQAIVh14XjFP5m?= =?us-ascii?Q?27vHdVSuWZ4/hu0AOHreS+avrYKYZnFKGEpuYhQhk5Y1XhzEVgMWfO9kjupR?= =?us-ascii?Q?sTqswsN0iJh1cpIWxQKHzqdSycu3FPMNys0em0/Usn9TAz5XBFApSkspW/4A?= =?us-ascii?Q?3ugZ9kC4XYKItgE6AX5c0jPVlg7JK/LflPYtjRGKA8lSaEdttm1sdtM7vOqP?= =?us-ascii?Q?D4o0Sod+DAAghIN01BIfhS7BOwEN/rm5iZR245auRNCdTDiSUh1PJER4Z9St?= =?us-ascii?Q?d5JRo8tKG9ko2BXn6TjfKbEkj5DCBDKVIOeWsNKIuwpWkdCXDzk/cZ4/+cXT?= =?us-ascii?Q?IBsR9LQJT3Ru/VKSPzBugnHXul3wAT+upkqGJhzarTRM+0C8WEaTXHlEmXd2?= =?us-ascii?Q?o4CRakxz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GtkcqtcP9cjd4lsv97SksHZcywjuRS0cI?= =?us-ascii?Q?HDXCiq+FevwoRPZ+GjnAsNzlaxIaB3eF6p0nJHxAKFr4RxXj3Vud3eM2+WX1?= =?us-ascii?Q?wDzbBYgMUmd17qVKLadIdY0Xdc95wwq7grZwy1IXhG24t2+KX+10jQrVs7CT?= =?us-ascii?Q?yyrK/6hmV0oKYqzQ/9JoaWnvs5EZox1iALfKubeqheHW2wMNLYOgTHAb5I2K?= =?us-ascii?Q?TY6Y03WPG9kHB/slHTA5WcSdHLV4proAzuo7LfdsdAFUIqpXrq9kunf5WsVF?= =?us-ascii?Q?imAl2syH9o0bRKM3iclybWKUH14=3D?= 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-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 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); -- 2.30.2