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

drm/bridge: tc358767: Add format negotiation hooks for DPI/DSI to (e)DP

With new connector model, tc358767 will not create the connector, when
DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and display-controller driver will
rely on format negotiation to setup the encoder format.

Add the missing bus format negotiation hooks in the
drm_bridge_funcs to complete DRM_BRIDGE_ATTACH_NO_CONNECTOR support.

Output format, for DPI/DSI to DP, is selected to
MEDIA_BUS_FMT_RGB888_1X24 as default, keeping in mind what the older
model used to support.

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Closes: https://lore.kernel.org/all/24282420-b4dd-45b3-bb1c-fc37fe4a8205@siemens.com/
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231108-tc358767-v2-1-25c5f70a2159@ideasonboard.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Aradhya Bhatia and committed by
Dmitry Baryshkov
4b12f91a fafc8cd0

+25
+25
drivers/gpu/drm/bridge/tc358767.c
··· 1820 1820 } 1821 1821 1822 1822 #define MAX_INPUT_SEL_FORMATS 1 1823 + #define MAX_OUTPUT_SEL_FORMATS 1 1823 1824 1824 1825 static u32 * 1825 1826 tc_dpi_atomic_get_input_bus_fmts(struct drm_bridge *bridge, ··· 1844 1843 *num_input_fmts = 1; 1845 1844 1846 1845 return input_fmts; 1846 + } 1847 + 1848 + static u32 * 1849 + tc_edp_atomic_get_output_bus_fmts(struct drm_bridge *bridge, 1850 + struct drm_bridge_state *bridge_state, 1851 + struct drm_crtc_state *crtc_state, 1852 + struct drm_connector_state *conn_state, 1853 + unsigned int *num_output_fmts) 1854 + { 1855 + u32 *output_fmts; 1856 + 1857 + *num_output_fmts = 0; 1858 + 1859 + output_fmts = kcalloc(MAX_OUTPUT_SEL_FORMATS, sizeof(*output_fmts), 1860 + GFP_KERNEL); 1861 + if (!output_fmts) 1862 + return NULL; 1863 + 1864 + output_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; 1865 + *num_output_fmts = 1; 1866 + 1867 + return output_fmts; 1847 1868 } 1848 1869 1849 1870 static const struct drm_bridge_funcs tc_dpi_bridge_funcs = { ··· 1894 1871 .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, 1895 1872 .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 1896 1873 .atomic_reset = drm_atomic_helper_bridge_reset, 1874 + .atomic_get_input_bus_fmts = drm_atomic_helper_bridge_propagate_bus_fmt, 1875 + .atomic_get_output_bus_fmts = tc_edp_atomic_get_output_bus_fmts, 1897 1876 }; 1898 1877 1899 1878 static bool tc_readable_reg(struct device *dev, unsigned int reg)