Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4838644pxb; Tue, 28 Sep 2021 05:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEP7JqyiOSCtoW2qF8Oo9oUVRchQuFvOVeBo7aDz2/+bBQppXX1CGvTca1FIKlI9KXPHb5 X-Received: by 2002:a50:8147:: with SMTP id 65mr4196079edc.60.1632831800447; Tue, 28 Sep 2021 05:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632831800; cv=none; d=google.com; s=arc-20160816; b=zZxYqShB34jMcVOKKoqEijlWCA0bIGMtJLIPA0T57nHTKO5+a8/TDxUPqkvXNg0c5n CBEFuXM2+Xa9ug3G1++7h+ukngN2qKGlv5lZMw8ucuSTOrTvJEc71668ZjZd1nLaneyV BV/yl/9fJmhbYfMAu80KYJgP0ScCUg0w4d7mqYG6RJcYDnmqUv+ykTtQhlJd92ZW2T4u 3nLFpXhi98mf78kPGc3qPSeLb1ntPRunG7Z5vw++Fr02UDpfYaFNFKtF83pTmJMg646f l2HUhPxnAOMuchTU40qKKDZvs6rhX9IDmibxNiISE6xkdaqSy8yxT34cL8A1sG/IHer+ Kamg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ppKmFVtyCNeB/DYHNfkdZsaw+4cBnncmBywSXWrchZA=; b=e3Qox7mrGJhkGKSO9lNVZNvPJj8Yi7ls3rjqolq18PYi9rsViO4+EM66HCmlFQuN0w sh55J72NSttxc33xmAOjYInBDdF8VQUhvoqpi3bSDXjzb503hNhiwPD232aLnT3/hzCM hogtxrk3sn0caue8sLFXSaI5aCtZrR4b1LxQbmFmodiaWI3MQpfWaMMBhUCD9lJfLDD4 ER3/owxC8h+MYTxHMdEe+NPC1nYMViXH5jdf++yfhkYaO9cH6/8RskRm8vndBzbsnyGU 8oJj9OvI1YwtsUljeIBrZmzSFBZvJDj1S1duEtKg/42atKJckOs9uRBfQBKoKvxrZhc6 1Rbw== 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 27si21065510ejr.209.2021.09.28.05.22.54; Tue, 28 Sep 2021 05:23:20 -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 S240685AbhI1MWT (ORCPT + 99 others); Tue, 28 Sep 2021 08:22:19 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:46470 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240622AbhI1MWR (ORCPT ); Tue, 28 Sep 2021 08:22:17 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >