mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
nouveau: use atomic operations for driver statistics
multiple threads can write to those at the same time Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
a28ff22295
commit
d63a133082
1 changed files with 4 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/disk_cache.h"
|
||||
#include "util/u_atomic.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
@ -106,10 +107,10 @@ struct nouveau_screen {
|
|||
|
||||
#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
|
||||
# define NOUVEAU_DRV_STAT(s, n, v) do { \
|
||||
(s)->stats.named.n += (v); \
|
||||
p_atomic_add(&(s)->stats.named.n, (v)); \
|
||||
} while(0)
|
||||
# define NOUVEAU_DRV_STAT_RES(r, n, v) do { \
|
||||
nouveau_screen((r)->base.screen)->stats.named.n += (v); \
|
||||
# define NOUVEAU_DRV_STAT_RES(r, n, v) do { \
|
||||
p_atomic_add(&nouveau_screen((r)->base.screen)->stats.named.n, v); \
|
||||
} while(0)
|
||||
# define NOUVEAU_DRV_STAT_IFD(x) x
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue