Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4714384pxb; Tue, 28 Sep 2021 02:21:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL8GieuRXyL6bi4tEFmgOcfaxLB6w8GXLKpLGJ9fdLpaXlalVELRaG/IPF5vci5MG5PwXE X-Received: by 2002:a17:902:ed42:b0:13e:2dfa:c9e4 with SMTP id y2-20020a170902ed4200b0013e2dfac9e4mr4204403plb.23.1632820883445; Tue, 28 Sep 2021 02:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632820883; cv=none; d=google.com; s=arc-20160816; b=bD05RmHJIcA/EeIqrEwHUO7KCb9v55+jYnkUI9IOCpj7T86RVU9vr7ZdHPX0arqjFg 5SU0LzcBBDgByqGIFNswozqiE9EsJUsgcrMjWAzB3Pa4NT7CQw+i89Krk2SLMxQQ3lwL eZRoeMlWcGjXKnXsl0ONB8/6o5VDY6QZj9viL2eK5BNBxL1Q9nlTF5qZkZjlh/f5xJkr ChyFef2nqvn41NHVmJSg/4RYk7l24CYhGp9i8J0Xyl1alZV5HjsG87YOtB867TNVdshy P3S1wNLCiyResa/3nYgPGoWctA8vLslwu27W9v8x+KYIqltDiMofYIqIVj0uAhZjA5TU Uj0A== 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=wwjYKZakfdxOJ0fHa5qbAx3ViO2OYxRsUIyBVHHylFw=; b=ptZWuOUxnNhaP0r/R35rWTpMD3HJT17M5yvQIPREKZ5D20rIfnte/5lVsL5HCr35/B jNgCBsinSMnpLnOBx1bIed4VETdrM1VUcx9I1TFZNefcjVc8Q0PJRTGlbTeupwKq5Wjk STpLAf9PaAA7T3Iu/oSIda0vMq1fov1i3OC2d1YiBkSIZ+AMCh9TMoBcL0wb4cOZT3BZ UEs6W86NRgvc1L9M+M5hViKg238IRaIt18tpNG9iTiXfzqY8aGckiuADa6IzNC7ULD/S /NmfwgugGiKx7DvtaPzA8Zgho0f2YrxJoj3TWIspXe1oCjKEhyXikwqCsOPdZ2IVKCzW mkPA== 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 d27si24785458pgd.29.2021.09.28.02.21.11; Tue, 28 Sep 2021 02:21:23 -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 S239922AbhI1JVd (ORCPT + 99 others); Tue, 28 Sep 2021 05:21:33 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:43112 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239806AbhI1JVb (ORCPT ); Tue, 28 Sep 2021 05:21:31 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id BA55BFB03; Tue, 28 Sep 2021 11:19:48 +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 iNT9Un6UF8NA; Tue, 28 Sep 2021 11:19:47 +0200 (CEST) Date: Tue, 28 Sep 2021 11:19:46 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Marek Vasut 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 Subject: Re: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge Message-ID: References: <1fda3b80-7df2-2ce3-b049-6773e849e9dc@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1fda3b80-7df2-2ce3-b049-6773e849e9dc@denx.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Cheers, -- Guido