diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-07-04 12:43:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-07-04 12:43:55 +0100 |
commit | 2c8ab77fcd71b7f96ad7bc379e5c68b3b45a5069 (patch) | |
tree | 56e6656dc3e26ee0c7a65a270b80586a83ebbb9e | |
parent | d3ccb3f3b2a3cb4c8b51d58d185dd10b85e025eb (diff) |
sna: Tweak number of threads for short areas
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_threads.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/sna_threads.c b/src/sna/sna_threads.c index 83b180f8..f9c6b1e8 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; } |