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 8DA72C433EF for ; Tue, 28 Sep 2021 09:02:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78E38611C7 for ; Tue, 28 Sep 2021 09:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239773AbhI1JEG (ORCPT ); Tue, 28 Sep 2021 05:04:06 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:42778 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239639AbhI1JEF (ORCPT ); Tue, 28 Sep 2021 05:04:05 -0400 X-Greylist: delayed 403 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Sep 2021 05:04:05 EDT Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id D2A32FB03; Tue, 28 Sep 2021 10:55:38 +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 b4uIgp2xdlGl; Tue, 28 Sep 2021 10:55:37 +0200 (CEST) Date: Tue, 28 Sep 2021 10:55:35 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Marek Vasut , 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 Subject: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } /* If there is no bridge, use bus format from connector */ -- 2.33.0 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 75C50C433EF for ; Tue, 28 Sep 2021 09:16:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 365D86101E for ; Tue, 28 Sep 2021 09:16:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 365D86101E 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.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rgWCjsYbOL892QGorims2dSo+kLtsLmTeJw4JoxVrKA=; b=neZ9Y7+R4wrViJ kM/NBRcpXLgnN4tQMyEUvTkxjM03ddd8l6v4XCwfeoc/hH67PrDKBnR7D3ikwH0o9s072agzOXnI/ wK86iQZbOBWEtwGpgf8bctp/gdCvuQnNFHJAClQpUfu2c1dS/Dm2SqZe71bq4OAH9pFD8IAy3KHvd M52tLOYjv/b66dyHaQMuLFy/dLJD9yV+5taGXpkbSwa5oJVE4Dpw0xTSIVAUXcSYkc3hPDWNolTHa IYnawLFwg5NdIxti8jk2sWdQpMVNv9MYh86/jA9AGqd2Sy0+swNTCuXPwXJcQOFM+Y67O7egMUZuE NLgJ3KhFhvby2c8bOGcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mV9BW-006VUN-1D; Tue, 28 Sep 2021 09:13:59 +0000 Received: from honk.sigxcpu.org ([24.134.29.49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mV90N-006Qp7-V9 for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 09:02:29 +0000 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id D2A32FB03; Tue, 28 Sep 2021 10:55:38 +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 b4uIgp2xdlGl; Tue, 28 Sep 2021 10:55:37 +0200 (CEST) Date: Tue, 28 Sep 2021 10:55:35 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Marek Vasut , 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 Subject: [PATCH] drm: mxsfb: Set proper default bus format when using a bridge Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_020228_225233_3CA155BD X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=FCnther --- 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/mxsf= b_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 *c= rtc, drm_atomic_get_new_bridge_state(state, mxsfb->bridge); bus_format =3D bridge_state->input_bus_cfg.format; + if (bus_format =3D=3D MEDIA_BUS_FMT_FIXED) + bus_format =3D MEDIA_BUS_FMT_RGB888_1X24; } = /* If there is no bridge, use bus format from connector */ -- = 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel