Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4718889pxb; Tue, 28 Sep 2021 02:29:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNqoJoK6q4lBSS83IxfnZbrw2jgPSpZ9/HZ9T7LKGzIvB5WmZjXyTUraH9WMBYewjVIBA8 X-Received: by 2002:a63:7447:: with SMTP id e7mr3699947pgn.240.1632821358401; Tue, 28 Sep 2021 02:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632821358; cv=none; d=google.com; s=arc-20160816; b=acVCbyxLIHbjOvTOpwriAt26EvOkyv8JADJN8RVuwjzpFbRxxkS65/pTaG4UJezQyj bVhM+2EvXBxqEUXkNc8985vs0QQ0/Lij3Mz3J44dCE3LPX+U7hh5jwwLL1Qn6RYEiBfc 6Za5xwf72LMGCEug+eVmMmYbE27Z08ltJR+P5si60wO2LztXC+v9z3TiGSE9itdpfx++ 49L3waC6taBZTSlbX5ahlRpC8v9N2ld7JQASdRwY6NR2kOymE/jzEYPZ+NJVmu2jgMQ8 AoxfL0mRxlKcsxB8Rxn7eMeHNW99Y8ljpMvGGds+lOdUlAt77ebpdYYpX8P6LvShsQ9u yYQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=dbkJPTvyqfbbsJRY5HeRn0yfu/a7u6dutcLe8jNJroE=; b=dP+wtiUuhouncu36DOFmq9ZkBDcj2Dpbld99lmbJiBEzwM+KBNP1m3EYRVwGBWgJGQ OnMNr/BQfaQdMosIKfpFiGOnh3DzZqgc0bLG9g2PkvVmFpOKwZ1ql5om/yQiret/O9J5 etByL+dhXuhQ9i3IZpJyU75I7KpOQqape0zJjSp87LAxTBPwGBga20NflSpYnGQMlddU 12W4EKpwuxz87kNHHf91tXenolhYozS2LjZWrLXItub1BpTbGDUByMFQEwMjBDSEwKRS CPH7bZzI65EwAaAbB1dLiUVZZ2FXXpaKv72nzttln7zbao1pzBIr0w4LyKxEAwoILejy HK0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si2736947pjg.152.2021.09.28.02.29.01; Tue, 28 Sep 2021 02:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239872AbhI1J3l (ORCPT + 99 others); Tue, 28 Sep 2021 05:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239826AbhI1J3k (ORCPT ); Tue, 28 Sep 2021 05:29:40 -0400 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 B156DC061575 for ; Tue, 28 Sep 2021 02:28:01 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mV9Oz-0008Nk-NY; Tue, 28 Sep 2021 11:27:53 +0200 Message-ID: <3ebcbc4dba56011ddf4761dc47513dbb66fe656d.camel@pengutronix.de> Subject: Re: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge From: Lucas Stach To: Guido =?ISO-8859-1?Q?G=FCnther?= , Marek Vasut Cc: 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 Date: Tue, 28 Sep 2021 11:27:49 +0200 In-Reply-To: References: <1fda3b80-7df2-2ce3-b049-6773e849e9dc@denx.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Lucas