diff options
author | Kenneth Graunke <[email protected]> | 2017-04-11 22:55:02 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-07-31 23:19:34 -0700 |
commit | 5281e4ed3b2ee25627517c23708bb02857ec5992 (patch) | |
tree | d90486e0f1adcd86a2a0f4f8a0906b519735b0cb /src/mesa | |
parent | b8bea9a0506cc312f4b32762d73598a8a220cf08 (diff) |
i965/drm: Inline brw_bo_references.
It's a single atomic add, so it makes sense to inline it.
Improves performance in Piglit's drawoverhead microbenchmark's
"DrawArrays ( 1 VBO, 0 UBO, 0 ) w/ no state change" subtest by
0.400922% +/- 0.310389% (n=350) on my i7-7700HQ.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_bufmgr.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_bufmgr.h | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c index 020d64849d9..f70365eba2a 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c @@ -196,12 +196,6 @@ bucket_for_size(struct brw_bufmgr *bufmgr, uint64_t size) return NULL; } -inline void -brw_bo_reference(struct brw_bo *bo) -{ - p_atomic_inc(&bo->refcount); -} - int brw_bo_busy(struct brw_bo *bo) { diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h index 6a6051bb71c..15d37c04851 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.h +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h @@ -37,6 +37,7 @@ #include <stdbool.h> #include <stdint.h> #include <stdio.h> +#include "util/u_atomic.h" #include "util/list.h" #if defined(__cplusplus) @@ -188,7 +189,11 @@ struct brw_bo *brw_bo_alloc_tiled_2d(struct brw_bufmgr *bufmgr, unsigned flags); /** Takes a reference on a buffer object */ -void brw_bo_reference(struct brw_bo *bo); +static inline void +brw_bo_reference(struct brw_bo *bo) +{ + p_atomic_inc(&bo->refcount); +} /** * Releases a reference on a buffer object, freeing the data if |