Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345613
b: refs/heads/master
c: db7e55a
h: refs/heads/master
i:
  345611: c19795c
v: v3
  • Loading branch information
Prathyush K authored and Inki Dae committed Dec 13, 2012
1 parent 4bc99bb commit e6abcf0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 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: db43fd1624ed502beed604cd8e77aa921f9e555f
refs/heads/master: db7e55ae527ccbca300eb5b15f5428b83325328d
40 changes: 39 additions & 1 deletion trunk/drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct fimd_win_data {
unsigned int buf_offsize;
unsigned int line_size; /* bytes */
bool enabled;
bool resume;
};

struct fimd_context {
Expand Down Expand Up @@ -596,6 +597,12 @@ static void fimd_win_disable(struct device *dev, int zpos)

win_data = &ctx->win_data[win];

if (ctx->suspended) {
/* do not resume this window*/
win_data->resume = false;
return;
}

/* protect windows */
val = readl(ctx->regs + SHADOWCON);
val |= SHADOWCON_WINx_PROTECT(win);
Expand Down Expand Up @@ -809,11 +816,38 @@ static int fimd_clock(struct fimd_context *ctx, bool enable)
return 0;
}

static void fimd_window_suspend(struct device *dev)
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
int i;

for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i];
win_data->resume = win_data->enabled;
fimd_win_disable(dev, i);
}
fimd_wait_for_vblank(dev);
}

static void fimd_window_resume(struct device *dev)
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
int i;

for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i];
win_data->enabled = win_data->resume;
win_data->resume = false;
}
}

static int fimd_activate(struct fimd_context *ctx, bool enable)
{
struct device *dev = ctx->subdrv.dev;
if (enable) {
int ret;
struct device *dev = ctx->subdrv.dev;

ret = fimd_clock(ctx, true);
if (ret < 0)
Expand All @@ -824,7 +858,11 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
/* if vblank was enabled status, enable it again. */
if (test_and_clear_bit(0, &ctx->irq_flags))
fimd_enable_vblank(dev);

fimd_window_resume(dev);
} else {
fimd_window_suspend(dev);

fimd_clock(ctx, false);
ctx->suspended = true;
}
Expand Down

0 comments on commit e6abcf0

Please sign in to comment.