summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-06-28 10:59:23 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-06-28 11:25:47 +0100
commite979d32bb71fef7341ceb9c2b2e80c6dfa50a7b3 (patch)
tree3d0e6bff54462f663b78fd6327f036151bd63c33
parent541f816815e392db9e798d2f940029d82a6b2e0b (diff)
sna/gen2+: Consider precision in render operation placement
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66297 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen2_render.c14
-rw-r--r--src/sna/gen3_render.c27
-rw-r--r--src/sna/gen4_render.c14
-rw-r--r--src/sna/gen5_render.c14
-rw-r--r--src/sna/gen6_render.c14
-rw-r--r--src/sna/gen7_render.c14
6 files changed, 64 insertions, 33 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index f09a20b3..faf2227f 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1632,7 +1632,7 @@ gen2_composite_set_target(struct sna *sna,
}
static bool
-is_unhandled_gradient(PicturePtr picture)
+is_unhandled_gradient(PicturePtr picture, bool precise)
{
if (picture->pDrawable)
return false;
@@ -1642,7 +1642,7 @@ is_unhandled_gradient(PicturePtr picture)
case SourcePictTypeLinear:
return false;
default:
- return true;
+ return precise;
}
}
@@ -1678,12 +1678,12 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(PicturePtr p, PixmapPtr pixmap)
+source_fallback(PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
- if (is_unhandled_gradient(p) || !gen2_check_repeat(p))
+ if (is_unhandled_gradient(p, precise) || !gen2_check_repeat(p))
return true;
if (pixmap && source_is_busy(pixmap))
@@ -1712,11 +1712,13 @@ gen2_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(src, src_pixmap);
+ src_fallback = source_fallback(src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(mask, mask_pixmap);
+ mask_fallback = source_fallback(mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = NULL;
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 13a46d3c..8d65e6e8 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3307,11 +3307,30 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(PicturePtr p, PixmapPtr pixmap)
+is_unhandled_gradient(PicturePtr picture, bool precise)
+{
+ if (picture->pDrawable)
+ return false;
+
+ switch (picture->pSourcePict->type) {
+ case SourcePictTypeSolidFill:
+ case SourcePictTypeLinear:
+ case SourcePictTypeRadial:
+ return false;
+ default:
+ return precise;
+ }
+}
+
+static bool
+source_fallback(PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
+ if (is_unhandled_gradient(p, precise))
+ return true;
+
if (!gen3_check_xformat(p) || !gen3_check_repeat(p))
return true;
@@ -3342,11 +3361,13 @@ gen3_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(src, src_pixmap);
+ src_fallback = source_fallback(src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(mask, mask_pixmap);
+ mask_fallback = source_fallback(mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = false;
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index b27e531a..fa140cf3 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1635,14 +1635,14 @@ try_blt(struct sna *sna,
}
static bool
-check_gradient(PicturePtr picture)
+check_gradient(PicturePtr picture, bool precise)
{
switch (picture->pSourcePict->type) {
case SourcePictTypeSolidFill:
case SourcePictTypeLinear:
return false;
default:
- return true;
+ return precise;
}
}
@@ -1679,13 +1679,13 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(struct sna *sna, PicturePtr p, PixmapPtr pixmap)
+source_fallback(struct sna *sna, PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
if (p->pSourcePict)
- return check_gradient(p);
+ return check_gradient(p, precise);
if (!gen4_check_repeat(p) || !gen4_check_format(p->format))
return true;
@@ -1717,11 +1717,13 @@ gen4_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(sna, src, src_pixmap);
+ src_fallback = source_fallback(sna, src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(sna, mask, mask_pixmap);
+ mask_fallback = source_fallback(sna, mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = false;
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 689332c1..b31ac1e9 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -1611,7 +1611,7 @@ try_blt(struct sna *sna,
}
static bool
-is_gradient(PicturePtr picture)
+is_gradient(PicturePtr picture, bool precise)
{
if (picture->pDrawable)
return false;
@@ -1621,7 +1621,7 @@ is_gradient(PicturePtr picture)
case SourcePictTypeLinear:
return false;
default:
- return true;
+ return precise;
}
}
@@ -1658,12 +1658,12 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(struct sna *sna, PicturePtr p, PixmapPtr pixmap)
+source_fallback(struct sna *sna, PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
- if (is_gradient(p) ||
+ if (is_gradient(p, precise) ||
!gen5_check_repeat(p) ||
!gen5_check_format(p->format))
return true;
@@ -1694,11 +1694,13 @@ gen5_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(sna, src, src_pixmap);
+ src_fallback = source_fallback(sna, src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(sna, mask, mask_pixmap);
+ mask_fallback = source_fallback(sna, mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = false;
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index e9136d74..d87ac127 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1931,7 +1931,7 @@ try_blt(struct sna *sna,
}
static bool
-check_gradient(PicturePtr picture)
+check_gradient(PicturePtr picture, bool precise)
{
if (picture->pDrawable)
return false;
@@ -1941,7 +1941,7 @@ check_gradient(PicturePtr picture)
case SourcePictTypeLinear:
return false;
default:
- return true;
+ return precise;
}
}
@@ -1974,13 +1974,13 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(PicturePtr p, PixmapPtr pixmap)
+source_fallback(PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
if (p->pSourcePict)
- return check_gradient(p);
+ return check_gradient(p, precise);
if (!gen6_check_repeat(p) || !gen6_check_format(p->format))
return true;
@@ -2011,11 +2011,13 @@ gen6_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(src, src_pixmap);
+ src_fallback = source_fallback(src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(mask, mask_pixmap);
+ mask_fallback = source_fallback(mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = false;
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 665d5152..a36ecf71 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2138,7 +2138,7 @@ try_blt(struct sna *sna,
}
static bool
-check_gradient(PicturePtr picture)
+check_gradient(PicturePtr picture, bool precise)
{
if (picture->pDrawable)
return false;
@@ -2148,7 +2148,7 @@ check_gradient(PicturePtr picture)
case SourcePictTypeLinear:
return false;
default:
- return true;
+ return precise;
}
}
@@ -2181,13 +2181,13 @@ source_is_busy(PixmapPtr pixmap)
}
static bool
-source_fallback(PicturePtr p, PixmapPtr pixmap)
+source_fallback(PicturePtr p, PixmapPtr pixmap, bool precise)
{
if (sna_picture_is_solid(p, NULL))
return false;
if (p->pSourcePict)
- return check_gradient(p);
+ return check_gradient(p, precise);
if (!gen7_check_repeat(p) || !gen7_check_format(p->format))
return true;
@@ -2218,11 +2218,13 @@ gen7_composite_fallback(struct sna *sna,
dst_pixmap = get_drawable_pixmap(dst->pDrawable);
src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL;
- src_fallback = source_fallback(src, src_pixmap);
+ src_fallback = source_fallback(src, src_pixmap,
+ dst->polyMode == PolyModePrecise);
if (mask) {
mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL;
- mask_fallback = source_fallback(mask, mask_pixmap);
+ mask_fallback = source_fallback(mask, mask_pixmap,
+ dst->polyMode == PolyModePrecise);
} else {
mask_pixmap = NULL;
mask_fallback = false;