Skip to content

Commit fdf1d8e

Browse files
nikhildevshatwarmartinezjavier
authored andcommitted
drm/bridge: tfp410: Support format negotiation hooks
With new connector model, tfp410 will not create the connector and SoC driver will rely on format negotiation to setup the encoder format. Support format negotiations hooks in the drm_bridge_funcs. Use helper functions for state management. Input format is the one selected by the bridge from DT properties. Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> [a-bhatia1: Removed output fmt condition check] 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-2-a-bhatia1@ti.com
1 parent 70d3c92 commit fdf1d8e

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

drivers/gpu/drm/bridge/ti-tfp410.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,38 @@ static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
206206
return MODE_OK;
207207
}
208208

209+
static u32 *tfp410_get_input_bus_fmts(struct drm_bridge *bridge,
210+
struct drm_bridge_state *bridge_state,
211+
struct drm_crtc_state *crtc_state,
212+
struct drm_connector_state *conn_state,
213+
u32 output_fmt,
214+
unsigned int *num_input_fmts)
215+
{
216+
struct tfp410 *dvi = drm_bridge_to_tfp410(bridge);
217+
u32 *input_fmts;
218+
219+
*num_input_fmts = 0;
220+
221+
input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL);
222+
if (!input_fmts)
223+
return NULL;
224+
225+
*num_input_fmts = 1;
226+
input_fmts[0] = dvi->bus_format;
227+
228+
return input_fmts;
229+
}
230+
209231
static const struct drm_bridge_funcs tfp410_bridge_funcs = {
210232
.attach = tfp410_attach,
211233
.detach = tfp410_detach,
212234
.enable = tfp410_enable,
213235
.disable = tfp410_disable,
214236
.mode_valid = tfp410_mode_valid,
237+
.atomic_reset = drm_atomic_helper_bridge_reset,
238+
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
239+
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
240+
.atomic_get_input_bus_fmts = tfp410_get_input_bus_fmts,
215241
};
216242

217243
static const struct drm_bridge_timings tfp410_default_timings = {

0 commit comments

Comments
 (0)