diff options
author | Prathyush K <prathyush.k@samsung.com> | 2012-12-06 09:46:01 -0500 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2012-12-13 09:05:43 -0500 |
commit | 8137a2e21a3465d91d86b49cfebcc370438b77bd (patch) | |
tree | c865d462600d5c8d65bdb04c944eb606fd90a278 /drivers/gpu/drm | |
parent | f74085a9f87087d70028dcc18563dba4a42ce32c (diff) |
drm/exynos: move hdmi's wait_for_vblank to manager_ops
The wait_for_vblank callback of hdmi and mixer is now moved from
overlay_ops to manager_ops.
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 26 |
3 files changed, 25 insertions, 25 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 8b771a3d2709..55793c46e3c2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c | |||
@@ -179,6 +179,16 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev) | |||
179 | return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx); | 179 | return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void drm_hdmi_wait_for_vblank(struct device *subdrv_dev) | ||
183 | { | ||
184 | struct drm_hdmi_context *ctx = to_context(subdrv_dev); | ||
185 | |||
186 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
187 | |||
188 | if (mixer_ops && mixer_ops->wait_for_vblank) | ||
189 | mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); | ||
190 | } | ||
191 | |||
182 | static void drm_hdmi_mode_fixup(struct device *subdrv_dev, | 192 | static void drm_hdmi_mode_fixup(struct device *subdrv_dev, |
183 | struct drm_connector *connector, | 193 | struct drm_connector *connector, |
184 | const struct drm_display_mode *mode, | 194 | const struct drm_display_mode *mode, |
@@ -260,6 +270,7 @@ static struct exynos_drm_manager_ops drm_hdmi_manager_ops = { | |||
260 | .apply = drm_hdmi_apply, | 270 | .apply = drm_hdmi_apply, |
261 | .enable_vblank = drm_hdmi_enable_vblank, | 271 | .enable_vblank = drm_hdmi_enable_vblank, |
262 | .disable_vblank = drm_hdmi_disable_vblank, | 272 | .disable_vblank = drm_hdmi_disable_vblank, |
273 | .wait_for_vblank = drm_hdmi_wait_for_vblank, | ||
263 | .mode_fixup = drm_hdmi_mode_fixup, | 274 | .mode_fixup = drm_hdmi_mode_fixup, |
264 | .mode_set = drm_hdmi_mode_set, | 275 | .mode_set = drm_hdmi_mode_set, |
265 | .get_max_resol = drm_hdmi_get_max_resol, | 276 | .get_max_resol = drm_hdmi_get_max_resol, |
@@ -313,21 +324,10 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos) | |||
313 | ctx->enabled[win] = false; | 324 | ctx->enabled[win] = false; |
314 | } | 325 | } |
315 | 326 | ||
316 | static void drm_mixer_wait_for_vblank(struct device *subdrv_dev) | ||
317 | { | ||
318 | struct drm_hdmi_context *ctx = to_context(subdrv_dev); | ||
319 | |||
320 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
321 | |||
322 | if (mixer_ops && mixer_ops->wait_for_vblank) | ||
323 | mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx); | ||
324 | } | ||
325 | |||
326 | static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { | 327 | static struct exynos_drm_overlay_ops drm_hdmi_overlay_ops = { |
327 | .mode_set = drm_mixer_mode_set, | 328 | .mode_set = drm_mixer_mode_set, |
328 | .commit = drm_mixer_commit, | 329 | .commit = drm_mixer_commit, |
329 | .disable = drm_mixer_disable, | 330 | .disable = drm_mixer_disable, |
330 | .wait_for_vblank = drm_mixer_wait_for_vblank, | ||
331 | }; | 331 | }; |
332 | 332 | ||
333 | static struct exynos_drm_manager hdmi_manager = { | 333 | 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 54b522353e48..fcc3093ec8fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h | |||
@@ -65,10 +65,10 @@ struct exynos_mixer_ops { | |||
65 | int (*iommu_on)(void *ctx, bool enable); | 65 | int (*iommu_on)(void *ctx, bool enable); |
66 | int (*enable_vblank)(void *ctx, int pipe); | 66 | int (*enable_vblank)(void *ctx, int pipe); |
67 | void (*disable_vblank)(void *ctx); | 67 | void (*disable_vblank)(void *ctx); |
68 | void (*wait_for_vblank)(void *ctx); | ||
68 | void (*dpms)(void *ctx, int mode); | 69 | void (*dpms)(void *ctx, int mode); |
69 | 70 | ||
70 | /* overlay */ | 71 | /* overlay */ |
71 | void (*wait_for_vblank)(void *ctx); | ||
72 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); | 72 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); |
73 | void (*win_commit)(void *ctx, int zpos); | 73 | void (*win_commit)(void *ctx, int zpos); |
74 | void (*win_disable)(void *ctx, int zpos); | 74 | 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 40a6e1906fbb..b6f12fb54225 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -788,18 +788,6 @@ static void mixer_dpms(void *ctx, int mode) | |||
788 | } | 788 | } |
789 | } | 789 | } |
790 | 790 | ||
791 | static void mixer_wait_for_vblank(void *ctx) | ||
792 | { | ||
793 | struct mixer_context *mixer_ctx = ctx; | ||
794 | struct mixer_resources *res = &mixer_ctx->mixer_res; | ||
795 | int ret; | ||
796 | |||
797 | ret = wait_for((mixer_reg_read(res, MXR_INT_STATUS) & | ||
798 | MXR_INT_STATUS_VSYNC), 50); | ||
799 | if (ret < 0) | ||
800 | DRM_DEBUG_KMS("vblank wait timed out.\n"); | ||
801 | } | ||
802 | |||
803 | static void mixer_win_mode_set(void *ctx, | 791 | static void mixer_win_mode_set(void *ctx, |
804 | struct exynos_drm_overlay *overlay) | 792 | struct exynos_drm_overlay *overlay) |
805 | { | 793 | { |
@@ -885,15 +873,27 @@ static void mixer_win_disable(void *ctx, int win) | |||
885 | spin_unlock_irqrestore(&res->reg_slock, flags); | 873 | spin_unlock_irqrestore(&res->reg_slock, flags); |
886 | } | 874 | } |
887 | 875 | ||
876 | static void mixer_wait_for_vblank(void *ctx) | ||
877 | { | ||
878 | struct mixer_context *mixer_ctx = ctx; | ||
879 | struct mixer_resources *res = &mixer_ctx->mixer_res; | ||
880 | int ret; | ||
881 | |||
882 | ret = wait_for((mixer_reg_read(res, MXR_INT_STATUS) & | ||
883 | MXR_INT_STATUS_VSYNC), 50); | ||
884 | if (ret < 0) | ||
885 | DRM_DEBUG_KMS("vblank wait timed out.\n"); | ||
886 | } | ||
887 | |||
888 | static struct exynos_mixer_ops mixer_ops = { | 888 | static struct exynos_mixer_ops mixer_ops = { |
889 | /* manager */ | 889 | /* manager */ |
890 | .iommu_on = mixer_iommu_on, | 890 | .iommu_on = mixer_iommu_on, |
891 | .enable_vblank = mixer_enable_vblank, | 891 | .enable_vblank = mixer_enable_vblank, |
892 | .disable_vblank = mixer_disable_vblank, | 892 | .disable_vblank = mixer_disable_vblank, |
893 | .wait_for_vblank = mixer_wait_for_vblank, | ||
893 | .dpms = mixer_dpms, | 894 | .dpms = mixer_dpms, |
894 | 895 | ||
895 | /* overlay */ | 896 | /* overlay */ |
896 | .wait_for_vblank = mixer_wait_for_vblank, | ||
897 | .win_mode_set = mixer_win_mode_set, | 897 | .win_mode_set = mixer_win_mode_set, |
898 | .win_commit = mixer_win_commit, | 898 | .win_commit = mixer_win_commit, |
899 | .win_disable = mixer_win_disable, | 899 | .win_disable = mixer_win_disable, |