Mesa (master): llvmpipe: comments for fence functions
Brian Paul
brianp at kemper.freedesktop.org
Wed Apr 14 20:33:06 UTC 2010
Module: Mesa
Branch: master
Commit: 8239fd4baa8ba6ce546960ad41a8c1c6088b3de3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8239fd4baa8ba6ce546960ad41a8c1c6088b3de3
Author: Brian Paul <brianp at vmware.com>
Date: Wed Apr 14 13:03:26 2010 -0600
llvmpipe: comments for fence functions
---
src/gallium/drivers/llvmpipe/lp_fence.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c b/src/gallium/drivers/llvmpipe/lp_fence.c
index 00dc3ea..75d8d2b 100644
--- a/src/gallium/drivers/llvmpipe/lp_fence.c
+++ b/src/gallium/drivers/llvmpipe/lp_fence.c
@@ -33,6 +33,15 @@
#include "lp_fence.h"
+/**
+ * Create a new fence object.
+ *
+ * The rank will be the number of bins in the scene. Whenever a rendering
+ * thread hits a fence command, it'll increment the fence counter. When
+ * the counter == the rank, the fence is finished.
+ *
+ * \param rank the expected finished value of the fence counter.
+ */
struct lp_fence *
lp_fence_create(unsigned rank)
{
@@ -49,6 +58,7 @@ lp_fence_create(unsigned rank)
}
+/** Destroy a fence. Called when refcount hits zero. */
static void
lp_fence_destroy(struct lp_fence *fence)
{
@@ -58,6 +68,10 @@ lp_fence_destroy(struct lp_fence *fence)
}
+/**
+ * For reference counting.
+ * This is a Gallium API function.
+ */
static void
llvmpipe_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
@@ -72,6 +86,10 @@ llvmpipe_fence_reference(struct pipe_screen *screen,
}
+/**
+ * Has the fence been executed/finished?
+ * This is a Gallium API function.
+ */
static int
llvmpipe_fence_signalled(struct pipe_screen *screen,
struct pipe_fence_handle *fence,
@@ -83,6 +101,10 @@ llvmpipe_fence_signalled(struct pipe_screen *screen,
}
+/**
+ * Wait for the fence to finish.
+ * This is a Gallium API function.
+ */
static int
llvmpipe_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *fence_handle,
@@ -100,6 +122,10 @@ llvmpipe_fence_finish(struct pipe_screen *screen,
}
+/**
+ * Called by the rendering threads to increment the fence counter.
+ * When the counter == the rank, the fence is finished.
+ */
void
lp_fence_signal(struct lp_fence *fence)
{
More information about the mesa-commit
mailing list