Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: lvds-codec: Implement atomic_get_input_bus_fmts for LVDS encoder

atomic_get_input_bus_fmts is only implemented for LVDS decoders, resulting
that LVDS encoders only support bus format MEDIA_BUS_FMT_FIXED. This
results in warnings like:
mxsfb 21c8000.lcdif: Bridge does not provide bus format, assuming
MEDIA_BUS_FMT_RGB888_1X24.
Please fix bridge driver by handling atomic_get_input_bus_fmts.

Fix this by reusing lvds_codec_atomic_get_input_bus_fmts currently used
for LVDS decoders. Use RGB888_1X24 for LVDS encoders. This also allows
removing the dedicated struct drm_bridge_funcs for decoders.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230810063229.597533-1-alexander.stein@ew.tq-group.com

authored by

Alexander Stein and committed by
Robert Foss
b31f784f 15f389da

+4 -8
+4 -8
drivers/gpu/drm/bridge/lvds-codec.c
··· 5 5 */ 6 6 7 7 #include <linux/gpio/consumer.h> 8 + #include <linux/media-bus-format.h> 8 9 #include <linux/module.h> 9 10 #include <linux/of.h> 10 11 #include <linux/of_graph.h> ··· 72 71 "Failed to disable regulator \"vcc\": %d\n", ret); 73 72 } 74 73 75 - static const struct drm_bridge_funcs funcs = { 76 - .attach = lvds_codec_attach, 77 - .enable = lvds_codec_enable, 78 - .disable = lvds_codec_disable, 79 - }; 80 - 81 74 #define MAX_INPUT_SEL_FORMATS 1 82 75 static u32 * 83 76 lvds_codec_atomic_get_input_bus_fmts(struct drm_bridge *bridge, ··· 97 102 return input_fmts; 98 103 } 99 104 100 - static const struct drm_bridge_funcs funcs_decoder = { 105 + static const struct drm_bridge_funcs funcs = { 101 106 .attach = lvds_codec_attach, 102 107 .enable = lvds_codec_enable, 103 108 .disable = lvds_codec_disable, ··· 179 184 return ret; 180 185 } else { 181 186 lvds_codec->bus_format = ret; 182 - lvds_codec->bridge.funcs = &funcs_decoder; 183 187 } 188 + } else { 189 + lvds_codec->bus_format = MEDIA_BUS_FMT_RGB888_1X24; 184 190 } 185 191 186 192 /*