Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276019
b: refs/heads/master
c: 483b88f
h: refs/heads/master
i:
  276017: 6d4d455
  276015: 214d6e8
v: v3
  • Loading branch information
Inki Dae committed Nov 15, 2011
1 parent 2bd9d07 commit 97d992f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c871127e994a678b82104a4110eb7fcc87f05ad
refs/heads/master: 483b88f86e1682241bfa0848e348aa175257c6e7
46 changes: 36 additions & 10 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ static void fimd_win_commit(struct device *dev)
static void fimd_win_disable(struct device *dev)
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
struct drm_device *drm_dev = subdrv->drm_dev;
struct exynos_drm_manager *manager = &subdrv->manager;
int win = ctx->default_win;
u32 val;

Expand All @@ -456,8 +458,6 @@ static void fimd_win_disable(struct device *dev)
if (win < 0 || win > WINDOWS_NR)
return;

win_data = &ctx->win_data[win];

/* protect windows */
val = readl(ctx->regs + SHADOWCON);
val |= SHADOWCON_WINx_PROTECT(win);
Expand All @@ -473,6 +473,29 @@ static void fimd_win_disable(struct device *dev)
val &= ~SHADOWCON_CHx_ENABLE(win);
val &= ~SHADOWCON_WINx_PROTECT(win);
writel(val, ctx->regs + SHADOWCON);

/* fimd dma off. */
val = readl(ctx->regs + VIDCON0);
val &= ~(VIDCON0_ENVID | VIDCON0_ENVID_F);
writel(val, ctx->regs + VIDCON0);

/*
* if vblank is enabled status with dma off then
* it disables vsync interrupt.
*/
if (drm_dev->vblank_enabled[manager->pipe] &&
atomic_read(&drm_dev->vblank_refcount[manager->pipe])) {
drm_vblank_put(drm_dev, manager->pipe);

/*
* if vblank_disable_allowed is 0 then disable vsync interrupt
* right now else the vsync interrupt would be disabled by drm
* timer once a current process gives up ownershop of
* vblank event.
*/
if (!drm_dev->vblank_disable_allowed)
drm_vblank_off(drm_dev, manager->pipe);
}
}

static struct exynos_drm_overlay_ops fimd_overlay_ops = {
Expand Down Expand Up @@ -528,6 +551,16 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
/* VSYNC interrupt */
writel(VIDINTCON1_INT_FRAME, ctx->regs + VIDINTCON1);

/*
* in case that vblank_disable_allowed is 1, it could induce
* the problem that manager->pipe could be -1 because with
* disable callback, vsync interrupt isn't disabled and at this moment,
* vsync interrupt could occur. the vsync interrupt would be disabled
* by timer handler later.
*/
if (manager->pipe == -1)
return IRQ_HANDLED;

drm_handle_vblank(drm_dev, manager->pipe);
fimd_finish_pageflip(drm_dev, manager->pipe);

Expand All @@ -548,13 +581,6 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
*/
drm_dev->irq_enabled = 1;

/*
* with vblank_disable_allowed = 1, vblank interrupt will be disabled
* by drm timer once a current process gives up ownership of
* vblank event.(drm_vblank_put function was called)
*/
drm_dev->vblank_disable_allowed = 1;

return 0;
}

Expand Down

0 comments on commit 97d992f

Please sign in to comment.