xf86-video-intel: 3 commits - src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Sep 23 14:58:38 PDT 2011
src/sna/sna_accel.c | 41 +++++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
New commits:
commit 7f7f95abbf57e6e71f6a30d917f97c2f2bd6cea9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Sep 23 11:38:18 2011 +0100
sna/accel: Use the PolyFillRect to handle tiled spans
Would be preferrable to duplicate the tiling logic. Leave the task of
reimplementing XAA to another day!
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 3cdb971..4c9ef7b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1649,6 +1649,9 @@ sna_spans_extents(DrawablePtr drawable, GCPtr gc,
}
static void
+sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect);
+
+static void
sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
DDXPointPtr pt, int *width, int sorted)
{
@@ -1670,8 +1673,13 @@ sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
goto fallback;
}
- if (gc->fillStyle == FillSolid &&
- PM_IS_SOLID(drawable, gc->planemask)) {
+ DBG(("%s: fillStyle=%x [%d], mask=%lx [%d]\n", __FUNCTION__,
+ gc->fillStyle, gc->fillStyle == FillSolid,
+ gc->planemask, PM_IS_SOLID(drawable, gc->planemask)));
+ if (!PM_IS_SOLID(drawable, gc->planemask))
+ goto fallback;
+
+ if (gc->fillStyle == FillSolid) {
struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable);
DBG(("%s: trying solid fill [alu=%d, pixel=%08lx] blt paths\n",
@@ -1689,6 +1697,27 @@ sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
priv->cpu_bo, &priv->cpu_damage,
gc, n, pt, width, sorted))
return;
+ } else if (gc->fillStyle == FillTiled) {
+ xRectangle *rect;
+ int i;
+
+ /* Try converting these to a set of rectangles instead */
+ DBG(("%s: converting to rectagnles\n", __FUNCTION__));
+
+ rect = malloc (n * sizeof (xRectangle));
+ if (rect == NULL)
+ return;
+
+ for (i = 0; i < n; i++) {
+ rect[i].x = pt[i].x;
+ rect[i].width = width[i];
+ rect[i].y = pt[i].y;
+ rect[i].height = 1;
+ }
+
+ sna_poly_fill_rect(drawable, gc, n, rect);
+ free (rect);
+ return;
}
fallback:
commit 964c96b181e6b55f4de6a4011a5beb6cc2cac33d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Sep 23 11:37:48 2011 +0100
sna/accel: Always subtract the enlarged region from the outstanding GPU 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 cbeca1e..3cdb971 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -528,8 +528,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
pixmap, 0, 0,
box, n);
- sna_damage_subtract(&priv->gpu_damage,
- n <= REGION_NUM_RECTS(r) ? &need : r);
+ sna_damage_subtract(&priv->gpu_damage, r);
RegionUninit(&need);
}
if (r == &want)
commit c68856f34653ac3e7af900dfbba41a108ffe119e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Sep 23 11:35:50 2011 +0100
sna/accel: Only skip undamaging the GPU for reads
Introduced with ac1b83240e5 (sna/accel: Simplify single pixel read-back)
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 1f06f03..cbeca1e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -466,9 +466,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
region->extents.x2 - region->extents.x1,
region->extents.y2 - region->extents.y1));
- if (region->extents.x2 - region->extents.x1 == 1 &&
+ if (!write &&
+ region->extents.x2 - region->extents.x1 == 1 &&
region->extents.y2 - region->extents.y1 == 1) {
- /* Oftenassociated with synchonrisation, KISS */
+ /* Often associated with synchronisation, KISS */
sna_read_boxes(sna,
priv->gpu_bo, 0, 0,
pixmap, 0, 0,
More information about the xorg-commit
mailing list