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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2680BC433F5 for ; Tue, 28 Sep 2021 12:20:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBB9860FF2 for ; Tue, 28 Sep 2021 12:20:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DBB9860FF2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A61586E51A; Tue, 28 Sep 2021 12:20:39 +0000 (UTC) Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id A81096E51A for ; Tue, 28 Sep 2021 12:20:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id AC75EFB03; Tue, 28 Sep 2021 14:20:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EggkIh7qLVK4; Tue, 28 Sep 2021 14:20:35 +0200 (CEST) Date: Tue, 28 Sep 2021 14:20:33 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Lucas Stach Cc: Marek Vasut , Stefan Agner , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Laurent Pinchart Subject: Re: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge Message-ID: References: <1fda3b80-7df2-2ce3-b049-6773e849e9dc@denx.de> <3ebcbc4dba56011ddf4761dc47513dbb66fe656d.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3ebcbc4dba56011ddf4761dc47513dbb66fe656d.camel@pengutronix.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, On Tue, Sep 28, 2021 at 11:27:49AM +0200, Lucas Stach wrote: > Am Dienstag, dem 28.09.2021 um 11:19 +0200 schrieb Guido Günther: > > Hi, > > On Tue, Sep 28, 2021 at 11:08:58AM +0200, Marek Vasut wrote: > > > On 9/28/21 10:55 AM, Guido Günther wrote: > > > > If a bridge doesn't do any bus format handling MEDIA_BUS_FMT_FIXED is > > > > returned. Fallback to a reasonable default (MEDIA_BUS_FMT_RGB888_1X24) in > > > > that case. > > > > > > > > This unbreaks e.g. using mxsfb with the nwl bridge and mipi panels. > > > > > > > > Fixes: b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present") > > > > > > > > Signed-off-by: Guido Günther > > > > --- > > > > > > > > I'll look at what needs to be done in nwl separately but this also > > > > unbreaks other bridge seupts that don't to format negotiation yet. > > > > > > > > drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c > > > > index af6c620adf6e..4ef94cf686b0 100644 > > > > --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c > > > > +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c > > > > @@ -369,6 +369,8 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, > > > > drm_atomic_get_new_bridge_state(state, > > > > mxsfb->bridge); > > > > bus_format = bridge_state->input_bus_cfg.format; > > > > + if (bus_format == MEDIA_BUS_FMT_FIXED) > > > > + bus_format = MEDIA_BUS_FMT_RGB888_1X24; > > > > > > Shouldn't the NWL bridge return the correct format ? > > > > Yes it should and I'll send a separate patch for that but we currently > > don't do anything meaningful at all if the bridge doesn't do format > > negotiation and then fail setup in mxsfb_set_formats(). > > > > I think we should at least preserve the status quo (as we do with the > > non bridge case in b776b0f00f24 too). > > > > We could have a warning to spot drivers that don't do that yet and hence > > the generic code returns MEDIA_BUS_FMT_FIXED. > > > That sounds sensible. Using a default format if we don't know what to > do is going to be a unpleasant surprise for those with a display > pipeline that doesn't work with the default format. So please add a > dev_warn when we are doing this fallback. > > Also I would argue that the NWL fix is the patch that should go in the > stable tree. This one should only be a additional safety net, so I > would drop the Fixes tag. Dropped and folded into the small series with other fixes needed to get get the bus format propagated up from the panel. Cheers, -- Guido > > Regards, > Lucas >