aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2015-07-16 11:23:32 -0400
committerInki Dae <inki.dae@samsung.com>2015-08-15 21:23:34 -0400
commiteafd540aeaae6f1c4d04fdf3959419716d23cdc5 (patch)
treeb83de578a539675a07d1f1e025051ab892bd2b07
parent451a8c0c59b3feebb5bf6a1ce1335e9f3e428355 (diff)
drm/exynos: use KMS version of DRM vblanks functions
Get rid of legacy DRM vblank function that are less clear to use. The new ones basically requires only the crtc as parameters. It also clean ups exynos_drm_crtc_finish_pageflip() parameters as a consequence. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos5433_drm_decon.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos7_drm_decon.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.c14
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.h2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c8
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c4
7 files changed, 20 insertions, 22 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index b2794f815b3c..b00800b72950 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -407,7 +407,7 @@ void decon_te_irq_handler(struct exynos_drm_crtc *crtc)
407 writel(val, ctx->addr + DECON_TRIGCON); 407 writel(val, ctx->addr + DECON_TRIGCON);
408 } 408 }
409 409
410 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 410 drm_crtc_handle_vblank(&ctx->crtc->base);
411} 411}
412 412
413static void decon_clear_channels(struct exynos_drm_crtc *crtc) 413static void decon_clear_channels(struct exynos_drm_crtc *crtc)
@@ -533,7 +533,7 @@ static irqreturn_t decon_vsync_irq_handler(int irq, void *dev_id)
533 533
534 val = readl(ctx->addr + DECON_VIDINTCON1); 534 val = readl(ctx->addr + DECON_VIDINTCON1);
535 if (val & VIDINTCON1_INTFRMPEND) { 535 if (val & VIDINTCON1_INTFRMPEND) {
536 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 536 drm_crtc_handle_vblank(&ctx->crtc->base);
537 537
538 /* clear */ 538 /* clear */
539 writel(VIDINTCON1_INTFRMPEND, ctx->addr + DECON_VIDINTCON1); 539 writel(VIDINTCON1_INTFRMPEND, ctx->addr + DECON_VIDINTCON1);
@@ -553,7 +553,7 @@ static irqreturn_t decon_lcd_sys_irq_handler(int irq, void *dev_id)
553 553
554 val = readl(ctx->addr + DECON_VIDINTCON1); 554 val = readl(ctx->addr + DECON_VIDINTCON1);
555 if (val & VIDINTCON1_INTFRMDONEPEND) { 555 if (val & VIDINTCON1_INTFRMDONEPEND) {
556 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 556 exynos_drm_crtc_finish_pageflip(ctx->crtc);
557 557
558 /* clear */ 558 /* clear */
559 writel(VIDINTCON1_INTFRMDONEPEND, 559 writel(VIDINTCON1_INTFRMDONEPEND,
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index a80b9184c866..1cd78b6a1635 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -643,8 +643,8 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
643 goto out; 643 goto out;
644 644
645 if (!ctx->i80_if) { 645 if (!ctx->i80_if) {
646 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 646 drm_crtc_handle_vblank(&ctx->crtc->base);
647 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 647 exynos_drm_crtc_finish_pageflip(ctx->crtc);
648 648
649 /* set wait vsync event to zero and wake up queue. */ 649 /* set wait vsync event to zero and wake up queue. */
650 if (atomic_read(&ctx->wait_vsync_event)) { 650 if (atomic_read(&ctx->wait_vsync_event)) {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index f6017262ac02..fb213502082d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -195,24 +195,22 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
195 exynos_crtc->ops->disable_vblank(exynos_crtc); 195 exynos_crtc->ops->disable_vblank(exynos_crtc);
196} 196}
197 197
198void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe) 198void exynos_drm_crtc_finish_pageflip(struct exynos_drm_crtc *exynos_crtc)
199{ 199{
200 struct exynos_drm_private *dev_priv = dev->dev_private; 200 struct drm_crtc *crtc = &exynos_crtc->base;
201 struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
202 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
203 unsigned long flags; 201 unsigned long flags;
204 202
205 spin_lock_irqsave(&dev->event_lock, flags); 203 spin_lock_irqsave(&crtc->dev->event_lock, flags);
206 if (exynos_crtc->event) { 204 if (exynos_crtc->event) {
207 205
208 drm_send_vblank_event(dev, pipe, exynos_crtc->event); 206 drm_crtc_send_vblank_event(crtc, exynos_crtc->event);
209 drm_vblank_put(dev, pipe); 207 drm_crtc_vblank_put(crtc);
210 wake_up(&exynos_crtc->pending_flip_queue); 208 wake_up(&exynos_crtc->pending_flip_queue);
211 209
212 } 210 }
213 211
214 exynos_crtc->event = NULL; 212 exynos_crtc->event = NULL;
215 spin_unlock_irqrestore(&dev->event_lock, flags); 213 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
216} 214}
217 215
218void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb) 216void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
index 0f3aa70818e3..d01d49a69298 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h
@@ -25,7 +25,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
25 void *context); 25 void *context);
26int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); 26int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe);
27void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); 27void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
28void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe); 28void exynos_drm_crtc_finish_pageflip(struct exynos_drm_crtc *exynos_crtc);
29void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb); 29void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);
30 30
31/* This function gets pipe value to crtc device matched with out_type. */ 31/* This function gets pipe value to crtc device matched with out_type. */
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 337af025a594..b79f472d3a74 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -855,7 +855,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc)
855 } 855 }
856 856
857 if (test_bit(0, &ctx->irq_flags)) 857 if (test_bit(0, &ctx->irq_flags))
858 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 858 drm_crtc_handle_vblank(&ctx->crtc->base);
859} 859}
860 860
861static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable) 861static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable)
@@ -905,13 +905,13 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
905 goto out; 905 goto out;
906 906
907 if (ctx->i80_if) { 907 if (ctx->i80_if) {
908 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 908 exynos_drm_crtc_finish_pageflip(ctx->crtc);
909 909
910 /* Exits triggering mode */ 910 /* Exits triggering mode */
911 atomic_set(&ctx->triggering, 0); 911 atomic_set(&ctx->triggering, 0);
912 } else { 912 } else {
913 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 913 drm_crtc_handle_vblank(&ctx->crtc->base);
914 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 914 exynos_drm_crtc_finish_pageflip(ctx->crtc);
915 915
916 /* set wait vsync event to zero and wake up queue. */ 916 /* set wait vsync event to zero and wake up queue. */
917 if (atomic_read(&ctx->wait_vsync_event)) { 917 if (atomic_read(&ctx->wait_vsync_event)) {
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 3413393d8a16..9b97105ddc54 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -196,7 +196,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
196 mutex_lock(&ctx->lock); 196 mutex_lock(&ctx->lock);
197 197
198 if (ctx->direct_vblank) { 198 if (ctx->direct_vblank) {
199 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 199 drm_crtc_handle_vblank(&ctx->crtc->base);
200 ctx->direct_vblank = false; 200 ctx->direct_vblank = false;
201 mutex_unlock(&ctx->lock); 201 mutex_unlock(&ctx->lock);
202 return; 202 return;
@@ -204,7 +204,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
204 204
205 mutex_unlock(&ctx->lock); 205 mutex_unlock(&ctx->lock);
206 206
207 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 207 exynos_drm_crtc_finish_pageflip(ctx->crtc);
208} 208}
209 209
210static int vidi_show_connection(struct device *dev, 210static int vidi_show_connection(struct device *dev,
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 370e0a306ad0..ca12540e384b 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -738,8 +738,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
738 goto out; 738 goto out;
739 } 739 }
740 740
741 drm_handle_vblank(ctx->drm_dev, ctx->pipe); 741 drm_crtc_handle_vblank(&ctx->crtc->base);
742 exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); 742 exynos_drm_crtc_finish_pageflip(ctx->crtc);
743 743
744 /* set wait vsync event to zero and wake up queue. */ 744 /* set wait vsync event to zero and wake up queue. */
745 if (atomic_read(&ctx->wait_vsync_event)) { 745 if (atomic_read(&ctx->wait_vsync_event)) {