aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima
diff options
context:
space:
mode:
authorQiang Yu <[email protected]>2019-08-25 17:24:26 +0800
committerQiang Yu <[email protected]>2019-09-23 09:48:50 +0800
commit4ed569eed771a1b70b485430c8b595d817232b1c (patch)
tree1089f5acc80baf34a14f922d15cad6d7135db4fd /src/gallium/drivers/lima
parentafbaed906d7ba89467b177e768c36f29d6053ad0 (diff)
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 <[email protected]> Signed-off-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima')
-rw-r--r--src/gallium/drivers/lima/lima_resource.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c
index b2e33f4d3ff..2f9081c3d11 100644
--- a/src/gallium/drivers/lima/lima_resource.c
+++ b/src/gallium/drivers/lima/lima_resource.c
@@ -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;