diff options
author | Eric Anholt <eric@anholt.net> | 2010-11-02 19:55:07 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-11-03 06:08:27 -0700 |
commit | bb1540835056cdea5db6f55b19c0c87358f14cd1 (patch) | |
tree | 0706831df699c89f82558d983651fdf4489dfe6c /src/mesa/drivers/dri/intel/intel_batchbuffer.c | |
parent | b19b8580602a6ba37e81dc8b64c4ed30c1518886 (diff) |
intel: Annotate debug printout checks with unlikely().
This provides the optimizer with hints about code hotness, which we're
quite certain about for debug printouts (or, rather, while we
developers often hit the checks for debug printouts, we don't care
about performance while doing so).
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_batchbuffer.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_batchbuffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index aaf3a573cf..4b498f8c5b 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -97,7 +97,7 @@ do_flush_locked(struct intel_batchbuffer *batch, GLuint used) (x_off & 0xffff) | (y_off << 16)); } - if (INTEL_DEBUG & DEBUG_BATCH) { + if (unlikely(INTEL_DEBUG & DEBUG_BATCH)) { drm_intel_bo_map(batch->buf, GL_FALSE); intel_decode(batch->buf->virtual, used / 4, batch->buf->offset, intel->intelScreen->deviceID, GL_TRUE); @@ -128,7 +128,7 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (used == 0) return; - if (INTEL_DEBUG & DEBUG_BATCH) + if (unlikely(INTEL_DEBUG & DEBUG_BATCH)) fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line, used); @@ -172,7 +172,7 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, do_flush_locked(batch, used); - if (INTEL_DEBUG & DEBUG_SYNC) { + if (unlikely(INTEL_DEBUG & DEBUG_SYNC)) { fprintf(stderr, "waiting for idle\n"); drm_intel_bo_map(batch->buf, GL_TRUE); drm_intel_bo_unmap(batch->buf); |