summaryrefslogtreecommitdiff
path: root/src/sna/sna_threads.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-07 23:21:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-08 00:04:54 +0100
commit06a8ad9690590a605b1564012d062b98c60546a6 (patch)
tree4f36f970a013b7613934ee139076888feecb5575 /src/sna/sna_threads.c
parent1fb4f60671cfb0e461a2e5969ee9d0f0e39d93a4 (diff)
sna/trapezoids: Recompute num_threads to match range
We need to be careful not to execute threads past the end of the alloted buffer by making sure the clip extents correctly align. Reported-by: Joseph Yasi <joe.yasi@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70204 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_threads.c')
-rw-r--r--src/sna/sna_threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sna/sna_threads.c b/src/sna/sna_threads.c
index b771bda8..3e10e5a4 100644
--- a/src/sna/sna_threads.c
+++ b/src/sna/sna_threads.c
@@ -274,6 +274,7 @@ void sna_image_composite(pixman_op_t op,
y = dst_y;
dy = (height + num_threads - 1) / num_threads;
+ num_threads = (height + dy - 1) / dy;
data[0].op = op;
data[0].src = src;
@@ -298,6 +299,7 @@ void sna_image_composite(pixman_op_t op,
sna_threads_run(thread_composite, &data[n]);
}
+ assert(y < dst_y + height);
if (y + dy > dst_y + height)
dy = dst_y + height - y;