Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4816753imm; Mon, 14 May 2018 13:42:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqeicJoIJsVGHmiAI4xlKiY2KahBmeMOm/Beok7Opz8KMYPr083gy1EYzo37QFszUhx/zTR X-Received: by 2002:a17:902:164:: with SMTP id 91-v6mr11460619plb.134.1526330530058; Mon, 14 May 2018 13:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526330530; cv=none; d=google.com; s=arc-20160816; b=THsj90YUDUwZJR8lLbM4gNSK6PmAPsDVMzx4QCEsCPJ7jihRCFNZCNDOvzkv5qkooi Se4bCo22EWkl1wy7a8Cl3P+fl5ADNU7ZCa0JPWogYJAtVT7lo1lhyr7SyPIZWyuS1HG/ EfMlalc93CKy25pq1AdFSIfkfQ3dHirWVh4Q2xw6RJzpG+SAfq9t8uO8YunrDX4amqAI e9RWGpIut2WY4k70xUqPukbjQdBp6SamJGUM9lXpddgVFNJAzvvsRGCuQZYQy8iXPED7 rjtaYhzLaTZh4FfUCCj3RAf/8oM1WmVhbmgqMvbACGSxOZ3GmEmfxtUEOC0SK48jyWPL TZhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:arc-authentication-results; bh=iNnCf1hjgyFWgUtuIGfKd4pWsQVgfjePXgxIwdLZQhY=; b=dBlq9rEInJlJehhFaCaCq/NCUGQ4QCcw643e9pPOXKUSVCNyjC0LVMHBgHnCL9aCa5 U7QDiSz3Zht64nTFP3sF4gBx++y/ekLoStDIPkUBDduxzVhwW8IZxpYc+meZcidiHP1X Vh+uC9eelyqkxRU+Fddq8fmeOj9APgfOIGMwvebEdKAnCoa69oVFXBjokmRUvlWPejsd 2NDP62WXo+GeSrBDMum12+CTTxGktzT7ejY4UX/co92inBM+8QJyIDEAA6esjJDI/B75 sC081KE6eAhhvYlAsNg+kXrXorBkT/DWWHIItyZuFat/Stn0JH3HFg4PqdiOhe3Nu6RN 47Iw== 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 e11-v6si2467817pgf.469.2018.05.14.13.41.55; Mon, 14 May 2018 13:42:09 -0700 (PDT) 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 S1752057AbeENUkb (ORCPT + 99 others); Mon, 14 May 2018 16:40:31 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:43706 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbeENUka (ORCPT ); Mon, 14 May 2018 16:40:30 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 597DEBFC0A; Mon, 14 May 2018 22:40:28 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id C07BBC0D68; Mon, 14 May 2018 22:40:26 +0200 (CEST) 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 89281C0C56; Mon, 14 May 2018 22:40:16 +0200 (CEST) Message-ID: Subject: Re: [PATCH v4 1/3] drm/panel: Add RGB666 variant of Innolux AT070TN90 From: Paul Kocialkowski To: Maxime Ripard Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Rob Herring , Mark Rutland , Chen-Yu Tsai , Thierry Reding , David Airlie Date: Mon, 14 May 2018 22:40:15 +0200 In-Reply-To: <20180511085938.wjmdsdjfvdxd4shk@flea> References: <20180507220413.21990-1-contact@paulk.fr> <20180509071226.ivh4s3wtczg2u7zw@flea> <20180511085938.wjmdsdjfvdxd4shk@flea> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-viS6L8A31GZMGGCmnqJq" X-Mailer: Evolution 3.28.2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-viS6L8A31GZMGGCmnqJq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le vendredi 11 mai 2018 =C3=A0 10:59 +0200, Maxime Ripard a =C3=A9crit : > On Wed, May 09, 2018 at 01:31:23PM +0200, Paul Kocialkowski wrote: > > On Wed, 2018-05-09 at 09:12 +0200, Maxime Ripard wrote: > > > On Tue, May 08, 2018 at 12:04:11AM +0200, Paul Kocialkowski wrote: > > > > This adds timings for the RGB666 variant of the Innolux AT070TN90 p= anel, > > > > as found on the Ainol AW1 tablet. > > > >=20 > > > > The panel also supports RGB888 output. When RGB666 mode is used ins= tead, > > > > the two extra lanes per component are grounded. > > > >=20 > > > > In the future, it might become necessary to introduce a dedicated > > > > device-tree property to specify the bus format to use instead of th= e > > > > default one for the panel. This will allow supporting different bus > > > > formats for the same panel modes. > > > >=20 > > > > Signed-off-by: Paul Kocialkowski > > > > --- > > > > drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++= ++ > > > > 1 file changed, 26 insertions(+) > > > >=20 > > > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm= /panel/panel-simple.c > > > > index cbf1ab404ee7..32e30d5a8f08 100644 > > > > --- a/drivers/gpu/drm/panel/panel-simple.c > > > > +++ b/drivers/gpu/drm/panel/panel-simple.c > > > > @@ -1063,6 +1063,29 @@ static const struct panel_desc innolux_at043= tn24 =3D { > > > > .bus_flags =3D DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDG= E, > > > > }; > > > > =20 > > > > +static const struct drm_display_mode innolux_at070tn90_mode =3D { > > > > + .clock =3D 40000, > > > > + .hdisplay =3D 800, > > > > + .hsync_start =3D 800 + 112, > > > > + .hsync_end =3D 800 + 112 + 1, > > > > + .htotal =3D 800 + 112 + 1 + 87, > > > > + .vdisplay =3D 480, > > > > + .vsync_start =3D 480 + 141, > > > > + .vsync_end =3D 480 + 141 + 1, > > > > + .vtotal =3D 480 + 141 + 1 + 38, > > > > + .vrefresh =3D 60, > > > > +}; > > > > + > > > > +static const struct panel_desc innolux_at070tn90 =3D { > > > > + .modes =3D &innolux_at070tn90_mode, > > > > + .num_modes =3D 1, > > > > + .size =3D { > > > > + .width =3D 154, > > > > + .height =3D 86, > > > > + }, > > > > + .bus_format =3D MEDIA_BUS_FMT_RGB666_1X18, > > > > +}; > > > > + > > >=20 > > > I'm not really convinced this is the right approach. You said it > > > yourself, the panel is using a 24-bits interface, and you just happen > > > to have a tablet that routed it using a 18-bits interface instead. > > >=20 > > > That doesn't belong in the driver, especially associated to the > > > compatible, but where the routing is described: in the device > > > tree. And given that the panel interface is a 24 bits panel, if we > > > were to have a default, we should have this one, and not the one > > > fitting your use case. > >=20 > > I fully agree, this is why I suggested introducing a dedicated dt > > property for selecting the bus format (in the commit message). I still > > proposed this patch as a temporary solution, but I'm definitely willing > > to craft a proper solution as well. > >=20 > > Here is an initial proposition: > > 1. Making bus_format an array in struct panel_desc and listing all the > > relevant bus formats that the panel can support there; >=20 > I'm not sure this is needed, the input format is always the same in > your case, the panel will always take a 24 bits RGB value. What you > want to change is the encoder output format (and I guess you want that > to be meaningful to enable or not the dithering). Isn't the panel format supposed to match what the encoder's output should be aiming for? In my case, that would be RGB666, so the idea would be specifying both MEDIA_BUS_FMT_RGB666_1X18 and MEDIA_BUS_FMT_RGB888_1X24 in a list of supported bus formats for the panel. This way, both my setup and RGB888 setups can be supported. > > 2. Introducing an optional "bus-format" dt property that indicates whic= h > > bus format to use, and using the first index of the bus formats array i= f > > the property is not present; >=20 > I guess the width would be enough, and that way we can take the > bus-width format that is already defined (but used in the v4l2 > framework, not in DRM yet). Well, we already have bus-format defines on the DRM side and it feels like mapping these directly in device-tree would be more useful as a description of the hardware than just having the bus width. 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/ --=-viS6L8A31GZMGGCmnqJq 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/ulQwFAlr59C8ACgkQhP3B6o/u lQw8rA/+O1nbscogyRVKWs96j8i+PkNZYCFqCTiffAvqmsTA5uIVMgEZnePoGEJn 3QQ+aBMcsNku7CeQSx3pnfjD87is4g1f/XCMHrtS1Q3R4zb6W9hUS5KqLxSClPd2 ehqOh9lgueEpYrvy2tvO2RE1J9kOIlvsexfdainyfXUrpeGLenTPMJ/81gtJIH2t zoo7FKlNvwrv4POEivip/CpvK3GuzZRZ3VVXNOcjWjjyjlL698RRCSagclwwxpI4 k3EvEOS9CoV7lK69eXWqMTKAqn/WtTv8o4oJWxaGf83nafI0Sp8SQhDjmuuK/QLZ eNfELyCB2rn543qAEjUV2oyjMF9MMHts+B3hbMnBHdZbDl5e19pe8wvPQlX8cjXa ZZPcHgjVyzsVGyFUsodbPcMpZ8zCzzgHHVwlWtbg0NZWhqp6giSLwsWElYgY2uli aqvOjEYZKyl7YKT47Y0qGK2zVd7t0TmVFp6Szin/pYcFo8rh6KLJdQZeBO9k3t7n VWCyTmVMNHdL1eGTo+zTVtDFmX5UMEv4Muj54Ma3I5NkPYtc2criVExADk19bqRX O6JkEsDKxNNEDHm2F8UjYg8zVyOUYL220dtRTQvUxuU8Bwpe77gfCSoVfM0hm9Vi LnQEwRW28SmheCaxeR2yX1/NZFvOAXPypuvVlacS+HIVXIwi30A= =q9Ob -----END PGP SIGNATURE----- --=-viS6L8A31GZMGGCmnqJq--