@@ -267,6 +267,8 @@ struct dw_mipi_dsi {
u32 format;
unsigned long mode_flags;
+ struct drm_display_mode mode;
+
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
struct debugfs_entries *debugfs_vpg;
@@ -1045,15 +1047,18 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
{
struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
- dw_mipi_dsi_mode_set(dsi, adjusted_mode);
- if (dsi->slave)
- dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode);
+ drm_mode_copy(&dsi->mode, adjusted_mode);
}
static void dw_mipi_dsi_bridge_atomic_enable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{
struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
+ const struct drm_display_mode *adjusted_mode = &dsi->mode;
+
+ dw_mipi_dsi_mode_set(dsi, adjusted_mode);
+ if (dsi->slave)
+ dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode);
/* Switch to video mode for panel-bridge enable & panel enable */
dw_mipi_dsi_set_mode(dsi, MIPI_DSI_MODE_VIDEO);
The bridge clock configuration should happen in atomic_enable instead of mode_set callback, since that is where the current state of the bridge is available. Move the clock configuration into atomic_enable callback. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com> Cc: Maxime Ripard <maxime@cerno.tech> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Sam Ravnborg <sam@ravnborg.org> --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)