提交 8cab90fd 编写于 作者: T Tomi Valkeinen

OMAP: DSS2: Fix update area calculations with multiple scaled overlays

When there are multiple scaled overlays simply checking whether the update
area intersects any of them in order is not enough. If eg. VID1 starts out
completely outside the update area but VID2 causes the update area to
increase in such a way that VID1 now falls partially within the increased
update area VID1 should be rechecked and the update area possibly
increased even further to fully encompass VID1. So simply keep looping
over the overlays until such time that none of the overlays caused the
update area to change.
Signed-off-by: NVille Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 75c7d59d
...@@ -972,6 +972,7 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev, ...@@ -972,6 +972,7 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev,
int i; int i;
u16 x, y, w, h; u16 x, y, w, h;
unsigned long flags; unsigned long flags;
bool area_changed;
x = *xi; x = *xi;
y = *yi; y = *yi;
...@@ -992,70 +993,84 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev, ...@@ -992,70 +993,84 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev,
spin_lock_irqsave(&dss_cache.lock, flags); spin_lock_irqsave(&dss_cache.lock, flags);
/* We need to show the whole overlay if it is scaled. So look for /*
* those, and make the update area larger if found. * Execute the outer loop until the inner loop has completed
* Also mark the overlay cache dirty */ * once without increasing the update area. This will ensure that
for (i = 0; i < num_ovls; ++i) { * all scaled overlays end up completely within the update area.
unsigned x1, y1, x2, y2; */
unsigned outw, outh; do {
area_changed = false;
oc = &dss_cache.overlay_cache[i];
/* We need to show the whole overlay if it is scaled. So look
if (oc->channel != mgr->id) * for those, and make the update area larger if found.
continue; * Also mark the overlay cache dirty */
for (i = 0; i < num_ovls; ++i) {
oc->dirty = true; unsigned x1, y1, x2, y2;
unsigned outw, outh;
if (!oc->enabled)
continue; oc = &dss_cache.overlay_cache[i];
if (!dispc_is_overlay_scaled(oc)) if (oc->channel != mgr->id)
continue; continue;
outw = oc->out_width == 0 ? oc->width : oc->out_width; oc->dirty = true;
outh = oc->out_height == 0 ? oc->height : oc->out_height;
if (!oc->enabled)
/* is the overlay outside the update region? */ continue;
if (!rectangle_intersects(x, y, w, h,
oc->pos_x, oc->pos_y, if (!dispc_is_overlay_scaled(oc))
outw, outh)) continue;
continue;
outw = oc->out_width == 0 ?
/* if the overlay totally inside the update region? */ oc->width : oc->out_width;
if (rectangle_subset(oc->pos_x, oc->pos_y, outw, outh, outh = oc->out_height == 0 ?
x, y, w, h)) oc->height : oc->out_height;
continue;
/* is the overlay outside the update region? */
if (x > oc->pos_x) if (!rectangle_intersects(x, y, w, h,
x1 = oc->pos_x; oc->pos_x, oc->pos_y,
else outw, outh))
x1 = x; continue;
if (y > oc->pos_y) /* if the overlay totally inside the update region? */
y1 = oc->pos_y; if (rectangle_subset(oc->pos_x, oc->pos_y, outw, outh,
else x, y, w, h))
y1 = y; continue;
if ((x + w) < (oc->pos_x + outw)) if (x > oc->pos_x)
x2 = oc->pos_x + outw; x1 = oc->pos_x;
else else
x2 = x + w; x1 = x;
if ((y + h) < (oc->pos_y + outh)) if (y > oc->pos_y)
y2 = oc->pos_y + outh; y1 = oc->pos_y;
else else
y2 = y + h; y1 = y;
x = x1; if ((x + w) < (oc->pos_x + outw))
y = y1; x2 = oc->pos_x + outw;
w = x2 - x1; else
h = y2 - y1; x2 = x + w;
make_even(&x, &w); if ((y + h) < (oc->pos_y + outh))
y2 = oc->pos_y + outh;
DSSDBG("changing upd area due to ovl(%d) scaling %d,%d %dx%d\n", else
y2 = y + h;
x = x1;
y = y1;
w = x2 - x1;
h = y2 - y1;
make_even(&x, &w);
DSSDBG("changing upd area due to ovl(%d) "
"scaling %d,%d %dx%d\n",
i, x, y, w, h); i, x, y, w, h);
}
area_changed = true;
}
} while (area_changed);
mc = &dss_cache.manager_cache[mgr->id]; mc = &dss_cache.manager_cache[mgr->id];
mc->do_manual_update = true; mc->do_manual_update = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册