xf86-video-intel: src/sna/sna_render.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Apr 23 22:00:34 UTC 2016
src/sna/sna_render.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit bca4e0e35e4ac27f2dcd1a8e5fcbf7ce69cec358
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Apr 23 21:42:12 2016 +0100
sna: Limit generic convolution to smallish kernels
Since the naive implementation uses an 8bit temporary, we can only
support so many passes before the quantization artefacts become
apparent. We have to be extra conservation in order to support
multi-pass convolution algorithms (notable 2-pass separable Gaussian
kernels).
References: https://bugs.freedesktop.org/show_bug.cgi?id=95091
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index d8b7756..5a8df06 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -1326,6 +1326,8 @@ sna_render_picture_convolve(struct sna *sna,
*/
DBG(("%s: origin=(%d,%d) kernel=%dx%d, size=%dx%d\n",
__FUNCTION__, x_off, y_off, cw, ch, w, h));
+ if (cw*ch > 32) /* too much loss of precision from quantization! */
+ return -1;
assert(picture->pDrawable);
assert(picture->filter == PictFilterConvolution);
@@ -1376,9 +1378,9 @@ sna_render_picture_convolve(struct sna *sna,
alpha = CreateSolidPicture(0, &color, &error);
if (alpha) {
sna_composite(PictOpAdd, picture, alpha, tmp,
- x, y,
+ x-(x_off+i), y-(y_off+j),
+ 0, 0,
0, 0,
- x_off+i, y_off+j,
w, h);
FreePicture(alpha, 0);
}
More information about the xorg-commit
mailing list