sna: Tweak threading thresholds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
2cdd57c804
commit
2536ad044b
|
|
@ -208,7 +208,10 @@ int sna_use_threads(int width, int height, int threshold)
|
|||
if (max_threads <= 0)
|
||||
return 1;
|
||||
|
||||
num_threads = height / (128/width + 1) / threshold-1;
|
||||
if (width < 128)
|
||||
height /= 128/width;
|
||||
|
||||
num_threads = height * max_threads / threshold - 1;
|
||||
if (num_threads <= 0)
|
||||
return 1;
|
||||
|
||||
|
|
@ -251,7 +254,7 @@ void sna_image_composite(pixman_op_t op,
|
|||
{
|
||||
int num_threads;
|
||||
|
||||
num_threads = sna_use_threads(width, height, 16);
|
||||
num_threads = sna_use_threads(width, height, 32);
|
||||
if (num_threads <= 1) {
|
||||
pixman_image_composite(op, src, mask, dst,
|
||||
src_x, src_y,
|
||||
|
|
|
|||
|
|
@ -2556,7 +2556,7 @@ trapezoids_fallback(struct sna *sna,
|
|||
if (!scratch)
|
||||
return;
|
||||
|
||||
num_threads = sna_use_threads(width, height, 4);
|
||||
num_threads = sna_use_threads(width, height, 8);
|
||||
if (num_threads == 1) {
|
||||
if (depth < 8) {
|
||||
image = pixman_image_create_bits(format, width, height,
|
||||
|
|
@ -4280,7 +4280,7 @@ mono_trapezoids_span_converter(struct sna *sna,
|
|||
!unbounded)
|
||||
num_threads = sna_use_threads(mono.clip.extents.x2 - mono.clip.extents.x1,
|
||||
mono.clip.extents.y2 - mono.clip.extents.y1,
|
||||
16);
|
||||
32);
|
||||
if (num_threads > 1) {
|
||||
struct mono_span_thread threads[num_threads];
|
||||
int y, h;
|
||||
|
|
@ -5795,7 +5795,7 @@ trapezoid_span_inplace__x8r8g8b8(CARD8 op,
|
|||
|
||||
num_threads = sna_use_threads(4*(region.extents.x2 - region.extents.x1),
|
||||
region.extents.y2 - region.extents.y1,
|
||||
8);
|
||||
16);
|
||||
|
||||
DBG(("%s: %dx%d, format=%x, op=%d, lerp?=%d, num_threads=%d\n",
|
||||
__FUNCTION__,
|
||||
|
|
@ -6166,7 +6166,7 @@ trapezoid_span_inplace(struct sna *sna,
|
|||
|
||||
num_threads = sna_use_threads(region.extents.x2 - region.extents.x1,
|
||||
region.extents.y2 - region.extents.y1,
|
||||
8);
|
||||
16);
|
||||
if (num_threads == 1) {
|
||||
struct tor tor;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue