Skip to content

Commit

Permalink
OMAPDSS: DSSCOMP: support of MEM2MEM mode with blanked pannel
Browse files Browse the repository at this point in the history
This change implements MEM2MEM mode for pannels blanked case.

Change-Id: Ia1e0034c73f196d877283e5ecc974f277988265e
Signed-off-by: Artem Rudenko <[email protected]>
  • Loading branch information
Artem Rudenko authored and Dmytro Kedrovskyi committed Sep 12, 2012
1 parent 722eab4 commit ca1b14c
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/video/omap2/dsscomp/dsscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct dsscomp_data {
void (*extra_cb)(void *data, int status);
void *extra_cb_data;
bool must_apply; /* whether composition must be applied */

bool m2m_only;
#ifdef CONFIG_DEBUG_FS
struct list_head dbg_q;
u32 dbg_used;
Expand Down
68 changes: 65 additions & 3 deletions drivers/video/omap2/dsscomp/gralloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
ion_phys_addr_t phys = 0;
size_t tiler2d_size;
struct tiler_view_t view;
u32 wb_mgr_ix;

/* reserve tiler areas if not already done so */
dsscomp_gralloc_init(cdev);
Expand Down Expand Up @@ -348,8 +349,45 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
log_event(0, ms, gsync, "new in %pf (refs=1)",
(u32) dsscomp_gralloc_queue, 0);

/* by default our auxiliary variable has wrong value */
wb_mgr_ix = MAX_MANAGERS;

/* check the composition
* if composition has wb and connected to manager
* in m2m mode while blanking - do not skip the
* composition for this manager */
if (blanked) {
for (i = 0; i < d->num_ovls; i++) {
if (d->ovls[i].cfg.ix == 4 &&
d->ovls[i].cfg.wb_mode ==
OMAP_WB_MEM2MEM_MODE &&
d->ovls[i].cfg.enabled) {
wb_mgr_ix = d->ovls[i].cfg.mgr_ix;
break;
}
}

/* If current composition contains no WB, but previous
* composition contains WB, then we should pass this
* composition */
for (ch = 0; ch < MAX_MANAGERS; ch++) {
if (wb_mgr_ix >= MAX_MANAGERS &&
ovl_use_mask[ch] & (1 << 4)) {
wb_mgr_ix = ch;
break;
}
}

if (wb_mgr_ix < MAX_MANAGERS)
for (ch = 0; ch < MAX_MANAGERS; ch++) {
if (ch != wb_mgr_ix)
ovl_use_mask[ch] = 0;
}
}

/* ignore frames while we are blanked */
skip = blanked;
skip = blanked && wb_mgr_ix >= MAX_MANAGERS;

if (skip && (debug & DEBUG_PHASES))
dev_info(DEV(cdev), "[%p,%08x] ignored\n", gsync, d->sync_id);

Expand All @@ -365,7 +403,8 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
memset(comp, 0, sizeof(comp));
memset(ovl_new_use_mask, 0, sizeof(ovl_new_use_mask));

if (skip || !dsscomp_is_any_device_active())
if ((skip || !dsscomp_is_any_device_active()) &&
wb_mgr_ix >= MAX_MANAGERS)
goto skip_comp;

d->mode = DSSCOMP_SETUP_DISPLAY;
Expand All @@ -388,6 +427,11 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
continue;
}
channels[i] = ch = mgr->id;

if (wb_mgr_ix < MAX_MANAGERS && blanked)
if (wb_mgr_ix != i)
continue;

mgr_set_mask |= 1 << ch;

/* swap red & blue if requested */
Expand All @@ -397,6 +441,14 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,

/* create dsscomp objects for set managers (including active ones) */
for (ch = 0; ch < MAX_MANAGERS; ch++) {

if (wb_mgr_ix < MAX_MANAGERS && blanked) {
if (wb_mgr_ix != ch) {
comp[ch] = NULL;
continue;
}
}

if (!(mgr_set_mask & (1 << ch)) && !ovl_use_mask[ch])
continue;

Expand Down Expand Up @@ -428,6 +480,10 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
/* configure manager data from gralloc composition */
for (i = 0; i < d->num_mgrs; i++) {
ch = channels[i];

if (!comp[ch])
continue;

r = dsscomp_set_mgr(comp[ch], d->mgrs + i);
if (r)
dev_err(DEV(cdev), "failed to set mgr%d (%d)\n", ch, r);
Expand Down Expand Up @@ -508,7 +564,7 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
/* map non-TILER buffers to 1D */

/* skip 2D and disabled layers */
if (!pas[i] || !oi->cfg.enabled)
if (!pas || !pas[i] || !oi->cfg.enabled)
goto skip_map1d;

if (!slot) {
Expand Down Expand Up @@ -590,6 +646,11 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
log_event(0, ms, gsync, "++refs=%d for [%p]",
atomic_read(&gsync->refs), (u32) comp[ch]);

if (wb_mgr_ix < MAX_MANAGERS && blanked)
comp[ch]->m2m_only = true;
else
comp[ch]->m2m_only = false;

if (ch == 1 && clone_wq && phys) {
/* start work-queue */
struct dsscomp_clone_work *wk = kzalloc(sizeof(*wk),
Expand Down Expand Up @@ -622,6 +683,7 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
else
ovl_use_mask[ch] = ovl_new_use_mask[ch];
}

skip_comp:
/* release sync object ref - this completes unapplied compositions */
dsscomp_gralloc_cb(gsync, DSS_COMPLETION_RELEASED);
Expand Down
8 changes: 8 additions & 0 deletions drivers/video/omap2/dsscomp/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,14 @@ int dsscomp_apply(dsscomp_t comp)
if (!d->win.h && !d->win.y)
d->win.h = dssdev->panel.timings.y_res - d->win.y;

/* Report m2m_only mode to a manager. A manager will apply a new
* composition and will free a previous composition immediately. */
mgr->m2m_only = comp->m2m_only;

/* turn on clock if m2m_only mode is enabled (LCD is OFF) */
/* turn off clock if LCD goes ON and prev comp was m2m_only */
dss_m2m_clock_handling(mgr);

if (wb_apply) {
struct omap_writeback_info wb_info;
struct omap_writeback *wb;
Expand Down

0 comments on commit ca1b14c

Please sign in to comment.