From mboxrd@z Thu Jan 1 00:00:00 1970 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 03911C433F5 for ; Sat, 19 Feb 2022 09:39:47 +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:In-Reply-To:References: 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=qslkF6o0WP54anm/a/xzgyZKsEfswwjZATxcCcI67a0=; b=KC/d8E1UEJZOq1 17LtDtsdzDeIKoKgS2cOFw310FS2EakJ+dzIgjfrgUva+7/ZsBje6fL0KJtk6+ISl2SLy1staOys3 koybQPyFtfcr0HKAICXHxC1Z7m9XeZ3hu+4vAa78Tz44YUCTzhM7oancZQyM1vduOkLAfH3sn0h5d ol/4xGlwAg7xBQOWnZFYsIGr8K/RVXNMOsUum+y5weow18FHgsB3OEJDVeneMUK757S7V1SIPk06w vrVUOvl7BYKME6kIlA27DvUlmWmy9pITgh0wZEijH+tlYbnBkLwHdoqr5MSOrSCgFzj7Seqmg39K9 IMs/8u1pb+R4NsKMspGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLMCA-00GZv4-LU; Sat, 19 Feb 2022 09:38:26 +0000 Received: from mx3.securetransport.de ([2a01:4f8:c0c:92be::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLMC5-00GZtY-V0 for linux-arm-kernel@lists.infradead.org; Sat, 19 Feb 2022 09:38:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1645263454; bh=98e1PeD2+rMslalShlJN5uSaFcu4ASGkueNqRizTG2g=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=xIMxD9uPxfYA2JFKXELGSvBVRYHKvKGplUozB701M+OrlU0+m2x7YhcI+UpxmnUCe RWYqygb9Lu/WQFKolYOem55Vx3iY5qhj2u3BTA2ARJ9ser1u/XpUIwQOlj1HAgWrJ/ Rx1iFSfG1ZyVox65eBoLUXjvELlCbpOpJGJ+54qgApCj9oCgJFuKhX3P0CYE+naUEo LFsU2J3PUlhNXF9i48ewxEonWy0agQ+Ca2Ovt4DdCUDB2Rj++RQKmQTkhq9CpIx/UZ yCb8u9yFe3pIA2sRd9wuoPIHj0nhoOt8ZkCQjKclpHVxXyqkcjkUIh0N0ZSKzvtnKZ ss2fuD1fHefkw== X-secureTransport-forwarded: yes From: Christoph Niedermaier Complaints-To: abuse@cubewerk.de To: Laurent Pinchart CC: "dri-devel@lists.freedesktop.org" , "Sam Ravnborg" , Maxime Ripard , "Philipp Zabel" , David Airlie , "Daniel Vetter" , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , "linux-arm-kernel@lists.infradead.org" , DenysDrozdov , Max Krummenacher , "Marek MV. Vasut" Subject: RE: [RFC][PATCH] Revert "drm/panel-simple: drop use of data-mapping property" Thread-Topic: [RFC][PATCH] Revert "drm/panel-simple: drop use of data-mapping property" Thread-Index: AQHYF1wNP59QmGTIpEaZdSyAMfHN4ayA3pOAgAkEMsCAAGuFAIAA4AmAgA+JyJA= Date: Sat, 19 Feb 2022 09:37:28 +0000 Message-ID: References: <20220201110717.3585-1-cniedermaier@dh-electronics.com> <4a2f4707c03d4509aa5f3a388cbfbe04@dh-electronics.com> <78357e75dede2a7bff95126ff35784929335e918.camel@gmail.com> In-Reply-To: <78357e75dede2a7bff95126ff35784929335e918.camel@gmail.com> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220219_013822_406223_6E648A42 X-CRM114-Status: GOOD ( 51.62 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Max Krummenacher [mailto:max.oss.09@gmail.com] Sent: Wednesday, February 9, 2022 2:14 PM > > Hi > > Am Mittwoch, den 09.02.2022, 00:52 +0100 schrieb Marek Vasut: > > On 2/8/22 22:27, Christoph Niedermaier wrote: > > > From: Laurent Pinchart [mailto:laurent.pinchart@ideasonboard.com] > > > Sent: Thursday, February 3, 2022 12:46 AM > > > > Hi Christoph, > > > > > > > > > > Hi Laurent, > > > > > > > On Tue, Feb 01, 2022 at 12:07:17PM +0100, Christoph Niedermaier wrote: > > > > > Without the data-mapping devicetree property my display won't > > > > > work properly. It is flickering, because the bus flags won't > > > > > be assigned without a defined bus format by the imx parallel > > > > > display driver. There was a discussion about the removal [1] > > > > > and an agreement that a better solution is needed, but it is > > > > > missing so far. So what would be the better approach? > > > > > > > > > > [1] https://patchwork.freedesktop.org/patch/357659/?series=74705&rev=1 > > > > > > > > > > This reverts commit d021d751c14752a0266865700f6f212fab40a18c. > > > > > > > > > > Signed-off-by: Christoph Niedermaier > > > > > Cc: Marek Vasut > > > > > Cc: Sam Ravnborg > > > > > Cc: Laurent Pinchart > > > > > Cc: Maxime Ripard > > > > > Cc: Philipp Zabel > > > > > Cc: David Airlie > > > > > Cc: Daniel Vetter > > > > > Cc: Shawn Guo > > > > > Cc: Sascha Hauer > > > > > Cc: Pengutronix Kernel Team > > > > > Cc: Fabio Estevam > > > > > Cc: NXP Linux Team > > > > > Cc: linux-arm-kernel@lists.infradead.org > > > > > To: dri-devel@lists.freedesktop.org > > > > > --- > > > > > drivers/gpu/drm/panel/panel-simple.c | 11 +++++++++++ > > > > > 1 file changed, 11 insertions(+) > > > > > > > > > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c > > > > > index 3c08f9827acf..2c683d94a3f3 100644 > > > > > --- a/drivers/gpu/drm/panel/panel-simple.c > > > > > +++ b/drivers/gpu/drm/panel/panel-simple.c > > > > > @@ -453,6 +453,7 @@ static int panel_dpi_probe(struct device *dev, > > > > > struct panel_desc *desc; > > > > > unsigned int bus_flags; > > > > > struct videomode vm; > > > > > + const char *mapping; > > > > > int ret; > > > > > > > > > > np = dev->of_node; > > > > > @@ -477,6 +478,16 @@ static int panel_dpi_probe(struct device *dev, > > > > > of_property_read_u32(np, "width-mm", &desc->size.width); > > > > > of_property_read_u32(np, "height-mm", &desc->size.height); > > > > > > > > > > + of_property_read_string(np, "data-mapping", &mapping); > > > > > + if (!strcmp(mapping, "rgb24")) > > > > > + desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24; > > > > > + else if (!strcmp(mapping, "rgb565")) > > > > > + desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16; > > > > > + else if (!strcmp(mapping, "bgr666")) > > > > > + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18; > > > > > + else if (!strcmp(mapping, "lvds666")) > > > > > + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; > > > > > > > > You're right that there's an issue, but a revert isn't the right option. > > > > The commit you're reverting never made it in a stable release, because > > > > it was deemed to not be a good enough option. > > > > > > > > First of all, any attempt to fix this should include an update to the DT > > > > binding. Second, as this is about DPI panels, the LVDS option should be > > > > dropped. Finally, I've shared some initial thoughts in [1], maybe you > > > > can reply to that e-mail to continue the discussion there ? > > > > > > According to your thoughts in [1] you mean that the bus format should be > > > build out of the devicetree properties bus-width and data-shift. It would > > > be possible for evenly structured busses like RGB888_1X24 and RGB666_1X18, > > > but what about a bus like RGB565_1X16, where each color has different > > > bus width. Also the order of the colors should be defined to differ > > > between busses like RGB888_1X24 and GBR888_1X24. > > > Are there any ideas how can this be covered? > > > > Maybe with props like these ? > > > > channel-width -- width of each color channel > > channel-shift -- shift of each color channel > > channel-map -- mapping of each color channel > > > > So for RGB888 > > channel-width = <8 8 8>; > > channel-shift = <0 0 0>; > > channel-map = "RGB"; // or something ? > > > > For BGR565 panel connected to RGB24 scanout > > channel-width = <5 6 5>; > > channel-shift = <3 2 3>; > > channel-map = "BGR"; // or something ? > > > > For BGR565 panel connected to RGB565 scanout > > channel-width = <5 6 5>; > > channel-shift = <0 0 0>; > > channel-map = "BGR"; // or something ? > > > > To me this looks like it goes into the wrong direction. > The goal is to set bus_format to one of the > possible enum values. > Using such a generic approach it would be possible to request bus > formats for which no enum value is currently defined, i.e. the > BGR565 example does not have a matching bus_format in > media-bus-format.h. > > What about keeping the solution which the revert would give. > Optionally with a changed property name s/data-mapping/bus-format/ > and a changed list of allowed strings to better match between the > dt string and the enum name, i.e. s/"rgb24"/"RGB888_1X24"/. > This would allow to extend DT binding and > code to possible newly > required values like e.g. MEDIA_BUS_FMT_BGR888_1X24. > > Alternatively one could use the bus-width and data-shift > properties and allow for (bus-width + data-shift) to be one > of 16, 18, 24 and assume RGB. I.e. one could only specify > MEDIA_BUS_FMT_RGB565_1X16, MEDIA_BUS_FMT_RGB666_1X18, > MEDIA_BUS_FMT_RGB888_1X24 respectively. > > Max > Hi Laurent, In which direction should it go to find an acceptable solution? Regards Christoph _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel