summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-03-31 17:39:23 +0200
committerRobert Foss <robert.foss@linaro.org>2022-03-31 17:43:28 +0200
commitee2f7c9d878905054e3df5126a9bbaec1923e2ff (patch)
treeefc996d0dc35aa27b83c010c10eac6d72239e47c /drivers/gpu
parent97d7ca798a79a93b2a3168f60024fddcc8e0d6b0 (diff)
downloadlinux-ee2f7c9d878905054e3df5126a9bbaec1923e2ff.tar.bz2
drm/bridge: lt9611: Add atomic_get_input_bus_fmts
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@denx.de> Cc: Dave Airlie <airlied@redhat.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Maxime Ripard <maxime@cerno.tech> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20220331153923.14314-2-marex@denx.de
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/bridge/lontium-lt9611.c27
1 files changed, 27 insertions, 0 deletions
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,