xf86-video-intel: 2 commits - src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Dec 24 01:48:35 PST 2011
src/sna/sna_accel.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
New commits:
commit efc8d04fc114e9966e5ca00600f9663ecf03a5ca
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Dec 24 09:32:18 2011 +0000
sna: Promote an unattached pixmap to the GPU for inplace copies
If we would prefer to perform the copy on the GPU and if the pixmap is
virgin, create a GPU bo for the operation.
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 ab83fe9..c66ed66 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2379,9 +2379,13 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
src_priv ? src_priv->cpu_bo : NULL,
replaces));
+ if (replaces)
+ sna_damage_destroy(&dst_priv->cpu_damage);
+
/* Try to maintain the data on the GPU */
if (dst_priv && dst_priv->gpu_bo == NULL &&
- src_priv && (src_priv->gpu_bo != NULL || (src_priv->cpu_bo && kgem_bo_is_busy(src_priv->cpu_bo)))) {
+ ((dst_priv->cpu_damage == NULL && copy_use_gpu_bo(sna, dst_priv, ®ion)) ||
+ (src_priv && (src_priv->gpu_bo != NULL || (src_priv->cpu_bo && kgem_bo_is_busy(src_priv->cpu_bo)))))) {
uint32_t tiling = sna_pixmap_choose_tiling(dst_pixmap);
DBG(("%s: create dst GPU bo for upload\n", __FUNCTION__));
commit 8c0e7ff5ac996a5a5c0790966084d1c9e1b1f859
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Dec 24 09:19:18 2011 +0000
sna: Clear the CPU damage for other overwriting rectangular blits as well
And make the accessing of the sna_pixmap safe -- it may not even exist!
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 af13658..ab83fe9 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -7391,6 +7391,8 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
{
PixmapPtr pixmap = get_drawable_pixmap(draw);
struct sna *sna = to_sna_from_pixmap(pixmap);
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
+ struct sna_damage **damage;
RegionRec region;
unsigned flags;
@@ -7415,6 +7417,11 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
if (FORCE_FALLBACK)
goto fallback;
+ if (priv == NULL) {
+ DBG(("%s: fallback -- unattached\n", __FUNCTION__));
+ goto fallback;
+ }
+
if (wedged(sna)) {
DBG(("%s: fallback -- wedged\n", __FUNCTION__));
goto fallback;
@@ -7423,16 +7430,17 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
if (!PM_IS_SOLID(draw, gc->planemask))
goto fallback;
+ if (n == 1 && (flags & 2) == 0 &&
+ gc->fillStyle != FillStippled && alu_overwrites(gc->alu)) {
+ region.data = NULL;
+ sna_damage_subtract(&priv->cpu_damage, ®ion);
+ }
+
if (gc->fillStyle == FillSolid ||
(gc->fillStyle == FillTiled && gc->tileIsPixel) ||
(gc->fillStyle == FillOpaqueStippled && gc->bgPixel == gc->fgPixel)) {
- struct sna_pixmap *priv = sna_pixmap(pixmap);
- struct sna_damage **damage;
uint32_t color = gc->fillStyle == FillTiled ? gc->tile.pixel : gc->fgPixel;
- if (alu_overwrites(gc->alu))
- sna_damage_subtract(&priv->cpu_damage, ®ion);
-
DBG(("%s: solid fill [%08x], testing for blt\n",
__FUNCTION__, color));
@@ -7450,9 +7458,6 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
®ion.extents, flags & 2))
return;
} else if (gc->fillStyle == FillTiled) {
- struct sna_pixmap *priv = sna_pixmap(pixmap);
- struct sna_damage **damage;
-
DBG(("%s: tiled fill, testing for blt\n", __FUNCTION__));
if (sna_drawable_use_gpu_bo(draw, ®ion.extents, &damage) &&
@@ -7469,9 +7474,6 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
®ion.extents, flags & 2))
return;
} else {
- struct sna_pixmap *priv = sna_pixmap(pixmap);
- struct sna_damage **damage;
-
DBG(("%s: stippled fill, testing for blt\n", __FUNCTION__));
if (sna_drawable_use_gpu_bo(draw, ®ion.extents, &damage) &&
More information about the xorg-commit
mailing list