summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-10-02 15:51:08 +0200
committerThierry Reding <treding@nvidia.com>2018-05-02 17:29:39 +0200
commit248f843f0e36ca7875ad0a252af72d050f27b8c1 (patch)
tree62db24338558b2d1041662496d00697466e441c7 /include
parent1ac3ecde2f2c9afd7110389eccc6860daa6627ca (diff)
nouveau: Support fence FDs
Add a new nouveau_pushbuf_kick_fence() function that takes and emits a sync fence FD. The fence FD can be waited on, or merged with other fence FDs, or passed back to the kernel as a prerequisite for a subsequent HW operation. Based heavily on work by Lauri Peltonen <lpeltonen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/nouveau_drm.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index d42105c8..30a55172 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -179,6 +179,37 @@ struct drm_nouveau_gem_pushbuf {
__u64 gart_available;
};
+#define NOUVEAU_GEM_FENCE_WAIT (1 << 0)
+#define NOUVEAU_GEM_FENCE_EMIT (1 << 1)
+#define NOUVEAU_GEM_FENCE_FD (1 << 2)
+#define NOUVEAU_GEM_FLAGS (NOUVEAU_GEM_FENCE_WAIT | \
+ NOUVEAU_GEM_FENCE_EMIT | \
+ NOUVEAU_GEM_FENCE_FD)
+
+struct drm_nouveau_gem_fence {
+ uint32_t handle;
+ uint32_t flags;
+};
+
+#define NOUVEAU_GEM_PUSHBUF_FLAGS 0
+
+struct drm_nouveau_gem_pushbuf2 {
+ uint32_t channel;
+ uint32_t nr_buffers;
+ uint64_t buffers;
+ uint32_t nr_relocs;
+ uint32_t nr_push;
+ uint64_t relocs;
+ uint64_t push;
+ uint32_t suffix0;
+ uint32_t suffix1;
+ uint64_t vram_available;
+ uint64_t gart_available;
+ uint32_t flags;
+ uint32_t num_fences;
+ uint64_t fences;
+};
+
#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
#define NOUVEAU_GEM_CPU_PREP_NOBLOCK 0x00000002
#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
@@ -213,6 +244,7 @@ struct drm_nouveau_sarea {
#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
#define DRM_NOUVEAU_GEM_CPU_FINI 0x43
#define DRM_NOUVEAU_GEM_INFO 0x44
+#define DRM_NOUVEAU_GEM_PUSHBUF2 0x45
#if defined(__cplusplus)
}