xf86-video-intel: 2 commits - src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue Jul 3 04:08:26 PDT 2012
src/sna/sna_accel.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
New commits:
commit 2d087eadd9cd3aa2e2ccd73a568286d21702d29a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jul 3 11:54:02 2012 +0100
sna: Also prefer to use the dst GPU bo if CopyArea reduces to an inplace upload
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b474864..65d09b9 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3716,16 +3716,24 @@ source_prefer_gpu(struct sna_pixmap *priv)
{
unsigned flags;
- if (priv == NULL)
+ if (priv == NULL) {
+ DBG(("%s: source unattached, use cpu\n", __FUNCTION__));
return 0;
+ }
- if (priv->gpu_damage)
+ if (priv->gpu_damage) {
+ DBG(("%s: source has gpu damage, force gpu\n", __FUNCTION__));
return PREFER_GPU | FORCE_GPU;
+ }
- if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
+ if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) {
+ DBG(("%s: source has busy CPU bo, force gpu\n", __FUNCTION__));
return PREFER_GPU | FORCE_GPU;
+ }
- return PREFER_GPU;
+ DBG(("%s: source has GPU bo? %d\n",
+ __FUNCTION__, priv->gpu_bo != NULL));
+ return priv->gpu_bo != NULL;
}
static void
@@ -3811,7 +3819,9 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
}
bo = sna_drawable_use_bo(&dst_pixmap->drawable,
- source_prefer_gpu(src_priv),
+ source_prefer_gpu(src_priv) ?:
+ region_inplace(sna, dst_pixmap, ®ion,
+ dst_priv, alu_overwrites(alu)),
®ion.extents, &damage);
if (bo) {
if (src_priv && src_priv->clear) {
commit dbe3a5ca1e6558bcee29d893aba8cc352220a36d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jul 3 11:48:15 2012 +0100
sna: Attempt to reduce all-damage on the CPU
As we now treat CPU all-damaged as a special case for deciding when and
where to migrate, look out for that condition after adding damage.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 28b964d..b474864 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1869,10 +1869,10 @@ done:
assert(!DAMAGE_IS_ALL(priv->cpu_damage));
assert_pixmap_contains_box(pixmap, RegionExtents(region));
sna_damage_add(&priv->cpu_damage, region);
- if (priv->gpu_bo &&
- sna_damage_is_all(&priv->cpu_damage,
+ sna_damage_reduce_all(&priv->cpu_damage,
pixmap->drawable.width,
- pixmap->drawable.height)) {
+ pixmap->drawable.height);
+ if (priv->gpu_bo && DAMAGE_IS_ALL(priv->cpu_damage)) {
DBG(("%s: replaced entire pixmap\n", __FUNCTION__));
sna_pixmap_free_gpu(sna, priv);
priv->undamaged = false;
More information about the xorg-commit
mailing list