mirror of
https://github.com/X11Libre/xf86-video-intel.git
synced 2026-04-14 10:54:23 +00:00
sna: Discard overwritten operations before doing a BLT composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -2031,8 +2031,12 @@ clear:
|
||||
hint = 0;
|
||||
if (can_render(sna)) {
|
||||
hint |= PREFER_GPU;
|
||||
if (dst->pCompositeClip->data == NULL && (width | height))
|
||||
if (dst->pCompositeClip->data == NULL && (width | height)) {
|
||||
hint |= IGNORE_CPU;
|
||||
if (width == tmp->dst.pixmap->drawable.width &&
|
||||
height == tmp->dst.pixmap->drawable.height)
|
||||
hint |= REPLACES;
|
||||
}
|
||||
}
|
||||
tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint,
|
||||
&dst_box, &tmp->damage);
|
||||
@@ -2051,7 +2055,9 @@ clear:
|
||||
if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion,
|
||||
MOVE_INPLACE_HINT | MOVE_WRITE))
|
||||
return false;
|
||||
}
|
||||
} else if (hint & REPLACES)
|
||||
kgem_bo_undo(&sna->kgem, tmp->dst.bo);
|
||||
|
||||
return prepare_blt_clear(sna, tmp);
|
||||
}
|
||||
|
||||
@@ -2081,6 +2087,9 @@ fill:
|
||||
hint |= PREFER_GPU;
|
||||
if (dst->pCompositeClip->data == NULL && (width | height))
|
||||
hint |= IGNORE_CPU;
|
||||
if (width == tmp->dst.pixmap->drawable.width &&
|
||||
height == tmp->dst.pixmap->drawable.height)
|
||||
hint |= REPLACES;
|
||||
}
|
||||
tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint,
|
||||
&dst_box, &tmp->damage);
|
||||
@@ -2099,7 +2108,8 @@ fill:
|
||||
if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion,
|
||||
MOVE_INPLACE_HINT | MOVE_WRITE))
|
||||
return false;
|
||||
}
|
||||
} else if (hint & REPLACES)
|
||||
kgem_bo_undo(&sna->kgem, tmp->dst.bo);
|
||||
|
||||
return prepare_blt_fill(sna, tmp, color);
|
||||
}
|
||||
@@ -2228,14 +2238,21 @@ fill:
|
||||
hint = 0;
|
||||
if (bo || can_render(sna)) {
|
||||
hint |= PREFER_GPU;
|
||||
if (dst->pCompositeClip->data == NULL && (width | height))
|
||||
if (dst->pCompositeClip->data == NULL && (width | height)) {
|
||||
hint |= IGNORE_CPU;
|
||||
if (width == tmp->dst.pixmap->drawable.width &&
|
||||
height == tmp->dst.pixmap->drawable.height)
|
||||
hint |= REPLACES;
|
||||
}
|
||||
if (bo)
|
||||
hint |= FORCE_GPU;
|
||||
}
|
||||
tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint,
|
||||
&dst_box, &tmp->damage);
|
||||
|
||||
if (hint & REPLACES)
|
||||
kgem_bo_undo(&sna->kgem, tmp->dst.bo);
|
||||
|
||||
ret = false;
|
||||
if (bo) {
|
||||
if (!tmp->dst.bo) {
|
||||
|
||||
Reference in New Issue
Block a user