Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345611
b: refs/heads/master
c: 01ce113
h: refs/heads/master
i:
  345609: 8da45d9
  345607: 361b53b
v: v3
  • Loading branch information
Prathyush K authored and Inki Dae committed Dec 13, 2012
1 parent 08d088a commit c19795c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 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: 6e95d5e6f572d6bf1e1b0ff4c94ded8e4841d630
refs/heads/master: 01ce113ca5b18aea4c97dea62287394ca4f8ad7f
25 changes: 21 additions & 4 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ struct fimd_context {
u32 vidcon1;
bool suspended;
struct mutex lock;
wait_queue_head_t wait_vsync_queue;
atomic_t wait_vsync_event;

struct exynos_drm_panel_info *panel;
};
Expand Down Expand Up @@ -311,11 +313,19 @@ static void fimd_disable_vblank(struct device *dev)
static void fimd_wait_for_vblank(struct device *dev)
{
struct fimd_context *ctx = get_fimd_context(dev);
int ret;

ret = wait_for((__raw_readl(ctx->regs + VIDCON1) &
VIDCON1_VSTATUS_VSYNC), 50);
if (ret < 0)
if (ctx->suspended)
return;

atomic_set(&ctx->wait_vsync_event, 1);

/*
* wait for FIMD to signal VSYNC interrupt or return after
* timeout which is set to 50ms (refresh rate of 20).
*/
if (!wait_event_timeout(ctx->wait_vsync_queue,
!atomic_read(&ctx->wait_vsync_event),
DRM_HZ/20))
DRM_DEBUG_KMS("vblank wait timed out.\n");
}

Expand Down Expand Up @@ -667,6 +677,11 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
drm_handle_vblank(drm_dev, manager->pipe);
fimd_finish_pageflip(drm_dev, manager->pipe);

/* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) {
atomic_set(&ctx->wait_vsync_event, 0);
DRM_WAKEUP(&ctx->wait_vsync_queue);
}
out:
return IRQ_HANDLED;
}
Expand Down Expand Up @@ -885,6 +900,8 @@ static int __devinit fimd_probe(struct platform_device *pdev)
ctx->vidcon1 = pdata->vidcon1;
ctx->default_win = pdata->default_win;
ctx->panel = panel;
DRM_INIT_WAITQUEUE(&ctx->wait_vsync_queue);
atomic_set(&ctx->wait_vsync_event, 0);

subdrv = &ctx->subdrv;

Expand Down

0 comments on commit c19795c

Please sign in to comment.