Mesa (master): gallium: clarify reference counting for fence

Rob Clark robclark at kemper.freedesktop.org
Fri Jul 10 15:58:21 UTC 2015


Module: Mesa
Branch: master
Commit: f60354ee72fdee988fd604994e8b8c8d75fe78be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f60354ee72fdee988fd604994e8b8c8d75fe78be

Author: Rob Clark <robclark at freedesktop.org>
Date:   Wed Jul  8 15:00:51 2015 -0400

gallium: clarify reference counting for fence

Nowhere was it spelled out that the state tracker may expect the pipe
driver to unref the old fence.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/include/pipe/p_context.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index c2eedf8..d2c2e4c 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -361,8 +361,14 @@ struct pipe_context {
                         const void *clear_value,
                         int clear_value_size);
 
-   /** Flush draw commands
+   /**
+    * Flush draw commands
+    *
+    * NOTE: use screen->fence_reference() (or equivalent) to transfer
+    * new fence ref to **fence, to ensure that previous fence is unref'd
     *
+    * \param fence  if not NULL, an old fence to unref and transfer a
+    *    new fence reference to
     * \param flags  bitfield of enum pipe_flush_flags values.
     */
    void (*flush)(struct pipe_context *pipe,




More information about the mesa-commit mailing list