Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4715370pxb; Tue, 28 Sep 2021 02:23:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvHHA3JKHOeh2PIWwsx++Yra58mRHn6s57Khtb+OEWUbpMAT9UxsYIhLVSSH087tD5JOwi X-Received: by 2002:a63:2bc3:: with SMTP id r186mr3615808pgr.385.1632820997524; Tue, 28 Sep 2021 02:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632820997; cv=none; d=google.com; s=arc-20160816; b=bAnS0qVo0XSdrlfsAWeqACiD6Q/kJQBgltdGei2ObNgFSPHzI5b5TEgFcnPFf4/tm4 P8JB+FI1w0+go3mcB2zOePO+tzsJsF8CmCJgubriK9ruTbBFblP8uVCbRX/55zA0QXRN nUmjWI5k9XJm0GziaY0WURIKeqj7UeupMGQEjbOzR3I0Tkhe+YSHKqhOzgJ7hnv6wO+r OhHkfyiXTvd4Ph6brmn7rt9QVlV1AVPq5/0xtrfZXfu0GZGBC1usT4hdQjbkzoc/+iUc KNgCQVtLVxu3JVdlL2SShRcH7EN7LszbDeso/Krsr8xY9gqRm+d6Aljyyi+xhj4P/cVb 85hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=G/OYKSqftn2mFkL3esf6uhqBFkyVI4qhxKkblOBZuSY=; b=Jt4ZY0Vi1YvvxhIL58X5ZqACwLGZ5RMAb3YIZV8Nsj5pyb8HmsheO8UB1ciCNIkMmv k/kbJEv/P+PvUcfCxHr/MoU36tNKoxl5G9159EiNHeS1kChh+MwCUJ8vF7M+3WUIsE2a ML0qHTQnEGiIG9nRuNuCCwPdW/9kEJ13umiFLMCts3F9czMu19f9Yjp5I8PuaXAJ2Nr7 /EfS074pP6spQ5ae+1tTrMtCEm1rETj0UaeRkWIqYT22bDO6f5X8/tRZXEGA/xY366PY 9IEIpIPKBTOETy8yQ7YgmSEnXtu4biQAIdVBitEIEdaPtRPzJtsBmp7xF+/lGxJgjUKZ ysuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=V+PdFXNJ; 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 z8si24603998pfj.235.2021.09.28.02.23.04; Tue, 28 Sep 2021 02:23:17 -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; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=V+PdFXNJ; 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 S239770AbhI1JX5 (ORCPT + 99 others); Tue, 28 Sep 2021 05:23:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239573AbhI1JXz (ORCPT ); Tue, 28 Sep 2021 05:23:55 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D3DC061575 for ; Tue, 28 Sep 2021 02:22:15 -0700 (PDT) Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id D0BED8048A; Tue, 28 Sep 2021 11:22:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632820931; bh=G/OYKSqftn2mFkL3esf6uhqBFkyVI4qhxKkblOBZuSY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=V+PdFXNJxWvnx7YZikqPrUzbIIXnXsfonJW1UrfO6ntXuSvCmadWSjPLZFz3N9Bl6 IZnOorll57p7Ko9feGRwzfb5rKKJPsOYsDAcpavu3hojJ29THp0VS9hbIx+0pHcoIt mnHe1mS94KlP0HPoOz7aWMpsX26kd3AxX571ANGz5lX7qX2Bcvs0vBfqUVJE6Hx08l RVOIwiucCAEBRRwk0q0MkzWcoiHWxE79Ax5PUuzXHJNtsHNwRP1b1lsuzG6oMmrGCF I0zrRAkn0oH4VPZYBFpQET+jxbUvhBCSKRGo3OwFtAMcCsGBMCvJzp2tXhtYwaoYOS O57FIBaumSBFg== Subject: Re: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge To: =?UTF-8?Q?Guido_G=c3=bcnther?= Cc: Stefan Agner , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Lucas Stach , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Laurent Pinchart References: <1fda3b80-7df2-2ce3-b049-6773e849e9dc@denx.de> From: Marek Vasut Message-ID: Date: Tue, 28 Sep 2021 11:22:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/28/21 11:19 AM, Guido Günther wrote: > 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. I am not gonna push back against this patch, I think you need feedback from the drm people on this. A warning would indeed be nice. Preserving the old behavior in stable releases would be good (if there are any releases which contain the mxsfb patch this fixes).