dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: "Guido Günther" <agx@sigxcpu.org>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Robert Foss" <robert.foss@linaro.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>, "Marek Vasut" <marex@denx.de>,
	"Stefan Agner" <stefan@agner.ch>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Ondrej Jirman" <megous@megous.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/5] drm/bridge: nwl-dsi: Add atomic_get_input_bus_fmts
Date: Mon, 04 Oct 2021 09:54:25 +0200	[thread overview]
Message-ID: <ce3a401d316b15ee97d23b2a9a99f4be2a6d0b34.camel@pengutronix.de> (raw)
In-Reply-To: <07ab741922fb158d2ff53cdf26c9c55528d051ce.1633332399.git.agx@sigxcpu.org>

Am Montag, dem 04.10.2021 um 09:27 +0200 schrieb Guido Günther:
> Components further up in the chain might ask us for supported formats.
> 
> Without this MEDIA_BUS_FMT_FIXED is assumed which then breaks display
> output with mxsfb since it can't determine a proper bus format.
> 
> We handle the bus formats that correspond to the DSI formats the bridge
> can potentially output (see chapter 13.6 of the i.MX 8MQ reference
> manual) - which matches what xsfb can input.
> 
> Fixes: b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present")
> 
> Signed-off-by: Guido Günther <agx@sigxcpu.org>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/gpu/drm/bridge/nwl-dsi.c | 35 ++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index a251cc1f088f..27c80d36846b 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -1234,6 +1234,40 @@ static void nwl_dsi_bridge_detach(struct drm_bridge *bridge)
>  	drm_of_panel_bridge_remove(dsi->dev->of_node, 1, 0);
>  }
>  
> +static u32 *nwl_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
> +						 struct drm_bridge_state *bridge_state,
> +						 struct drm_crtc_state *crtc_state,
> +						 struct drm_connector_state *conn_state,
> +						 u32 output_fmt,
> +						 unsigned int *num_input_fmts)
> +{
> +	u32 *input_fmts, input_fmt;
> +
> +	*num_input_fmts = 0;
> +
> +	switch (output_fmt) {
> +	/* If MEDIA_BUS_FMT_FIXED is tested, return default bus format */
> +	case MEDIA_BUS_FMT_FIXED:
> +		input_fmt = MEDIA_BUS_FMT_RGB888_1X24;
> +		break;
> +	case MEDIA_BUS_FMT_RGB888_1X24:
> +	case MEDIA_BUS_FMT_RGB666_1X18:
> +	case MEDIA_BUS_FMT_RGB565_1X16:
> +		input_fmt = output_fmt;
> +		break;
> +	default:
> +		return NULL;
> +	}
> +
> +	input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL);
> +	if (!input_fmts)
> +		return NULL;
> +	input_fmts[0] = input_fmt;
> +	*num_input_fmts = 1;
> +
> +	return input_fmts;
> +}
> +
>  static const struct drm_bridge_funcs nwl_dsi_bridge_funcs = {
>  	.atomic_duplicate_state	= drm_atomic_helper_bridge_duplicate_state,
>  	.atomic_destroy_state	= drm_atomic_helper_bridge_destroy_state,
> @@ -1241,6 +1275,7 @@ static const struct drm_bridge_funcs nwl_dsi_bridge_funcs = {
>  	.atomic_check		= nwl_dsi_bridge_atomic_check,
>  	.atomic_enable		= nwl_dsi_bridge_atomic_enable,
>  	.atomic_disable		= nwl_dsi_bridge_atomic_disable,
> +	.atomic_get_input_bus_fmts = nwl_bridge_atomic_get_input_bus_fmts,
>  	.mode_set		= nwl_dsi_bridge_mode_set,
>  	.mode_valid		= nwl_dsi_bridge_mode_valid,
>  	.attach			= nwl_dsi_bridge_attach,



  reply	other threads:[~2021-10-04  7:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04  7:27 [PATCH v2 0/5] mxsfb/nwl/panels: media bus format fixes Guido Günther
2021-10-04  7:27 ` [PATCH v2 1/5] drm/bridge: nwl-dsi: Add atomic_get_input_bus_fmts Guido Günther
2021-10-04  7:54   ` Lucas Stach [this message]
2021-10-04  7:27 ` [PATCH v2 2/5] drm/panel: mantix: Add media bus format Guido Günther
2021-10-04  7:27 ` [PATCH v2 3/5] drm/panel: st7703: " Guido Günther
2021-10-04  7:27 ` [PATCH v2 4/5] drm: mxsfb: Print failed bus format in hex Guido Günther
2021-10-04  7:55   ` Lucas Stach
2021-10-04  7:27 ` [PATCH v2 5/5] drm: mxsfb: Set proper default bus format when using a bridge Guido Günther
2021-10-04  7:58   ` Lucas Stach
2021-10-04  8:27     ` Guido Günther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce3a401d316b15ee97d23b2a9a99f4be2a6d0b34.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=agx@sigxcpu.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=megous@megous.com \
    --cc=narmstrong@baylibre.com \
    --cc=robert.foss@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sam@ravnborg.org \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).