Commit 4ed569ee authored by Qiang Yu's avatar Qiang Yu

lima: don't use damage system when full damage

Some time weston set full damage region. It is
more effient to use the cached pp stream instead
of dynamically create one.
Reviewed-and-Tested-by: Vasily Khoruzhick's avatarVasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu's avatarQiang Yu <yuq825@gmail.com>
parent afbaed90
......@@ -365,6 +365,20 @@ lima_resource_set_damage_region(struct pipe_screen *pscreen,
if (!nrects)
return;
/* check full damage
*
* TODO: currently only check if there is any single damage
* region that can cover the full render target; there may
* be some accurate way, but a single window size damage
* region is most of the case from weston
*/
for (i = 0; i < nrects; i++) {
if (rects[i].x <= 0 && rects[i].y <= 0 &&
rects[i].x + rects[i].width >= pres->width0 &&
rects[i].y + rects[i].height >= pres->height0)
return;
}
damage->region = CALLOC(nrects, sizeof(*damage->region));
if (!damage->region)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment