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

drm/bridge: mhdp8546: Add minimal format negotiation

With new connector model, mhdp bridge will not create the connector and
SoC driver will rely on format negotiation to setup the encoder format.

Support minimal format negotiations hooks in the drm_bridge_funcs.
Complete format negotiation can be added based on EDID data.
This patch adds the minimal required support to avoid failure
after moving to new connector model.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
[a-bhatia1: Drop the output_fmt check condition]
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230606082142.23760-4-a-bhatia1@ti.com

authored by

Nikhil Devshatwar and committed by
Javier Martinez Canillas
0db3cef1 584a3408

+22
+22
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
··· 2146 2146 return &cdns_mhdp_state->base; 2147 2147 } 2148 2148 2149 + static u32 *cdns_mhdp_get_input_bus_fmts(struct drm_bridge *bridge, 2150 + struct drm_bridge_state *bridge_state, 2151 + struct drm_crtc_state *crtc_state, 2152 + struct drm_connector_state *conn_state, 2153 + u32 output_fmt, 2154 + unsigned int *num_input_fmts) 2155 + { 2156 + u32 *input_fmts; 2157 + 2158 + *num_input_fmts = 0; 2159 + 2160 + input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); 2161 + if (!input_fmts) 2162 + return NULL; 2163 + 2164 + *num_input_fmts = 1; 2165 + input_fmts[0] = MEDIA_BUS_FMT_RGB121212_1X36; 2166 + 2167 + return input_fmts; 2168 + } 2169 + 2149 2170 static int cdns_mhdp_atomic_check(struct drm_bridge *bridge, 2150 2171 struct drm_bridge_state *bridge_state, 2151 2172 struct drm_crtc_state *crtc_state, ··· 2231 2210 .atomic_duplicate_state = cdns_mhdp_bridge_atomic_duplicate_state, 2232 2211 .atomic_destroy_state = cdns_mhdp_bridge_atomic_destroy_state, 2233 2212 .atomic_reset = cdns_mhdp_bridge_atomic_reset, 2213 + .atomic_get_input_bus_fmts = cdns_mhdp_get_input_bus_fmts, 2234 2214 .detect = cdns_mhdp_bridge_detect, 2235 2215 .get_edid = cdns_mhdp_bridge_get_edid, 2236 2216 .hpd_enable = cdns_mhdp_bridge_hpd_enable,