[RESEND][PATCH 2/2] drm/bridge: lt9611: Add atomic_get_input_bus_fmts
Robert Foss
robert.foss at linaro.org
Thu Mar 31 15:45:11 UTC 2022
On Thu, 31 Mar 2022 at 17:39, Marek Vasut <marex at denx.de> wrote:
>
> Implement .atomic_get_input_bus_fmts callback, which sets up
> the input (scanout-engine-end) formats, so that those formats
> can then be used in pipeline format negotiation between this
> bridge and the scanout engine.
>
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Dave Airlie <airlied at redhat.com>
> Cc: John Stultz <john.stultz at linaro.org>
> Cc: Maxime Ripard <maxime at cerno.tech>
> Cc: Sam Ravnborg <sam at ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> drivers/gpu/drm/bridge/lontium-lt9611.c | 27 +++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
> index 9b3ac3794a2c..7ef8fe5abc12 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9611.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
> @@ -922,6 +922,32 @@ static void lt9611_bridge_hpd_enable(struct drm_bridge *bridge)
> lt9611_enable_hpd_interrupts(lt9611);
> }
>
> +#define MAX_INPUT_SEL_FORMATS 1
> +
> +static u32 *
> +lt9611_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;
> +
> + *num_input_fmts = 0;
> +
> + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts),
> + GFP_KERNEL);
> + if (!input_fmts)
> + return NULL;
> +
> + /* This is the DSI-end bus format */
> + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
> + *num_input_fmts = 1;
> +
> + return input_fmts;
> +}
> +
> static const struct drm_bridge_funcs lt9611_bridge_funcs = {
> .attach = lt9611_bridge_attach,
> .mode_valid = lt9611_bridge_mode_valid,
> @@ -936,6 +962,7 @@ static const struct drm_bridge_funcs lt9611_bridge_funcs = {
> .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> + .atomic_get_input_bus_fmts = lt9611_atomic_get_input_bus_fmts,
> };
>
> static int lt9611_parse_dt(struct device *dev,
> --
> 2.35.1
>
Reviewed-by: Robert Foss <robert.foss at linaro.org>
More information about the dri-devel
mailing list