Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: Remove apply manager callback

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>

authored by

Sean Paul and committed by
Inki Dae
87244fa6 bb7704d6

+8 -43
-2
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 146 146 * 147 147 * @initialize: initializes the manager with drm_dev 148 148 * @dpms: control device power. 149 - * @apply: set timing, vblank and overlay data to registers. 150 149 * @mode_fixup: fix mode data comparing to hw specific display mode. 151 150 * @mode_set: convert drm_display_mode to hw specific display mode and 152 151 * would be called by encoder->mode_set(). ··· 165 166 int (*initialize)(struct exynos_drm_manager *mgr, 166 167 struct drm_device *drm_dev); 167 168 void (*dpms)(struct exynos_drm_manager *mgr, int mode); 168 - void (*apply)(struct exynos_drm_manager *mgr); 169 169 void (*mode_fixup)(struct exynos_drm_manager *mgr, 170 170 struct drm_connector *connector, 171 171 const struct drm_display_mode *mode,
-6
drivers/gpu/drm/exynos/exynos_drm_encoder.c
··· 57 57 static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) 58 58 { 59 59 struct drm_device *dev = encoder->dev; 60 - struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); 61 - struct exynos_drm_manager_ops *manager_ops = manager->ops; 62 60 struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); 63 61 64 62 DRM_DEBUG_KMS("encoder dpms: %d\n", mode); ··· 70 72 71 73 switch (mode) { 72 74 case DRM_MODE_DPMS_ON: 73 - if (manager_ops && manager_ops->apply) 74 - if (!exynos_encoder->updated) 75 - manager_ops->apply(manager); 76 - 77 75 exynos_drm_connector_power(encoder, mode); 78 76 exynos_encoder->dpms = mode; 79 77 break;
+5 -17
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 672 672 static struct exynos_drm_manager_ops fimd_manager_ops = { 673 673 .initialize = fimd_mgr_initialize, 674 674 .dpms = fimd_dpms, 675 - .apply = fimd_apply, 676 675 .commit = fimd_commit, 677 676 .enable_vblank = fimd_enable_vblank, 678 677 .disable_vblank = fimd_disable_vblank, ··· 882 883 fimd_enable_vblank(mgr); 883 884 884 885 fimd_window_resume(dev); 886 + 887 + fimd_apply(mgr); 885 888 } else { 886 889 fimd_window_suspend(dev); 887 890 ··· 1038 1037 * of pm runtime would still be 1 so in this case, fimd driver 1039 1038 * should be on directly not drawing on pm runtime interface. 1040 1039 */ 1041 - if (!pm_runtime_suspended(dev)) { 1042 - int ret; 1040 + if (pm_runtime_suspended(dev)) 1041 + return 0; 1043 1042 1044 - ret = fimd_activate(mgr, true); 1045 - if (ret < 0) 1046 - return ret; 1047 - 1048 - /* 1049 - * in case of dpms on(standby), fimd_apply function will 1050 - * be called by encoder's dpms callback to update fimd's 1051 - * registers but in case of sleep wakeup, it's not. 1052 - * so fimd_apply function should be called at here. 1053 - */ 1054 - fimd_apply(mgr); 1055 - } 1056 - 1057 - return 0; 1043 + return fimd_activate(mgr, true); 1058 1044 } 1059 1045 #endif 1060 1046
-17
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
··· 302 302 hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode); 303 303 } 304 304 305 - static void drm_hdmi_apply(struct exynos_drm_manager *mgr) 306 - { 307 - struct drm_hdmi_context *ctx = mgr->ctx; 308 - int i; 309 - 310 - for (i = 0; i < MIXER_WIN_NR; i++) { 311 - if (!ctx->enabled[i]) 312 - continue; 313 - if (mixer_ops && mixer_ops->win_commit) 314 - mixer_ops->win_commit(ctx->mixer_ctx->ctx, i); 315 - } 316 - 317 - if (hdmi_ops && hdmi_ops->commit) 318 - hdmi_ops->commit(ctx->hdmi_ctx->ctx); 319 - } 320 - 321 305 static void drm_mixer_win_mode_set(struct exynos_drm_manager *mgr, 322 306 struct exynos_drm_overlay *overlay) 323 307 { ··· 346 362 static struct exynos_drm_manager_ops drm_hdmi_manager_ops = { 347 363 .initialize = drm_hdmi_mgr_initialize, 348 364 .dpms = drm_hdmi_dpms, 349 - .apply = drm_hdmi_apply, 350 365 .enable_vblank = drm_hdmi_enable_vblank, 351 366 .disable_vblank = drm_hdmi_disable_vblank, 352 367 .wait_for_vblank = drm_hdmi_wait_for_vblank,
-1
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 333 333 334 334 static struct exynos_drm_manager_ops vidi_manager_ops = { 335 335 .dpms = vidi_dpms, 336 - .apply = vidi_apply, 337 336 .commit = vidi_commit, 338 337 .enable_vblank = vidi_enable_vblank, 339 338 .disable_vblank = vidi_disable_vblank,
+1
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 1752 1752 clk_prepare_enable(res->sclk_hdmi); 1753 1753 1754 1754 hdmiphy_poweron(hdata); 1755 + hdmi_commit(hdata); 1755 1756 } 1756 1757 1757 1758 static void hdmi_poweroff(struct hdmi_context *hdata)
+2
drivers/gpu/drm/exynos/exynos_mixer.c
··· 1058 1058 win_data = &ctx->win_data[i]; 1059 1059 win_data->enabled = win_data->resume; 1060 1060 win_data->resume = false; 1061 + if (win_data->enabled) 1062 + mixer_win_commit(ctx, i); 1061 1063 } 1062 1064 } 1063 1065