diff options
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_mixer.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 21db89530fc7..c187ea33b748 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <drm/exynos_drm.h> | 35 | #include <drm/exynos_drm.h> |
36 | 36 | ||
37 | #include "exynos_drm_drv.h" | 37 | #include "exynos_drm_drv.h" |
38 | #include "exynos_drm_crtc.h" | ||
38 | #include "exynos_drm_hdmi.h" | 39 | #include "exynos_drm_hdmi.h" |
39 | #include "exynos_drm_iommu.h" | 40 | #include "exynos_drm_iommu.h" |
40 | 41 | ||
@@ -949,35 +950,6 @@ static struct exynos_mixer_ops mixer_ops = { | |||
949 | .win_disable = mixer_win_disable, | 950 | .win_disable = mixer_win_disable, |
950 | }; | 951 | }; |
951 | 952 | ||
952 | /* for pageflip event */ | ||
953 | static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc) | ||
954 | { | ||
955 | struct exynos_drm_private *dev_priv = drm_dev->dev_private; | ||
956 | struct drm_pending_vblank_event *e, *t; | ||
957 | struct timeval now; | ||
958 | unsigned long flags; | ||
959 | |||
960 | spin_lock_irqsave(&drm_dev->event_lock, flags); | ||
961 | |||
962 | list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list, | ||
963 | base.link) { | ||
964 | /* if event's pipe isn't same as crtc then ignore it. */ | ||
965 | if (crtc != e->pipe) | ||
966 | continue; | ||
967 | |||
968 | do_gettimeofday(&now); | ||
969 | e->event.sequence = 0; | ||
970 | e->event.tv_sec = now.tv_sec; | ||
971 | e->event.tv_usec = now.tv_usec; | ||
972 | |||
973 | list_move_tail(&e->base.link, &e->base.file_priv->event_list); | ||
974 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
975 | drm_vblank_put(drm_dev, crtc); | ||
976 | } | ||
977 | |||
978 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); | ||
979 | } | ||
980 | |||
981 | static irqreturn_t mixer_irq_handler(int irq, void *arg) | 953 | static irqreturn_t mixer_irq_handler(int irq, void *arg) |
982 | { | 954 | { |
983 | struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; | 955 | struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg; |
@@ -1006,7 +978,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) | |||
1006 | } | 978 | } |
1007 | 979 | ||
1008 | drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe); | 980 | drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe); |
1009 | mixer_finish_pageflip(drm_hdmi_ctx->drm_dev, ctx->pipe); | 981 | exynos_drm_crtc_finish_pageflip(drm_hdmi_ctx->drm_dev, |
982 | ctx->pipe); | ||
1010 | 983 | ||
1011 | /* set wait vsync event to zero and wake up queue. */ | 984 | /* set wait vsync event to zero and wake up queue. */ |
1012 | if (atomic_read(&ctx->wait_vsync_event)) { | 985 | if (atomic_read(&ctx->wait_vsync_event)) { |
@@ -1029,8 +1002,8 @@ out: | |||
1029 | return IRQ_HANDLED; | 1002 | return IRQ_HANDLED; |
1030 | } | 1003 | } |
1031 | 1004 | ||
1032 | static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | 1005 | static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, |
1033 | struct platform_device *pdev) | 1006 | struct platform_device *pdev) |
1034 | { | 1007 | { |
1035 | struct mixer_context *mixer_ctx = ctx->ctx; | 1008 | struct mixer_context *mixer_ctx = ctx->ctx; |
1036 | struct device *dev = &pdev->dev; | 1009 | struct device *dev = &pdev->dev; |
@@ -1081,8 +1054,8 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1081 | return 0; | 1054 | return 0; |
1082 | } | 1055 | } |
1083 | 1056 | ||
1084 | static int __devinit vp_resources_init(struct exynos_drm_hdmi_context *ctx, | 1057 | static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, |
1085 | struct platform_device *pdev) | 1058 | struct platform_device *pdev) |
1086 | { | 1059 | { |
1087 | struct mixer_context *mixer_ctx = ctx->ctx; | 1060 | struct mixer_context *mixer_ctx = ctx->ctx; |
1088 | struct device *dev = &pdev->dev; | 1061 | struct device *dev = &pdev->dev; |
@@ -1155,7 +1128,7 @@ static struct of_device_id mixer_match_types[] = { | |||
1155 | } | 1128 | } |
1156 | }; | 1129 | }; |
1157 | 1130 | ||
1158 | static int __devinit mixer_probe(struct platform_device *pdev) | 1131 | static int mixer_probe(struct platform_device *pdev) |
1159 | { | 1132 | { |
1160 | struct device *dev = &pdev->dev; | 1133 | struct device *dev = &pdev->dev; |
1161 | struct exynos_drm_hdmi_context *drm_hdmi_ctx; | 1134 | struct exynos_drm_hdmi_context *drm_hdmi_ctx; |
@@ -1316,6 +1289,6 @@ struct platform_driver mixer_driver = { | |||
1316 | .of_match_table = mixer_match_types, | 1289 | .of_match_table = mixer_match_types, |
1317 | }, | 1290 | }, |
1318 | .probe = mixer_probe, | 1291 | .probe = mixer_probe, |
1319 | .remove = __devexit_p(mixer_remove), | 1292 | .remove = mixer_remove, |
1320 | .id_table = mixer_driver_types, | 1293 | .id_table = mixer_driver_types, |
1321 | }; | 1294 | }; |