freedreno/a6xx: fix hangs with newer sqe fw
[mesa.git] / src / gallium / drivers / nouveau / nouveau_screen.h
index 328646fe3ce79beb0384074027cee9f861824760..1302c608bec29026308c91386609b65e804bf887 100644 (file)
@@ -2,6 +2,8 @@
 #define __NOUVEAU_SCREEN_H__
 
 #include "pipe/p_screen.h"
+#include "util/disk_cache.h"
+#include "util/u_atomic.h"
 #include "util/u_memory.h"
 
 #ifdef DEBUG
@@ -15,8 +17,12 @@ extern int nouveau_mesa_debug;
 
 struct nouveau_bo;
 
+#define NOUVEAU_SHADER_CACHE_FLAGS_IR_TGSI 0 << 0
+#define NOUVEAU_SHADER_CACHE_FLAGS_IR_NIR  1 << 0
+
 struct nouveau_screen {
    struct pipe_screen base;
+   struct nouveau_drm *drm;
    struct nouveau_device *device;
    struct nouveau_object *channel;
    struct nouveau_client *client;
@@ -24,6 +30,8 @@ struct nouveau_screen {
 
    int refcount;
 
+   unsigned transfer_pushbuf_threshold;
+
    unsigned vidmem_bindings; /* PIPE_BIND_* where VRAM placement is desired */
    unsigned sysmem_bindings; /* PIPE_BIND_* where GART placement is desired */
    unsigned lowmem_bindings; /* PIPE_BIND_* that require an address < 4 GiB */
@@ -58,6 +66,10 @@ struct nouveau_screen {
       unsigned profiles_present;
    } firmware_info;
 
+   struct disk_cache *disk_shader_cache;
+
+   bool prefer_nir;
+
 #ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
    union {
       uint64_t v[29];
@@ -100,10 +112,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