From patchwork Tue Jan 24 05:47:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13113542 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 3BDCAC38142 for ; Tue, 24 Jan 2023 05:50:28 +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=t4t9kb8gw3hyBEupz97BGi3/zHlvwZP1YsF3dNazE8E=; b=Q1Lq6CgxYxm4C+ qw4iMcM/enS/qJbzhRcpeQDceut+wL7de0DjhCk8Wr3s3HybRDPPagQt8e5hWVOWy24cGulI/VrnL ublUapH/Kkij654H9MJCoHXCOHjlPEVrzDAGqK1wfnOrHHymhS2DZnxwF+2WRmwbGeTi4TjB6oDc/ HFOvEBQzHg/S7u4rjlURWuJCy3wnctx6BnSUkXHxCojJBz+/OclP8NKJjwmAvcM09/E8H8F8MQess FznEpxw2FL9xXkJ10E0aVJ0VMY9AXFLFBBg+bYRj3ZLiJ9hWuGHeevwvInStPvAeHEe0aTP8AOE7Q 4H/fLFC4tM5rkIewkq7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKCB9-002QGN-3h; Tue, 24 Jan 2023 05:49:07 +0000 Received: from mail-vi1eur02on2053.outbound.protection.outlook.com ([40.107.241.53] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKC9Y-002PTL-Ry; Tue, 24 Jan 2023 05:47:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oj9R+/IMgFsQkMokuOT5VWFxM2HmGiXDZP/hRb4AjEUzBh2nIMzj35szg7aYI3z1HsWrsTHjJCfbeuvktf7H/sH8UZvnWSCwTCpJ9/pxVyjzjrbMkKYijd3BFfuftOj81r2dIfKgq5yboN7Z0TZ0QWzOhhfy8w7JVzDAqtC8K1Wr+R6JjzNphDGQ2rJgUcpYagQNlXsiMAsz5TZeDTe5ugSLmuZRXsO/d64J+sG5Hi6RGRKzjSVNFU8TYw3emGotZBJZVhAxY+R78J8HdVQhqGNPsKBAHVEHdDT0ZsQ2HwY/aZct/FBbHYGuZ8aTpmJXwpEUHznS+VdbfOKta61pyw== 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=g4qMVJMpLkSgyH995ws7aK1P48Io+P7fDQjJHTGRi6Q=; b=CDdywWMr+3adI3RsbO4w64RwF/fa9FHs2I1ObGgYcvT67cLGiKmFq2XcRafTFMGgI9zgbY1x8FW+Ru/J+Q/38bCyYUTZmyFUaASzYn/UAIC2EJZd3m6FyHzqCn8wLUAw3Y6DEW3t7Qvcn337yn0t/AlCayeE8iiVBA7gMQkcPihCFA2qZPGKKOHMgFYteeg06RzeM1DJTi8TowCUVJF7IQ3U8ku0ew4OQ0iGJj+Q5nI2/Z8nA9jGTZMGYC3Skm8pkb7UTq5DArYtyEFCXYeH+ApNw1EKM8kstidoCWGzCncBLKIhw4PmEAbNo7bLsAwZPfaHYR1fWSXewFgSECQDfA== 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=g4qMVJMpLkSgyH995ws7aK1P48Io+P7fDQjJHTGRi6Q=; b=m7TrbJ/WEfPajxPzISYIGUv8gq2d8ZPewhMnanCDTFIKnYgLqCRj50lcS5Z+b76wIOIhXzQIDOCc1CpdOJ0XjXL9Ctt/+KSKMCv+76jmkPlxnFByD4sBD+W1zNwcGZVRubM4zKdftdf816MK6YxeVnNxMWXh83b3XkNb9zffNPc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by VE1PR08MB5678.eurprd08.prod.outlook.com (2603:10a6:800:1a0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 05:47:19 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4718:6092:e763:4219]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4718:6092:e763:4219%2]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 05:47:19 +0000 From: Michael Riesch To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Sandy Huang , David Airlie , Daniel Vetter , Sascha Hauer , Michael Riesch Subject: [PATCH v3 2/6] drm/rockchip: rgb: embed drm_encoder into rockchip_encoder Date: Tue, 24 Jan 2023 06:47:02 +0100 Message-Id: <20230124054706.3921383-3-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230124054706.3921383-1-michael.riesch@wolfvision.net> References: <20230124054706.3921383-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: ZR0P278CA0189.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::6) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|VE1PR08MB5678:EE_ X-MS-Office365-Filtering-Correlation-Id: 249d5dcc-f139-4d4e-9e49-08dafdce751b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o5DGNMhGTMxoKtDV9IaqJv+MXGbosHjP8VMEZqkCb1UG2APAYwCWauKwQtsd/8izKnQTdOYfI35dgjw0R1/uYCAKbalXM5nqB1ZfKQinBpovGu+5NBiezhtaMVf4KhyqpD72mI2WncKF2FfX2iwBZk0OSKMyM0RSQZh4/kNjYL/BxxfTX8GjI3cfBUPCuGPBU1bEIUoGrT6zffgUWwCuFS1UjvD312lqn1FMox/r2eA0ReqPP4L6ITm682FzB6AVpJZFm6E1i9+fcYxhLRGy9SC8OlE4LiHYLbdu35HOJRlCMW7ezeUpZ/TQWhrz4K6vXbFqk4P6+9S4x8IVIIQdP58SPAjWnBgOAWs/YQxDsiwcs0BD+yaAolvpSf6kaXGsByiKUh0mws19JTNapJ9m/XxRvM4UHXB4rfVAiu5wBKdUQuvKo4T9z4akYriZjFwNVOf+X1zvLcYK65dH3zso3gl6YgL3sQrAhrM0oyye2H5HvSfgXMX+btclUtM4gT1+QYfgdE3c/uDbwWcDOHo2FTvnYYcmA87fQ8OUmekAnGbwwuvww+rqxv/tJXrHFdgXDWHBSe+6iezJdLqiwx2B8MivtMRps6xiACeheBhTMENsnCWcJMnspVb5jGSUE11uG48S+mo5BqbBrB8dZo69wA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(39840400004)(396003)(376002)(136003)(346002)(451199015)(1076003)(66946007)(4326008)(8676002)(66476007)(6486002)(66556008)(52116002)(2616005)(6512007)(107886003)(6666004)(44832011)(186003)(5660300002)(8936002)(7416002)(41300700001)(83380400001)(2906002)(6506007)(38100700002)(54906003)(316002)(86362001)(478600001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RUACdaCjjtIgFtCuZi2LYLtWHSEiCMRH0DLytJA/AudecYtw3guGIzWiDnTybMJ0pSSJOWv1g4Wwd7keoYeVYRvYbgW/kJA1VnfddN3dCxY9uObtWcOe1YHatr8iiGBAf8Cx7WcWX58Hl5iTA8LekxZxC+RbtCnT4P5oO8GWI/5OsqaVf7E690ZA4Xb5duYFLPSDlkvh+X1WIP55CCcc9Ib0N0WKyaIEmhEt+/Fr96ecA3F6+BGV6DNy6QBzipAej77L1BgdPgrLBx8RYD8TpJp3K8IW9BU2baEwzX3G3izjUvxWziVmZ163Z3oh/ktq4Omt6TYsjwt+EG8Qby4VEbKjIMBKhdrENGSZ/N8DPr57jejPeEBO/P1ppPnGo6bYBWFYvfyd3vBkLNwA9ddS30qCAOqR3fryPLw85AoYm09Ny8J+ZUE/fza+T9qcAaUs3V+lJgnmAo2O5iVlWcP5Df978s7SExbZY4kp8JLsv7t16VQRpJaCQ0MGlB1AMbA950u18cfZLXpoWVnBd29O3aCDpXi03pNZVQFhByUwUpIWiMgw/nZ0X9J+GL80Yqi8CHyRbRwk8zkrSLGk76gzVJQAG4OjUURKj6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= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 249d5dcc-f139-4d4e-9e49-08dafdce751b X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 05:47:19.7118 (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: 0BNdxMBa44CZ/QBLpgEcb/Ll5GDy4ObLg36pvsPnJa2wNsuIeic0bYMHrreSRjcaLn12hznx/StH62S25OB8nsB7rDLPdftj/Mo6rQinuX4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5678 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_214728_961146_A58EBDC5 X-CRM114-Status: GOOD ( 15.53 ) 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 --- v3: - no changes 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);