Commit eafd540a authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Inki Dae

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: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 451a8c0c
...@@ -407,7 +407,7 @@ void decon_te_irq_handler(struct exynos_drm_crtc *crtc) ...@@ -407,7 +407,7 @@ void decon_te_irq_handler(struct exynos_drm_crtc *crtc)
writel(val, ctx->addr + DECON_TRIGCON); 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) 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) ...@@ -533,7 +533,7 @@ static irqreturn_t decon_vsync_irq_handler(int irq, void *dev_id)
val = readl(ctx->addr + DECON_VIDINTCON1); val = readl(ctx->addr + DECON_VIDINTCON1);
if (val & VIDINTCON1_INTFRMPEND) { if (val & VIDINTCON1_INTFRMPEND) {
drm_handle_vblank(ctx->drm_dev, ctx->pipe); drm_crtc_handle_vblank(&ctx->crtc->base);
/* clear */ /* clear */
writel(VIDINTCON1_INTFRMPEND, ctx->addr + DECON_VIDINTCON1); 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,7 +553,7 @@ static irqreturn_t decon_lcd_sys_irq_handler(int irq, void *dev_id)
val = readl(ctx->addr + DECON_VIDINTCON1); val = readl(ctx->addr + DECON_VIDINTCON1);
if (val & VIDINTCON1_INTFRMDONEPEND) { if (val & VIDINTCON1_INTFRMDONEPEND) {
exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); exynos_drm_crtc_finish_pageflip(ctx->crtc);
/* clear */ /* clear */
writel(VIDINTCON1_INTFRMDONEPEND, writel(VIDINTCON1_INTFRMDONEPEND,
......
...@@ -643,8 +643,8 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id) ...@@ -643,8 +643,8 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
goto out; goto out;
if (!ctx->i80_if) { if (!ctx->i80_if) {
drm_handle_vblank(ctx->drm_dev, ctx->pipe); drm_crtc_handle_vblank(&ctx->crtc->base);
exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); exynos_drm_crtc_finish_pageflip(ctx->crtc);
/* set wait vsync event to zero and wake up queue. */ /* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) { if (atomic_read(&ctx->wait_vsync_event)) {
......
...@@ -195,24 +195,22 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) ...@@ -195,24 +195,22 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
exynos_crtc->ops->disable_vblank(exynos_crtc); 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 *crtc = &exynos_crtc->base;
struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&crtc->dev->event_lock, flags);
if (exynos_crtc->event) { if (exynos_crtc->event) {
drm_send_vblank_event(dev, pipe, exynos_crtc->event); drm_crtc_send_vblank_event(crtc, exynos_crtc->event);
drm_vblank_put(dev, pipe); drm_crtc_vblank_put(crtc);
wake_up(&exynos_crtc->pending_flip_queue); wake_up(&exynos_crtc->pending_flip_queue);
} }
exynos_crtc->event = NULL; 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) void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb)
......
...@@ -25,7 +25,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, ...@@ -25,7 +25,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
void *context); void *context);
int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); 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_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); void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);
/* This function gets pipe value to crtc device matched with out_type. */ /* This function gets pipe value to crtc device matched with out_type. */
......
...@@ -855,7 +855,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc) ...@@ -855,7 +855,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc)
} }
if (test_bit(0, &ctx->irq_flags)) 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) 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) ...@@ -905,13 +905,13 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
goto out; goto out;
if (ctx->i80_if) { if (ctx->i80_if) {
exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); exynos_drm_crtc_finish_pageflip(ctx->crtc);
/* Exits triggering mode */ /* Exits triggering mode */
atomic_set(&ctx->triggering, 0); atomic_set(&ctx->triggering, 0);
} else { } else {
drm_handle_vblank(ctx->drm_dev, ctx->pipe); drm_crtc_handle_vblank(&ctx->crtc->base);
exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); exynos_drm_crtc_finish_pageflip(ctx->crtc);
/* set wait vsync event to zero and wake up queue. */ /* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) { if (atomic_read(&ctx->wait_vsync_event)) {
......
...@@ -196,7 +196,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work) ...@@ -196,7 +196,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
mutex_lock(&ctx->lock); mutex_lock(&ctx->lock);
if (ctx->direct_vblank) { if (ctx->direct_vblank) {
drm_handle_vblank(ctx->drm_dev, ctx->pipe); drm_crtc_handle_vblank(&ctx->crtc->base);
ctx->direct_vblank = false; ctx->direct_vblank = false;
mutex_unlock(&ctx->lock); mutex_unlock(&ctx->lock);
return; return;
...@@ -204,7 +204,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work) ...@@ -204,7 +204,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
mutex_unlock(&ctx->lock); 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, static int vidi_show_connection(struct device *dev,
......
...@@ -738,8 +738,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) ...@@ -738,8 +738,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
goto out; goto out;
} }
drm_handle_vblank(ctx->drm_dev, ctx->pipe); drm_crtc_handle_vblank(&ctx->crtc->base);
exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); exynos_drm_crtc_finish_pageflip(ctx->crtc);
/* set wait vsync event to zero and wake up queue. */ /* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) { if (atomic_read(&ctx->wait_vsync_event)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment