diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 17:41:57 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 17:41:57 +0000 |
commit | 417c3f9b8c6b9a50dc1af440c53e94d2c6401251 (patch) | |
tree | 4863eb3dbac5bf33e133e72b237791f738e19cb6 /src | |
parent | aa7e11a1a451c54d5cbff9a6c242075b08c590ae (diff) |
sna/trapezoids: Add a pair of unlikely hints for forced box emission
Overflowing the buffer is unlikely, so pass the hint on to the compiler.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_trapezoids.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index bed91688..baba8274 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -2061,7 +2061,7 @@ thread_mono_span_add_boxes(struct mono *c, const BoxRec *box, int count) struct mono_span_thread_boxes *b = c->op.priv; assert(count > 0 && count <= MONO_SPAN_MAX_BOXES); - if (b->num_boxes + count > MONO_SPAN_MAX_BOXES) { + if (unlikely(b->num_boxes + count > MONO_SPAN_MAX_BOXES)) { b->op->thread_boxes(c->sna, b->op, b->boxes, b->num_boxes); b->num_boxes = 0; } @@ -4405,7 +4405,7 @@ static void span_thread_add_boxes(struct sna *sna, void *data, __FUNCTION__, count, alpha)); assert(count > 0 && count <= SPAN_THREAD_MAX_BOXES); - if (b->num_boxes + count > SPAN_THREAD_MAX_BOXES) { + if (unlikely(b->num_boxes + count > SPAN_THREAD_MAX_BOXES)) { DBG(("%s: flushing %d boxes, adding %d\n", __FUNCTION__, b->num_boxes, count)); assert(b->num_boxes <= SPAN_THREAD_MAX_BOXES); b->op->thread_boxes(sna, b->op, b->boxes, b->num_boxes); |