summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_buffer.c1
-rw-r--r--src/gallium/drivers/nouveau/nouveau_fence.c9
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c34
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.h4
4 files changed, 13 insertions, 35 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
index d0cc29104b8..01d3aa46d0e 100644
--- a/src/gallium/drivers/nouveau/nouveau_buffer.c
+++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
@@ -314,7 +314,6 @@ const struct u_resource_vtbl nouveau_buffer_vtbl =
{
u_default_resource_get_handle, /* get_handle */
nouveau_buffer_destroy, /* resource_destroy */
- NULL, /* is_resource_referenced */
nouveau_buffer_transfer_get, /* get_transfer */
nouveau_buffer_transfer_destroy, /* transfer_destroy */
nouveau_buffer_transfer_map, /* transfer_map */
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c
index 18bdb18ad41..d8f59dce9ed 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.c
+++ b/src/gallium/drivers/nouveau/nouveau_fence.c
@@ -90,6 +90,9 @@ nouveau_fence_emit(struct nouveau_fence *fence)
assert(fence->state == NOUVEAU_FENCE_STATE_AVAILABLE);
+ /* set this now, so that if fence.emit triggers a flush we don't recurse */
+ fence->state = NOUVEAU_FENCE_STATE_EMITTED;
+
screen->fence.emit(&screen->base, fence->sequence);
++fence->ref;
@@ -100,8 +103,6 @@ nouveau_fence_emit(struct nouveau_fence *fence)
screen->fence.head = fence;
screen->fence.tail = fence;
-
- fence->state = NOUVEAU_FENCE_STATE_EMITTED;
}
void
@@ -215,6 +216,8 @@ nouveau_fence_wait(struct nouveau_fence *fence)
void
nouveau_fence_next(struct nouveau_screen *screen)
{
- nouveau_fence_emit(screen->fence.current);
+ if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTED)
+ nouveau_fence_emit(screen->fence.current);
+
nouveau_fence_new(screen, &screen->fence.current, FALSE);
}
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index e6cd3064c9a..401155bba6e 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -12,6 +12,7 @@
#include <errno.h>
#include "nouveau/nouveau_bo.h"
+#include "nouveau/nouveau_mm.h"
#include "nouveau_winsys.h"
#include "nouveau_screen.h"
#include "nouveau_fence.h"
@@ -154,20 +155,19 @@ nouveau_screen_fence_ref(struct pipe_screen *pscreen,
nouveau_fence_ref(nouveau_fence(pfence), (struct nouveau_fence **)ptr);
}
-static int
+static boolean
nouveau_screen_fence_signalled(struct pipe_screen *screen,
- struct pipe_fence_handle *pfence,
- unsigned flags)
+ struct pipe_fence_handle *pfence)
{
- return !nouveau_fence_signalled(nouveau_fence(pfence));
+ return nouveau_fence_signalled(nouveau_fence(pfence));
}
-static int
+static boolean
nouveau_screen_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *pfence,
- unsigned flags)
+ uint64_t timeout)
{
- return !nouveau_fence_wait(nouveau_fence(pfence));
+ return nouveau_fence_wait(nouveau_fence(pfence));
}
@@ -210,26 +210,6 @@ nouveau_screen_bo_get_handle(struct pipe_screen *pscreen,
}
}
-
-unsigned int
-nouveau_reference_flags(struct nouveau_bo *bo)
-{
- uint32_t bo_flags;
- int flags = 0;
-
- bo_flags = nouveau_bo_pending(bo);
- if (bo_flags & NOUVEAU_BO_RD)
- flags |= PIPE_REFERENCED_FOR_READ;
- if (bo_flags & NOUVEAU_BO_WR)
- flags |= PIPE_REFERENCED_FOR_WRITE;
-
- return flags;
-}
-
-
-
-
-
int
nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
{
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h
index c091abf2786..186ada39677 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -74,10 +74,6 @@ nouveau_screen_bo_from_handle(struct pipe_screen *pscreen,
struct winsys_handle *whandle,
unsigned *out_stride);
-unsigned int
-nouveau_reference_flags(struct nouveau_bo *bo);
-
-
int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
void nouveau_screen_fini(struct nouveau_screen *);