From 5070f11e8d7795f55990a45d351bc7c6cf90eafb Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Fri, 11 Sep 2020 15:54:09 +0200 Subject: drm/exynos: configure mode on drm bridge The driver uses the encoder to get the mode that shall be configured. This is not possible, if the driver is used as a bridge, because the encoder might not be used. Use the mode_set function to set the display mode. Signed-off-by: Michael Tretter --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index effcd609704e..b28df6adf7d9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -288,6 +288,8 @@ struct exynos_dsi { u32 mode_flags; u32 format; + struct drm_display_mode mode; + int state; struct drm_property *brightness; struct completion completed; @@ -961,7 +963,7 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) { - struct drm_display_mode *m = &dsi->encoder.crtc->state->adjusted_mode; + struct drm_display_mode *m = &dsi->mode; unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; u32 reg; @@ -1658,11 +1660,22 @@ static void exynos_dsi_bridge_disable(struct drm_bridge *bridge) exynos_dsi_disable(dsi); } +static void exynos_dsi_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct exynos_dsi *dsi = bridge->driver_private; + + /* The mode is set when actually enabling the device. */ + drm_mode_copy(&dsi->mode, adjusted_mode); +} + static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .attach = exynos_dsi_bridge_attach, .detach = exynos_dsi_bridge_detach, .enable = exynos_dsi_bridge_enable, .disable = exynos_dsi_bridge_disable, + .mode_set = exynos_dsi_bridge_mode_set, }; MODULE_DEVICE_TABLE(of, exynos_dsi_of_match); -- cgit v1.2.3