sna: Tweak the rendering priorities

If the last operation was on the GPU, continue on the GPU if this
operation overlaps any GPU damage or does not overlap CPU damage.
Otherwise, if the last operation was on the CPU only switch to the GPU
if we do not overlap any CPU damage and overlap existing GPU damage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-19 18:37:08 +00:00
parent 9b6ade1234
commit addf66dda7
1 changed files with 20 additions and 11 deletions

View File

@ -1048,20 +1048,29 @@ _sna_drawable_use_gpu_bo(DrawablePtr drawable,
extents.y1 += dy;
extents.y2 += dy;
if (priv->cpu_damage == NULL)
goto done;
if (priv->gpu) {
if (priv->gpu_damage &&
sna_damage_contains_box(priv->gpu_damage,
&extents) != PIXMAN_REGION_OUT)
goto move_to_gpu;
if (sna_damage_contains_box(priv->cpu_damage,
&extents) == PIXMAN_REGION_OUT)
goto done;
if (priv->cpu_damage &&
sna_damage_contains_box(priv->cpu_damage,
&extents) != PIXMAN_REGION_OUT)
return FALSE;
} else {
if (priv->cpu_damage == NULL ||
sna_damage_contains_box(priv->cpu_damage,
&extents) == PIXMAN_REGION_OUT)
goto done;
if (!priv->gpu || priv->gpu_damage == NULL)
return FALSE;
if (sna_damage_contains_box(priv->gpu_damage,
&extents) == PIXMAN_REGION_OUT)
return FALSE;
if (priv->gpu_damage == NULL ||
sna_damage_contains_box(priv->gpu_damage,
&extents) == PIXMAN_REGION_OUT)
return FALSE;
}
move_to_gpu:
sna_pixmap_move_area_to_gpu(pixmap, &extents);
done:
if (sna_damage_contains_box(priv->gpu_damage,