xf86-video-intel: 6 commits - src/sna/fb src/sna/gen5_render.c src/sna/sna_glyphs.c
Chris Wilson
ickle at kemper.freedesktop.org
Wed Aug 8 04:27:59 PDT 2012
src/sna/fb/fbbitmap.c | 18 +++++++++++++-----
src/sna/gen5_render.c | 8 ++++++--
src/sna/sna_glyphs.c | 8 +++++++-
3 files changed, 26 insertions(+), 8 deletions(-)
New commits:
commit 465ae1840a883c50d5a5aab7380b30527f00e17b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 12:23:25 2012 +0100
sna: Use a compile time constant for determine the zeroth bit
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/fb/fbbitmap.c b/src/sna/fb/fbbitmap.c
index fb6c323..bba6ea3 100644
--- a/src/sna/fb/fbbitmap.c
+++ b/src/sna/fb/fbbitmap.c
@@ -48,6 +48,8 @@ static inline void add(RegionPtr region,
region->extents.x2 = x2;
}
+#define MASK_0 (FB_ALLONES & ~FbScrRight(FB_ALLONES, 1))
+
/* Convert bitmap clip mask into clipping region.
* First, goes through each line and makes boxes by noting the transitions
* from 0 to 1 and 1 to 0.
@@ -57,7 +59,6 @@ static inline void add(RegionPtr region,
RegionPtr
fbBitmapToRegion(PixmapPtr pixmap)
{
- const register FbBits mask0 = FB_ALLONES & ~FbScrRight(FB_ALLONES, 1);
FbBits maskw;
register RegionPtr region;
const FbBits *bits, *line, *end;
@@ -92,7 +93,7 @@ fbBitmapToRegion(PixmapPtr pixmap)
(line[width >> (FB_SHIFT - 3)] & maskw)))
line += stride, y2++;
- if (READ(bits) & mask0)
+ if (READ(bits) & MASK_0)
x1 = 0;
else
x1 = -1;
@@ -109,7 +110,7 @@ fbBitmapToRegion(PixmapPtr pixmap)
continue;
}
for (i = 0; i < FB_UNIT; i++) {
- if (w & mask0) {
+ if (w & MASK_0) {
if (x1 < 0)
x1 = base + i;
} else {
@@ -124,7 +125,7 @@ fbBitmapToRegion(PixmapPtr pixmap)
if (width & FB_MASK) {
FbBits w = READ(bits++);
for (i = 0; i < (width & FB_MASK); i++) {
- if (w & mask0) {
+ if (w & MASK_0) {
if (x1 < 0)
x1 = base + i;
} else {
commit 85192f00e345830541e3715e211b1f98154bbef4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 12:11:50 2012 +0100
sna: Ignore trailing bits when comparing lines inside the bitmap
References: https://bugs.freedesktop.org/show_bug.cgi?id=51422
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/fb/fbbitmap.c b/src/sna/fb/fbbitmap.c
index 0758728..fb6c323 100644
--- a/src/sna/fb/fbbitmap.c
+++ b/src/sna/fb/fbbitmap.c
@@ -58,6 +58,7 @@ RegionPtr
fbBitmapToRegion(PixmapPtr pixmap)
{
const register FbBits mask0 = FB_ALLONES & ~FbScrRight(FB_ALLONES, 1);
+ FbBits maskw;
register RegionPtr region;
const FbBits *bits, *line, *end;
int width, y1, y2, base, x1;
@@ -74,6 +75,9 @@ fbBitmapToRegion(PixmapPtr pixmap)
stride = pixmap->devKind >> (FB_SHIFT - 3);
width = pixmap->drawable.width;
+ maskw = 0;
+ if (width & 7)
+ maskw = FB_ALLONES & ~FbScrRight(FB_ALLONES, width & FB_MASK);
region->extents.x1 = width;
region->extents.x2 = 0;
y2 = 0;
@@ -82,7 +86,10 @@ fbBitmapToRegion(PixmapPtr pixmap)
bits = line;
line += stride;
while (y2 < pixmap->drawable.height &&
- memcmp(bits, line, (width+7)>>3) == 0)
+ memcmp(bits, line, width >> 3) == 0 &&
+ (maskw == 0 ||
+ (bits[width >> (FB_SHIFT - 3)] & maskw) ==
+ (line[width >> (FB_SHIFT - 3)] & maskw)))
line += stride, y2++;
if (READ(bits) & mask0)
commit edc1427f3dcddb73acdb5b5e03756ecb30cb3797
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 10:53:40 2012 +0100
sna/gen5: Add DBG for context switching
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 22dabd2..f50e785 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -3516,6 +3516,8 @@ gen5_render_context_switch(struct kgem *kgem,
*/
if (kgem->mode == KGEM_BLT) {
struct sna *sna = to_sna_from_kgem(kgem);
+ DBG(("%s: forcing drawrect on next state emission\n",
+ __FUNCTION__));
sna->render_state.gen5.drawrect_limit = -1;
}
}
commit fec78ddc60b1f03097b334672546c2c7ef21ab4f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 10:08:52 2012 +0100
sna: Add DBG option to disable discarding of glyph masks
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index af0f211..e299ac5 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -75,6 +75,7 @@
#define NO_GLYPHS_VIA_MASK 0
#define NO_SMALL_MASK 0
#define NO_GLYPHS_SLOW 0
+#define NO_DISCARD_MASK 0
#define CACHE_PICTURE_SIZE 1024
#define GLYPH_MIN_SIZE 8
@@ -1254,6 +1255,9 @@ static bool can_discard_mask(uint8_t op, PicturePtr src, PictFormatPtr mask,
PictFormatPtr g;
uint32_t color;
+ if (NO_DISCARD_MASK)
+ return false;
+
if (nlist == 1 && list->len == 1)
return true;
commit b0cd430082d219500729d20c4740440e58773892
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 10:07:06 2012 +0100
sna/gen5: Fix use of uninitialised rgba value for DBG
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 90b0bdd..22dabd2 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -3123,8 +3123,10 @@ gen5_render_fill_boxes(struct sna *sna,
struct sna_composite_op tmp;
uint32_t pixel;
- DBG(("%s op=%x, color=%08x, boxes=%d x [((%d, %d), (%d, %d))...]\n",
- __FUNCTION__, op, pixel, n, box->x1, box->y1, box->x2, box->y2));
+ DBG(("%s op=%x, color=(%04x,%04x,%04x,%04x), boxes=%d x [((%d, %d), (%d, %d))...]\n",
+ __FUNCTION__, op,
+ color->red, color->green, color->blue, color->alpha,
+ n, box->x1, box->y1, box->x2, box->y2));
if (op >= ARRAY_SIZE(gen5_blend_op)) {
DBG(("%s: fallback due to unhandled blend op: %d\n",
commit 9ad923f95c59cdf42363f95c7dd52188c0987296
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Wed Aug 8 09:59:50 2012 +0100
sna: Minor DBG for fallback glyphs and discarding the mask
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index ccf6497..af0f211 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1347,8 +1347,10 @@ glyphs_fallback(CARD8 op,
RegionTranslate(®ion, -dst->pDrawable->x, -dst->pDrawable->y);
if (mask_format &&
- can_discard_mask(op, src, mask_format, nlist, list, glyphs))
+ can_discard_mask(op, src, mask_format, nlist, list, glyphs)) {
+ DBG(("%s: discarding mask\n", __FUNCTION__));
mask_format = NULL;
+ }
cache = sna->render.glyph_cache;
pixman_glyph_cache_freeze(cache);
More information about the xorg-commit
mailing list