Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp380043rwb; Tue, 6 Dec 2022 23:02:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5nXraQrCZjEtnPzcKPsOProH68qrGcCMg68VDDp7h0Q3HpiVCrTqLJS1lI2E0AUAcSp84R X-Received: by 2002:a63:b54:0:b0:434:911a:301 with SMTP id a20-20020a630b54000000b00434911a0301mr66152986pgl.50.1670396557312; Tue, 06 Dec 2022 23:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670396557; cv=none; d=google.com; s=arc-20160816; b=ICEI9QbEEmaa2I8mN8ztbcxeZNT21hMKs/1FHziffEMVAETRhwbIN+yYMNC6UkIKEq s7wciDEXuTrCB/7RP4EXxQ/Fink+MzFtIvNuxyex6RPQE/FthR1tBtH/USDvZgsFS40U UoYa98rZ1Jk0IkR4hVqBq3wfEgclJs6rb5zIUPLBuH5lgckqVl3R1Fr2FN+gdskXjwto KhA1EjfSMyLGvJUDYX3rEekg6eg7SEUC4ptjYyvXx/apWfsa6hIyZh/6kQpsSSreiAV2 RUyCnJ7vzk4NspU7kh5lqhjuRkXyBShVDk0bjv4Tqds97CUtf2JH2woKxalm7Prcn12L wN1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KTUawkm6zhcOXcPUQU3I/5AZhmfBzDSLigCKgpbmp+U=; b=N3DlxTChwTI+7inRZ4vVEXDOKq0tBP0FVCfhCeWTxCAgK7bwpVrffZ4gCxXeNXnwrO AWqVlRIcDPVMjafz69EkDfqFIi5XJN2JN2Jsc0TnfR1WzTF4HKOVnomA5Q1Rk93rpN7C JwfXIHM67kc0st8pUbv/hlhZZUR8BtvYAkZhUnegeBrHowBHkx5Xpb5q0HZ//M083klu 0R1qp81WX7Fbna8OQD7Ynzo5UhyvOXQDELQ5q1cYx19aZvX//867UdqXAmjuzqh7+kwW bi7b1/a0qICgHbbBGNAkH9ByCIOaKqlRj8wJztsJ0SlD3lwaseerBvlc276oeu7Phj8J lLCw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a17090300cc00b00189906d63bdsi16842471plc.7.2022.12.06.23.02.20; Tue, 06 Dec 2022 23:02:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbiLGGpt (ORCPT + 76 others); Wed, 7 Dec 2022 01:45:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbiLGGpn (ORCPT ); Wed, 7 Dec 2022 01:45:43 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162672A723 for ; Tue, 6 Dec 2022 22:45:42 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2oBE-0006IE-Kn; Wed, 07 Dec 2022 07:45:20 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p2oB1-0008S8-Sx; Wed, 07 Dec 2022 07:45:07 +0100 Date: Wed, 7 Dec 2022 07:45:07 +0100 From: Sascha Hauer To: Michael Riesch Cc: 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, Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Sandy Huang , David Airlie , Daniel Vetter Subject: Re: [PATCH 1/5] drm/rockchip: rgb: embed drm_encoder into rockchip_encoder Message-ID: <20221207064507.GV29728@pengutronix.de> References: <20221130140217.3196414-1-michael.riesch@wolfvision.net> <20221130140217.3196414-2-michael.riesch@wolfvision.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221130140217.3196414-2-michael.riesch@wolfvision.net> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Wed, Nov 30, 2022 at 03:02:13PM +0100, Michael Riesch wrote: > 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 > --- > drivers/gpu/drm/rockchip/rockchip_rgb.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c > index 75eb7cca3d82..16201a5cf1e8 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c > +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c > @@ -18,17 +18,17 @@ > #include > #include > > +#include > + > #include "rockchip_drm_drv.h" > #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 +125,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 +161,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, > goto err_free_encoder; > } > > + rgb->encoder.crtc_endpoint_id = ROCKCHIP_VOP2_EP_RGB0; This is vop2 specific. This code is used with the vop1 as well, so it doesn't look like it belongs here, at least not hidden in a patch titled "embed drm_encoder into rockchip_encoder". Normally the crtc_endpoint_id is set by the encoder, coming from the encoder node, asking the question "To which port on the VOP am I connected to?" Here the situation is different. We are called from the VOP and the question instead is: "Is there something connected to VPx endpoint id ROCKCHIP_VOP2_EP_RGB0?" You might need a vop2 specific entry to this code. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |