diff options
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 13 |
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 3fdf0b65f47e..0584132dc608 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c | |||
@@ -274,10 +274,21 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) | |||
274 | ctx->enabled[win] = false; | 274 | ctx->enabled[win] = false; |
275 | } | 275 | } |
276 | 276 | ||
277 | static void drm_mixer_wait_for_vblank(struct device *subdrv_dev) | ||
278 | { | ||
279 | struct drm_hdmi_context *ctx = to_context(subdrv_dev); | ||
280 | |||
281 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
282 | |||
283 | if (mixer_ops && mixer_ops->wait_for_vblank) | ||
284 | mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); | ||
285 | } | ||
286 | |||
277 | static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { | 287 | static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { |
278 | .mode_set = drm_mixer_mode_set, | 288 | .mode_set = drm_mixer_mode_set, |
279 | .commit = drm_mixer_commit, | 289 | .commit = drm_mixer_commit, |
280 | .disable = drm_mixer_disable, | 290 | .disable = drm_mixer_disable, |
291 | .wait_for_vblank = drm_mixer_wait_for_vblank, | ||
281 | }; | 292 | }; |
282 | 293 | ||
283 | static struct exynos_drm_manager hdmi_manager = { | 294 | static struct exynos_drm_manager hdmi_manager = { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index a91c42088e42..d9f9e9fcc2b6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h | |||
@@ -67,6 +67,7 @@ struct exynos_mixer_ops { | |||
67 | void (*dpms)(void *ctx, int mode); | 67 | void (*dpms)(void *ctx, int mode); |
68 | 68 | ||
69 | /* overlay */ | 69 | /* overlay */ |
70 | void (*wait_for_vblank)(void *ctx); | ||
70 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); | 71 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); |
71 | void (*win_commit)(void *ctx, int zpos); | 72 | void (*win_commit)(void *ctx, int zpos); |
72 | void (*win_disable)(void *ctx, int zpos); | 73 | void (*win_disable)(void *ctx, int zpos); |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 25b97d5e5fcb..8a43ee17039e 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -726,6 +726,18 @@ static void mixer_dpms(void *ctx, int mode) | |||
726 | } | 726 | } |
727 | } | 727 | } |
728 | 728 | ||
729 | static void mixer_wait_for_vblank(void *ctx) | ||
730 | { | ||
731 | struct mixer_context *mixer_ctx = ctx; | ||
732 | struct mixer_resources *res = &mixer_ctx->mixer_res; | ||
733 | int ret; | ||
734 | |||
735 | ret = wait_for((mixer_reg_read(res, MXR_INT_STATUS) & | ||
736 | MXR_INT_STATUS_VSYNC), 50); | ||
737 | if (ret < 0) | ||
738 | DRM_DEBUG_KMS("vblank wait timed out.\n"); | ||
739 | } | ||
740 | |||
729 | static void mixer_win_mode_set(void *ctx, | 741 | static void mixer_win_mode_set(void *ctx, |
730 | struct exynos_drm_overlay *overlay) | 742 | struct exynos_drm_overlay *overlay) |
731 | { | 743 | { |
@@ -818,6 +830,7 @@ static struct exynos_mixer_ops mixer_ops = { | |||
818 | .dpms = mixer_dpms, | 830 | .dpms = mixer_dpms, |
819 | 831 | ||
820 | /* overlay */ | 832 | /* overlay */ |
833 | .wait_for_vblank = mixer_wait_for_vblank, | ||
821 | .win_mode_set = mixer_win_mode_set, | 834 | .win_mode_set = mixer_win_mode_set, |
822 | .win_commit = mixer_win_commit, | 835 | .win_commit = mixer_win_commit, |
823 | .win_disable = mixer_win_disable, | 836 | .win_disable = mixer_win_disable, |