gallium: add PIPE_FLUSH_ASYNC and PIPE_FLUSH_HINT_FINISH
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 22 Oct 2017 15:38:47 +0000 (17:38 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 9 Nov 2017 12:58:16 +0000 (13:58 +0100)
Also document some subtleties of pipe_context::flush.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/docs/source/context.rst
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_defines.h

index ba7fef8301da839115cc36d44f9de40719f2f2e1..81822203728070769e9e5634a66ad36da15ebcca 100644 (file)
@@ -521,6 +521,15 @@ and the context is still unflushed, and the ctx parameter of fence_finish is
 equal to the context where the fence was created, fence_finish will flush
 the context.
 
+PIPE_FLUSH_ASYNC: The flush is allowed to be asynchronous. Unlike
+``PIPE_FLUSH_DEFERRED``, the driver must still ensure that the returned fence
+will finish in finite time. However, subsequent operations in other contexts of
+the same screen are no longer guaranteed to happen after the flush. Drivers
+which use this flag must implement pipe_context::fence_server_sync.
+
+PIPE_FLUSH_HINT_FINISH: Hints to the driver that the caller will immediately
+wait for the returned fence.
+
 
 ``flush_resource``
 
index 087836d1c0cd4c348231a62f8c695ced5e7aaee8..d9228e4fc92874ac698ae962741802240d44aa90 100644 (file)
@@ -469,7 +469,13 @@ struct pipe_context {
                         int clear_value_size);
 
    /**
-    * Flush draw commands
+    * Flush draw commands.
+    *
+    * This guarantees that the new fence (if any) will finish in finite time,
+    * unless PIPE_FLUSH_DEFERRED is used.
+    *
+    * Subsequent operations on other contexts of the same screen are guaranteed
+    * to execute after the flushed commands, unless PIPE_FLUSH_ASYNC is used.
     *
     * NOTE: use screen->fence_reference() (or equivalent) to transfer
     * new fence ref to **fence, to ensure that previous fence is unref'd
index ddc951464b9130d82423e14c792c36c4f62736b0..776a879e0a67b6e7c5de0bddd38f411b074adc12 100644 (file)
@@ -352,6 +352,8 @@ enum pipe_flush_flags
    PIPE_FLUSH_END_OF_FRAME = (1 << 0),
    PIPE_FLUSH_DEFERRED = (1 << 1),
    PIPE_FLUSH_FENCE_FD = (1 << 2),
+   PIPE_FLUSH_ASYNC = (1 << 3),
+   PIPE_FLUSH_HINT_FINISH = (1 << 4),
 };
 
 /**