drm/exynos/mic: workaround for disabling mic during modesetting
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 21 Jun 2016 10:13:00 +0000 (12:13 +0200)
committerInki Dae <inki.dae@samsung.com>
Wed, 6 Jul 2016 04:08:50 +0000 (13:08 +0900)
Exynos-DRM framework does not power cycle encoder during modesetting, but
DRM core does it for bridges, as a result MIC device is the only
power-cycled device in the chain DECON->MIC->DSI, it causes black screen.
It is a limitation/feature of DRM core.
The patch adds ugly workaround to skip power-cycling MIC during modesetting.
Alternative is to power-cycle all components during modesetting, it would
require adjustements in ExynosDRM framework and rework of some callbacks
in DSI driver.

Change-Id: I94fdb002f119a298b35f01a4abd41d65f7d7478b
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_mic.c

index 297d0db..cf74fe4 100644 (file)
@@ -107,6 +107,7 @@ struct exynos_mic {
        struct drm_bridge bridge;
 
        bool enabled;
+       bool mode_setting;
 };
 
 static void mic_set_path(struct exynos_mic *mic, bool enable)
@@ -316,7 +317,7 @@ static void mic_post_disable(struct drm_bridge *bridge)
        int i;
 
        mutex_lock(&mic_mutex);
-       if (!mic->enabled)
+       if (!mic->enabled || mic->mode_setting)
                goto already_disabled;
 
        mic_set_path(mic, 0);
@@ -337,6 +338,7 @@ static void mic_pre_enable(struct drm_bridge *bridge)
        int ret, i;
 
        mutex_lock(&mic_mutex);
+       mic->mode_setting = false;
        if (mic->enabled)
                goto already_enabled;
 
@@ -378,7 +380,18 @@ already_enabled:
 
 static void mic_enable(struct drm_bridge *bridge) { }
 
+bool mic_mode_fixup(struct drm_bridge *bridge,
+                       const struct drm_display_mode *mode,
+                       struct drm_display_mode *adjusted_mode)
+{
+       struct exynos_mic *mic = bridge->driver_private;
+
+       mic->mode_setting = true;
+       return true;
+}
+
 static const struct drm_bridge_funcs mic_bridge_funcs = {
+       .mode_fixup = mic_mode_fixup,
        .disable = mic_disable,
        .post_disable = mic_post_disable,
        .pre_enable = mic_pre_enable,