diff options
author | Samuel Pitoiset <[email protected]> | 2017-01-24 11:11:59 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-01-24 11:17:25 +0100 |
commit | d90d37db735359cc85e3b0a2ceb6a8d0cbd3ec73 (patch) | |
tree | 5a849325d05566d5f7a7ca203b386b33b2d472ff /src/gallium/drivers/radeon | |
parent | ba6399df9462d78eda2a5de7c2940d8cf9d27f95 (diff) |
gallium/radeon: undef the very specific UPDATE_COUNTER macro
Also, wrap this into a do { ... } while (0). Suggested by Nicolai.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_gpu_load.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeon/r600_gpu_load.c b/src/gallium/drivers/radeon/r600_gpu_load.c index 775ac7ac92f..83b7bd72106 100644 --- a/src/gallium/drivers/radeon/r600_gpu_load.c +++ b/src/gallium/drivers/radeon/r600_gpu_load.c @@ -58,11 +58,13 @@ #define CB_BUSY(x) (((x) >> 30) & 0x1) #define GUI_ACTIVE(x) (((x) >> 31) & 0x1) -#define UPDATE_COUNTER(field, mask) \ - if (mask(value)) \ - p_atomic_inc(&counters->named.field.busy); \ - else \ - p_atomic_inc(&counters->named.field.idle); +#define UPDATE_COUNTER(field, mask) \ + do { \ + if (mask(value)) \ + p_atomic_inc(&counters->named.field.busy); \ + else \ + p_atomic_inc(&counters->named.field.idle); \ + } while (0) static void r600_update_grbm_counters(struct r600_common_screen *rscreen, union r600_grbm_counters *counters) @@ -87,6 +89,8 @@ static void r600_update_grbm_counters(struct r600_common_screen *rscreen, UPDATE_COUNTER(gui, GUI_ACTIVE); } +#undef UPDATE_COUNTER + static PIPE_THREAD_ROUTINE(r600_gpu_load_thread, param) { struct r600_common_screen *rscreen = (struct r600_common_screen*)param; |