]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/exynos: use KMS version of DRM vblanks functions
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Thu, 16 Jul 2015 15:23:32 +0000 (12:23 -0300)
committerInki Dae <inki.dae@samsung.com>
Sun, 16 Aug 2015 01:23:34 +0000 (10:23 +0900)
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>
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
drivers/gpu/drm/exynos/exynos7_drm_decon.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_crtc.h
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_mixer.c

index b2794f815b3c466f4ceef28f3ad606fa564caf30..b00800b72950c153214ee5646f1f6d28c11f1d37 100644 (file)
@@ -407,7 +407,7 @@ void decon_te_irq_handler(struct exynos_drm_crtc *crtc)
                writel(val, ctx->addr + DECON_TRIGCON);
        }
 
-       drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+       drm_crtc_handle_vblank(&ctx->crtc->base);
 }
 
 static 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)
 
        val = readl(ctx->addr + DECON_VIDINTCON1);
        if (val & VIDINTCON1_INTFRMPEND) {
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
 
                /* clear */
                writel(VIDINTCON1_INTFRMPEND, ctx->addr + DECON_VIDINTCON1);
@@ -553,7 +553,7 @@ static irqreturn_t decon_lcd_sys_irq_handler(int irq, void *dev_id)
 
        val = readl(ctx->addr + DECON_VIDINTCON1);
        if (val & VIDINTCON1_INTFRMDONEPEND) {
-               exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+               exynos_drm_crtc_finish_pageflip(ctx->crtc);
 
                /* clear */
                writel(VIDINTCON1_INTFRMDONEPEND,
index a80b9184c86619178f828136dd75d18dabc93c61..1cd78b6a16350f7173f589c343285a17eeb53159 100644 (file)
@@ -643,8 +643,8 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
                goto out;
 
        if (!ctx->i80_if) {
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
-               exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
+               exynos_drm_crtc_finish_pageflip(ctx->crtc);
 
                /* set wait vsync event to zero and wake up queue. */
                if (atomic_read(&ctx->wait_vsync_event)) {
index f6017262ac02ffe56793ee01006fce5c14892630..fb213502082d367766619dccf86e5a5fda3718a3 100644 (file)
@@ -195,24 +195,22 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
                exynos_crtc->ops->disable_vblank(exynos_crtc);
 }
 
-void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
+void exynos_drm_crtc_finish_pageflip(struct exynos_drm_crtc *exynos_crtc)
 {
-       struct exynos_drm_private *dev_priv = dev->dev_private;
-       struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
-       struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
+       struct drm_crtc *crtc = &exynos_crtc->base;
        unsigned long flags;
 
-       spin_lock_irqsave(&dev->event_lock, flags);
+       spin_lock_irqsave(&crtc->dev->event_lock, flags);
        if (exynos_crtc->event) {
 
-               drm_send_vblank_event(dev, pipe, exynos_crtc->event);
-               drm_vblank_put(dev, pipe);
+               drm_crtc_send_vblank_event(crtc, exynos_crtc->event);
+               drm_crtc_vblank_put(crtc);
                wake_up(&exynos_crtc->pending_flip_queue);
 
        }
 
        exynos_crtc->event = NULL;
-       spin_unlock_irqrestore(&dev->event_lock, flags);
+       spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 }
 
 void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb)
index 0f3aa70818e31059bfc6369c258dcd326fa07d53..d01d49a69298c02292f372e496dac404a38008c2 100644 (file)
@@ -25,7 +25,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
                                        void *context);
 int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe);
 void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
-void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);
+void exynos_drm_crtc_finish_pageflip(struct exynos_drm_crtc *exynos_crtc);
 void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);
 
 /* This function gets pipe value to crtc device matched with out_type. */
index 337af025a594161f1a37abd7e43f34f2f43f5cd9..b79f472d3a7477af1cb7a6c6cbc57148de88d30f 100644 (file)
@@ -855,7 +855,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc)
        }
 
        if (test_bit(0, &ctx->irq_flags))
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
 }
 
 static 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)
                goto out;
 
        if (ctx->i80_if) {
-               exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+               exynos_drm_crtc_finish_pageflip(ctx->crtc);
 
                /* Exits triggering mode */
                atomic_set(&ctx->triggering, 0);
        } else {
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
-               exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
+               exynos_drm_crtc_finish_pageflip(ctx->crtc);
 
                /* set wait vsync event to zero and wake up queue. */
                if (atomic_read(&ctx->wait_vsync_event)) {
index 3413393d8a165ba5041222d8c6635b9d33d55969..9b97105ddc5445639ce64d06be4168e4d080c449 100644 (file)
@@ -196,7 +196,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
        mutex_lock(&ctx->lock);
 
        if (ctx->direct_vblank) {
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
                ctx->direct_vblank = false;
                mutex_unlock(&ctx->lock);
                return;
@@ -204,7 +204,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
 
        mutex_unlock(&ctx->lock);
 
-       exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+       exynos_drm_crtc_finish_pageflip(ctx->crtc);
 }
 
 static int vidi_show_connection(struct device *dev,
index 370e0a306ad0e3109c3d5d58ea12afa2246f77da..ca12540e384b48d6ca4d454aa8f374379bec9748 100644 (file)
@@ -738,8 +738,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
                                goto out;
                }
 
-               drm_handle_vblank(ctx->drm_dev, ctx->pipe);
-               exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
+               exynos_drm_crtc_finish_pageflip(ctx->crtc);
 
                /* set wait vsync event to zero and wake up queue. */
                if (atomic_read(&ctx->wait_vsync_event)) {