sna: Prevent readback of 1x1 if it lies inside CPU damage
If the pixel exists only in the CPU damage, attempting to read it back from the GPU only results in garbage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a34a06c4ba
commit
a2d92ade39
|
|
@ -1528,7 +1528,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
|
|||
region->extents.x2 - region->extents.x1,
|
||||
region->extents.y2 - region->extents.y1));
|
||||
|
||||
if ((flags & MOVE_WRITE) == 0 &&
|
||||
if ((flags & MOVE_WRITE) == 0 && priv->cpu_damage == NULL &&
|
||||
region->extents.x2 - region->extents.x1 == 1 &&
|
||||
region->extents.y2 - region->extents.y1 == 1) {
|
||||
/* Often associated with synchronisation, KISS */
|
||||
|
|
@ -1548,6 +1548,16 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
|
|||
region->extents.x2 - region->extents.x1,
|
||||
region->extents.y2 - region->extents.y1));
|
||||
|
||||
if ((flags & MOVE_WRITE) == 0 &&
|
||||
region->extents.x2 - region->extents.x1 == 1 &&
|
||||
region->extents.y2 - region->extents.y1 == 1) {
|
||||
sna_read_boxes(sna,
|
||||
priv->gpu_bo, 0, 0,
|
||||
pixmap, 0, 0,
|
||||
®ion->extents, 1);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Expand the region to move 32x32 pixel blocks at a
|
||||
* time, as we assume that we will continue writing
|
||||
* afterwards and so aim to coallesce subsequent
|
||||
|
|
@ -10079,8 +10089,11 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
|
|||
goto fallback;
|
||||
}
|
||||
|
||||
if (!PM_IS_SOLID(draw, gc->planemask))
|
||||
if (!PM_IS_SOLID(draw, gc->planemask)) {
|
||||
DBG(("%s: fallback -- planemask=%#lx (not-solid)\n",
|
||||
__FUNCTION__, gc->planemask));
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
/* Clear the cpu damage so that we refresh the GPU status of the
|
||||
* pixmap upon a redraw after a period of inactivity.
|
||||
|
|
|
|||
Loading…
Reference in New Issue