Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp376517imu; Mon, 5 Nov 2018 02:21:07 -0800 (PST) X-Google-Smtp-Source: AJdET5fURsHBU+5eYWygBP7CUDqBECDCQkeRUl2ErEjFWlIkuLRb+jwt+CE68KstOPCY2QGop2Tn X-Received: by 2002:a63:9809:: with SMTP id q9mr19681015pgd.109.1541413266934; Mon, 05 Nov 2018 02:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541413266; cv=none; d=google.com; s=arc-20160816; b=EqjPzIb8Ba/xB5QQRqBXiJ+CXq32sUURhSY5uCD/IMbiDTkr1a3cNWhq1WRd4HU2LR u8u3y3GbWQSV5mb4DijGSmoBIRvTRhT6J0d7BlXOJCttSqaPPt30/Ts2eCk9vT6E5EHl AOG9qb6n3halyIQJFTb4GD9M2mj+1JsydiFvY/51IMzix9Ua+5+hVIVidwFeqHeyJMWm Ll11rZfTg7hTi0QLDtbrIZIUFu66cDaOBBecFkcqim1fLD95rsIIrSBTAj1jo2AI1D/h EEzbpJm6+rpRY3eV49SI+yNQ8mSuTa7Z+lTwMRzHrDagVNScVgXKE2a0tt4VacY4HpCH E4gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=5Ug3FTbfV5l8BL50vWTkpbs3UNTP/Xq+nUH3GSjRdAo=; b=pNduTn5EBq6k2lD0Pt40u3/BN/sJlMA+UYTD5+eZcPUdtG9rfc3tDGPsLx4tLx6XLW 57W1xTsCUYGyf+vCiQ0ZIAAFLmJhRIyknR6FMRsdPpdIIXCM/DQvn/jMTmVro3ZZuS6c c3EK+j5OtSGa7ljKg8Vox9YM4LUrSMeCYPiGAxn4C6UkPav2AT2/o2KS7xKRE0eVVbV3 +em4tVIgjZVjLWvQxVo9G9mOm6rjSOePpWpSkITSZeb2sISk29czC+DgMQGqnO+R66CQ aAnLOLllc0vvmWXcc8ozFswrU10KpyNU6LHob37VTkcNeK3er+jAH8qJ2DEqtwg0Vokb ncxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si36749856plx.310.2018.11.05.02.20.51; Mon, 05 Nov 2018 02:21:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbeKETj0 (ORCPT + 99 others); Mon, 5 Nov 2018 14:39:26 -0500 Received: from leonov.paulk.fr ([185.233.101.22]:47740 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbeKETjZ (ORCPT ); Mon, 5 Nov 2018 14:39:25 -0500 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 01974BFE1D; Mon, 5 Nov 2018 11:20:25 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 412FAC1062; Mon, 5 Nov 2018 11:20:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.1 Received: from collins (unknown [192.168.1.1]) by gagarine.paulk.fr (Postfix) with ESMTPSA id 73D0FC1050; Mon, 5 Nov 2018 11:20:18 +0100 (CET) Message-ID: <48d864c0da9200ff052ec0cc0879d7b00de23b7a.camel@paulk.fr> Subject: Re: [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup From: Paul Kocialkowski To: Maxime Ripard Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thierry Reding , David Airlie , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-sunxi@googlegroups.com Date: Mon, 05 Nov 2018 11:21:09 +0100 In-Reply-To: <20181105085927.tvg5vy3oyygw65z6@flea> References: <20181101200045.6078-1-contact@paulk.fr> <20181101200045.6078-2-contact@paulk.fr> <20181105085927.tvg5vy3oyygw65z6@flea> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-2RKZOHW4noP3lk/w0Veq" User-Agent: Evolution 3.30.2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-2RKZOHW4noP3lk/w0Veq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le lundi 05 novembre 2018 =C3=A0 09:59 +0100, Maxime Ripard a =C3=A9crit : > Hi, >=20 > On Thu, Nov 01, 2018 at 09:00:39PM +0100, Paul Kocialkowski wrote: > > Features such as dithering and pixel data edge configuration currently > > rely on the panel registered with the TCON driver. However, bridges are > > also supported in addition panels. > >=20 > > Instead of retrieving the connector from the panel, pass the encoder > > from the calling function, as is done for other interfaces. > >=20 > > The connector is then retrieved from the encoder with the dedicated > > helper. Even in the case of bridges, the connector is registered with > > the encoder from our driver and is accessible when iterating connectors= . > >=20 > > Signed-off-by: Paul Kocialkowski > > --- > > drivers/gpu/drm/sun4i/sun4i_tcon.c | 22 +++++++++------------- > > 1 file changed, 9 insertions(+), 13 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i= /sun4i_tcon.c > > index f949287d926c..262ffb6b0f82 100644 > > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > > @@ -478,8 +478,11 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i= _tcon *tcon, > > } > > =20 > > static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, > > + const struct drm_encoder *encoder, > > const struct drm_display_mode *mode) > > { > > + struct drm_connector *connector =3D sun4i_tcon_get_connector(encoder)= ; > > + struct drm_display_info display_info =3D connector->display_info; > > unsigned int bp, hsync, vsync; > > u8 clk_delay; > > u32 val =3D 0; > > @@ -491,8 +494,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_t= con *tcon, > > sun4i_tcon0_mode_set_common(tcon, mode); > > =20 > > /* Set dithering if needed */ > > - if (tcon->panel) > > - sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector); > > + sun4i_tcon0_mode_set_dithering(tcon, connector); > > =20 > > /* Adjust clock delay */ > > clk_delay =3D sun4i_tcon_get_clk_delay(mode, 0); > > @@ -556,17 +558,11 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i= _tcon *tcon, > > * Following code is a way to avoid quirks all around TCON > > * and DOTCLOCK drivers. > > */ > > - if (tcon->panel) { > > - struct drm_panel *panel =3D tcon->panel; > > - struct drm_connector *connector =3D panel->connector; > > - struct drm_display_info display_info =3D connector->display_info; > > - > > - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE) > > - clk_set_phase(tcon->dclk, 240); > > + if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE) > > + clk_set_phase(tcon->dclk, 240); > > =20 > > - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) > > - clk_set_phase(tcon->dclk, 0); > > - } > > + if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) > > + clk_set_phase(tcon->dclk, 0); >=20 > You're doing multiple things here: you're changing the function API, > and then moving the display info checks outside of the tcon->panel > condition. >=20 > You should do two separate patches for that. Thanks, I'll do that in the next revision then. Cheers, Paul --=20 Developer of free digital technology and hardware support. Website: https://www.paulk.fr/ Coding blog: https://code.paulk.fr/ Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/ --=-2RKZOHW4noP3lk/w0Veq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAlvgGZUACgkQhP3B6o/u lQz6Ug/+MWE2rvdL11jDYpl7QhEJUt3CXDbQ+ZDuHD5LMhqlpbj98RBkqIvs4cK2 P8Br2W/NfKcajvFd+AWLWhFdYW3JwuiXOLhpsc95zmVZQP+XD8ZC75HOLsOE9775 ZbVv8CYxrkvPJX3buVC65bpPglq/I1JpwWg+T7gxHPEFvK7L6OmZfsc7SgsIfqCa xeJedS8ueD0uO+829fMiqjuG6UzTur29eQ/8lXckR+pwnQxIiy39v0ox1eg6il6R xoNLcPe2xASxdYX/t56gH9DTpPvm4BzkYS5ESFc4Ax+7UMR91hg1gPjL7i/RvpF1 Ierb70p6Vlp77FaTOvbLTSVpggUg+9zVbP5yqW5FwEbR9oA6Y/jKQviMgxnHiUDv 8eOpXGwzMlF5zibP6HmZLY5PekT+AKBOS0jG6G17XKOytdbSXezNBdlqmLAhEgsm lbu+1qsu2cZizRrk9WL/HWxOm65HITjeeiV4NSW6JpClAMjjTkXYfRHowX4lQXWm jN2SkclHmAQPPxJgbozcahOQ+NsUgjT07BDce0+ES7qyQ+LURz4mSQS3H+iXOy2H wRrUiEGep25YFhYmd5OZM+ShIqkHlPjiXbmZkgg0uqpgdd5BzDW6PQtpriL3hCKc j8k4MGNiVB1b86ec+Y56d7Il9Jd/xKM/+1PvT+emBz5lHGdj0i8= =TYY3 -----END PGP SIGNATURE----- --=-2RKZOHW4noP3lk/w0Veq--