drm/exynos: Remove apply manager callback
authorSean Paul <seanpaul@chromium.org>
Thu, 30 Jan 2014 21:19:07 +0000 (16:19 -0500)
committerInki Dae <daeinki@gmail.com>
Sun, 23 Mar 2014 15:36:29 +0000 (00:36 +0900)
This patch removes the apply() manager callback in favor of putting the
relevant commits in the individual drivers. This will mitigate some of
the difference between the suspend/resume path and the dpms path

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/exynos_mixer.c

index 5e82dc9d6b0cd2f0c661f3dcb75412aa08a3cc11..5912841cdf2f5c53590fa58b71ecea144dad9a7f 100644 (file)
@@ -146,7 +146,6 @@ struct exynos_drm_display_ops {
  *
  * @initialize: initializes the manager with drm_dev
  * @dpms: control device power.
- * @apply: set timing, vblank and overlay data to registers.
  * @mode_fixup: fix mode data comparing to hw specific display mode.
  * @mode_set: convert drm_display_mode to hw specific display mode and
  *           would be called by encoder->mode_set().
@@ -166,7 +165,6 @@ struct exynos_drm_manager_ops {
        int (*initialize)(struct exynos_drm_manager *mgr,
                                struct drm_device *drm_dev);
        void (*dpms)(struct exynos_drm_manager *mgr, int mode);
-       void (*apply)(struct exynos_drm_manager *mgr);
        void (*mode_fixup)(struct exynos_drm_manager *mgr,
                                struct drm_connector *connector,
                                const struct drm_display_mode *mode,
index ec627fa2f5d53abd61e2ac4df9df716db2845a53..19ee84da5e082517515b8f19752dd595f3415f55 100644 (file)
@@ -57,8 +57,6 @@ static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode)
 static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
        struct drm_device *dev = encoder->dev;
-       struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
-       struct exynos_drm_manager_ops *manager_ops = manager->ops;
        struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
 
        DRM_DEBUG_KMS("encoder dpms: %d\n", mode);
@@ -72,10 +70,6 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
-               if (manager_ops && manager_ops->apply)
-                       if (!exynos_encoder->updated)
-                               manager_ops->apply(manager);
-
                exynos_drm_connector_power(encoder, mode);
                exynos_encoder->dpms = mode;
                break;
index 411e90a7813a48e32bc44a9e4334d92a9e9dc7bc..810c61fa77e1c08d0056609cd4ab9cb27f75731c 100644 (file)
@@ -672,7 +672,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
 static struct exynos_drm_manager_ops fimd_manager_ops = {
        .initialize = fimd_mgr_initialize,
        .dpms = fimd_dpms,
-       .apply = fimd_apply,
        .commit = fimd_commit,
        .enable_vblank = fimd_enable_vblank,
        .disable_vblank = fimd_disable_vblank,
@@ -883,6 +882,8 @@ static int fimd_activate(struct exynos_drm_manager *mgr, bool enable)
                        fimd_enable_vblank(mgr);
 
                fimd_window_resume(dev);
+
+               fimd_apply(mgr);
        } else {
                fimd_window_suspend(dev);
 
@@ -1037,23 +1038,10 @@ static int fimd_resume(struct device *dev)
         * of pm runtime would still be 1 so in this case, fimd driver
         * should be on directly not drawing on pm runtime interface.
         */
-       if (!pm_runtime_suspended(dev)) {
-               int ret;
+       if (pm_runtime_suspended(dev))
+               return 0;
 
-               ret = fimd_activate(mgr, true);
-               if (ret < 0)
-                       return ret;
-
-               /*
-                * in case of dpms on(standby), fimd_apply function will
-                * be called by encoder's dpms callback to update fimd's
-                * registers but in case of sleep wakeup, it's not.
-                * so fimd_apply function should be called at here.
-                */
-               fimd_apply(mgr);
-       }
-
-       return 0;
+       return fimd_activate(mgr, true);
 }
 #endif
 
index ca0a87f2cd7f3f9e3b98b6c134c58c6897a3a772..c5de00a66c2be2ac6af2403808bfe796c0561b8b 100644 (file)
@@ -302,22 +302,6 @@ static void drm_hdmi_dpms(struct exynos_drm_manager *mgr, int mode)
                hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode);
 }
 
-static void drm_hdmi_apply(struct exynos_drm_manager *mgr)
-{
-       struct drm_hdmi_context *ctx = mgr->ctx;
-       int i;
-
-       for (i = 0; i < MIXER_WIN_NR; i++) {
-               if (!ctx->enabled[i])
-                       continue;
-               if (mixer_ops && mixer_ops->win_commit)
-                       mixer_ops->win_commit(ctx->mixer_ctx->ctx, i);
-       }
-
-       if (hdmi_ops && hdmi_ops->commit)
-               hdmi_ops->commit(ctx->hdmi_ctx->ctx);
-}
-
 static void drm_mixer_win_mode_set(struct exynos_drm_manager *mgr,
                                struct exynos_drm_overlay *overlay)
 {
@@ -362,7 +346,6 @@ static void drm_mixer_win_disable(struct exynos_drm_manager *mgr, int zpos)
 static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {
        .initialize = drm_hdmi_mgr_initialize,
        .dpms = drm_hdmi_dpms,
-       .apply = drm_hdmi_apply,
        .enable_vblank = drm_hdmi_enable_vblank,
        .disable_vblank = drm_hdmi_disable_vblank,
        .wait_for_vblank = drm_hdmi_wait_for_vblank,
index e458b2626d697120f5e054b58c745a88324472bd..838edb08f214990aec061eded1ac2a28a38537bc 100644 (file)
@@ -333,7 +333,6 @@ static void vidi_win_disable(struct exynos_drm_manager *mgr, int zpos)
 
 static struct exynos_drm_manager_ops vidi_manager_ops = {
        .dpms = vidi_dpms,
-       .apply = vidi_apply,
        .commit = vidi_commit,
        .enable_vblank = vidi_enable_vblank,
        .disable_vblank = vidi_disable_vblank,
index 30eb54775ae3fc48cc56639cfb2015dc5c31c672..d9521a9a624a1d7dc4d941681158a227621e33e5 100644 (file)
@@ -1752,6 +1752,7 @@ static void hdmi_poweron(struct hdmi_context *hdata)
        clk_prepare_enable(res->sclk_hdmi);
 
        hdmiphy_poweron(hdata);
+       hdmi_commit(hdata);
 }
 
 static void hdmi_poweroff(struct hdmi_context *hdata)
index 23b9407a6a05279fb7c3bc625abfc16cc41cfd77..25a440a375fbfad3d9b7c05e5704a39410a76f44 100644 (file)
@@ -1058,6 +1058,8 @@ static void mixer_window_resume(struct mixer_context *ctx)
                win_data = &ctx->win_data[i];
                win_data->enabled = win_data->resume;
                win_data->resume = false;
+               if (win_data->enabled)
+                       mixer_win_commit(ctx, i);
        }
 }