xf86-video-intel: 3 commits - src/sna/sna_accel.c src/sna/sna_composite.c src/sna/sna_threads.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jul 4 06:16:35 PDT 2014
src/sna/sna_accel.c | 32 +++++++++++++++++++++++++-------
src/sna/sna_composite.c | 2 +-
src/sna/sna_threads.c | 7 +++++--
3 files changed, 31 insertions(+), 10 deletions(-)
New commits:
commit 6a64a3ae55ad5f743d2b7a4852b6ca7b54d2a142
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jul 4 13:04:02 2014 +0100
sna: Discard operations to either CPU or GPU bo when overwriting with RenderRectangles
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index bc50109..e65bce0 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -1021,7 +1021,7 @@ sna_composite_rectangles(CARD8 op,
goto fallback;
}
if (hint & REPLACES)
- kgem_bo_undo(&sna->kgem, bo);
+ kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo);
if (op <= PictOpSrc) {
b = pixman_region_rectangles(®ion, &num_boxes);
commit 2c8ab77fcd71b7f96ad7bc379e5c68b3b45a5069
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jul 4 12:43:55 2014 +0100
sna: Tweak number of threads for short areas
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_threads.c b/src/sna/sna_threads.c
index 83b180f..f9c6b1e 100644
--- a/src/sna/sna_threads.c
+++ b/src/sna/sna_threads.c
@@ -259,8 +259,8 @@ int sna_use_threads(int width, int height, int threshold)
if (max_threads <= 0)
return 1;
- if (height <= max_threads)
- return height;
+ if (height <= 1)
+ return 1;
if (width < 128)
height /= 128/width;
@@ -271,6 +271,9 @@ int sna_use_threads(int width, int height, int threshold)
if (num_threads > max_threads)
num_threads = max_threads;
+ if (num_threads > height)
+ num_threads = height;
+
return num_threads;
}
commit d3ccb3f3b2a3cb4c8b51d58d185dd10b85e025eb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jul 4 12:39:01 2014 +0100
sna: Convert a clear tile into a solid fill
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 0b16bd0..b6d4195 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -12601,6 +12601,26 @@ out_gc:
return ret;
}
+inline static bool tile_is_solid(GCPtr gc, uint32_t *pixel)
+{
+ PixmapPtr tile = gc->tile.pixmap;
+ struct sna_pixmap *priv;
+
+ if ((tile->drawable.width | tile->drawable.height) == 1) {
+ DBG(("%s: single pixel tile pixmap, converting to solid fill\n", __FUNCTION__));
+ *pixel = get_pixel(tile);
+ return true;
+ }
+
+ priv = sna_pixmap(tile);
+ if (priv == NULL || !priv->clear)
+ return false;
+
+ DBG(("%s: tile is clear, converting to solid fill\n", __FUNCTION__));
+ *pixel = priv->clear_color;
+ return true;
+}
+
static bool
sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
struct kgem_bo *bo,
@@ -12617,6 +12637,7 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
CARD32 alu = gc->alu;
int tile_width, tile_height;
int16_t dx, dy;
+ uint32_t pixel;
DBG(("%s pixmap=%ld, x %d [(%d, %d)x(%d, %d)...], clipped? %d\n",
__FUNCTION__, pixmap->drawable.serialNumber,
@@ -12626,22 +12647,19 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
assert(tile->drawable.depth == drawable->depth);
assert(bo);
- tile_width = tile->drawable.width;
- tile_height = tile->drawable.height;
- if ((tile_width | tile_height) == 1) {
- DBG(("%s: single pixel tile pixmap ,converting to solid fill\n",
- __FUNCTION__));
+ if (tile_is_solid(gc, &pixel))
return sna_poly_fill_rect_blt(drawable, bo, damage,
- gc, get_pixel(tile),
+ gc, pixel,
n, rect,
extents, clipped);
- }
/* XXX [248]x[238] tiling can be reduced to a pattern fill.
* Also we can do the lg2 reduction for BLT and use repeat modes for
* RENDER.
*/
+ tile_width = tile->drawable.width;
+ tile_height = tile->drawable.height;
if ((tile_width | tile_height) == 8) {
bool ret;
More information about the xorg-commit
mailing list