Skip to content

Commit 7978ec7

Browse files
Aradhya Bhatiamartinezjavier
authored andcommitted
drm/bridge: sii902x: Support format negotiation hooks
With new connector model, sii902x will not create the connector, when DRM_BRIDGE_ATTACH_NO_CONNECTOR is set 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 selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is the case with older model. Signed-off-by: Aradhya Bhatia <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1934bf5 commit 7978ec7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/gpu/drm/bridge/sii902x.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,38 @@ static struct edid *sii902x_bridge_get_edid(struct drm_bridge *bridge,
473473
return sii902x_get_edid(sii902x, connector);
474474
}
475475

476+
static u32 *sii902x_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
477+
struct drm_bridge_state *bridge_state,
478+
struct drm_crtc_state *crtc_state,
479+
struct drm_connector_state *conn_state,
480+
u32 output_fmt,
481+
unsigned int *num_input_fmts)
482+
{
483+
u32 *input_fmts;
484+
485+
*num_input_fmts = 0;
486+
487+
input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL);
488+
if (!input_fmts)
489+
return NULL;
490+
491+
input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
492+
*num_input_fmts = 1;
493+
494+
return input_fmts;
495+
}
496+
476497
static const struct drm_bridge_funcs sii902x_bridge_funcs = {
477498
.attach = sii902x_bridge_attach,
478499
.mode_set = sii902x_bridge_mode_set,
479500
.disable = sii902x_bridge_disable,
480501
.enable = sii902x_bridge_enable,
481502
.detect = sii902x_bridge_detect,
482503
.get_edid = sii902x_bridge_get_edid,
504+
.atomic_reset = drm_atomic_helper_bridge_reset,
505+
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
506+
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
507+
.atomic_get_input_bus_fmts = sii902x_bridge_atomic_get_input_bus_fmts,
483508
};
484509

485510
static int sii902x_mute(struct sii902x *sii902x, bool mute)

0 commit comments

Comments
 (0)