summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nouveau_winsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_winsys.h')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_winsys.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index bed014b9ce..b144bef5e6 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -2,7 +2,6 @@
#define NOUVEAU_WINSYS_H
#include <stdint.h>
-#include "util/u_simple_screen.h"
#include "pipe/p_defines.h"
#include "nouveau/nouveau_bo.h"
@@ -17,14 +16,25 @@
#define NOUVEAU_CAP_HW_VTXBUF (0xbeef0000)
#define NOUVEAU_CAP_HW_IDXBUF (0xbeef0001)
-#define NOUVEAU_TEXTURE_USAGE_LINEAR (1 << 16)
-
-#define NOUVEAU_BUFFER_USAGE_TEXTURE (1 << 16)
-#define NOUVEAU_BUFFER_USAGE_ZETA (1 << 17)
-#define NOUVEAU_BUFFER_USAGE_TRANSFER (1 << 18)
-
-/* use along with GPU_WRITE for 2D-only writes */
-#define NOUVEAU_BUFFER_USAGE_NO_RENDER (1 << 19)
+static inline uint32_t
+nouveau_screen_transfer_flags(unsigned pipe)
+{
+ uint32_t flags = 0;
+
+ if (pipe & PIPE_TRANSFER_READ)
+ flags |= NOUVEAU_BO_RD;
+ if (pipe & PIPE_TRANSFER_WRITE)
+ flags |= NOUVEAU_BO_WR;
+ if (pipe & PIPE_TRANSFER_DISCARD)
+ flags |= NOUVEAU_BO_INVAL;
+ if (pipe & PIPE_TRANSFER_DONTBLOCK)
+ flags |= NOUVEAU_BO_NOWAIT;
+ else
+ if (pipe & PIPE_TRANSFER_UNSYNCHRONIZED)
+ flags |= NOUVEAU_BO_NOSYNC;
+
+ return flags;
+}
extern struct pipe_screen *
nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *);