swr/rast: Add new API SwrStallBE
authorTim Rowley <timothy.o.rowley@intel.com>
Fri, 18 Aug 2017 17:34:48 +0000 (12:34 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 13 Sep 2017 15:08:46 +0000 (10:08 -0500)
SwrStallBE stalls the backend threads until all work submitted before
the stall has finished.  The frontend threads can continue to make
forward progress.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/api.cpp
src/gallium/drivers/swr/rasterizer/core/api.h

index ccb6dfb7a19f948094cd6a75b9da878364782bfe..632309821f82d6c415ae4514d7521f6078a82c8d 100644 (file)
@@ -458,6 +458,14 @@ void SwrSync(HANDLE hContext, PFN_CALLBACK_FUNC pfnFunc, uint64_t userData, uint
     AR_API_END(APISync, 1);
 }
 
+void SwrStallBE(HANDLE hContext)
+{
+    SWR_CONTEXT* pContext = GetContext(hContext);
+    DRAW_CONTEXT* pDC = GetDrawContext(pContext);
+
+    pDC->dependent = true;
+}
+
 void SwrWaitForIdle(HANDLE hContext)
 {
     SWR_CONTEXT *pContext = GetContext(hContext);
@@ -1672,6 +1680,7 @@ void SwrGetInterface(SWR_INTERFACE &out_funcs)
     out_funcs.pfnSwrSaveState = SwrSaveState;
     out_funcs.pfnSwrRestoreState = SwrRestoreState;
     out_funcs.pfnSwrSync = SwrSync;
+    out_funcs.pfnSwrStallBE = SwrStallBE;
     out_funcs.pfnSwrWaitForIdle = SwrWaitForIdle;
     out_funcs.pfnSwrWaitForIdleFE = SwrWaitForIdleFE;
     out_funcs.pfnSwrSetVertexBuffers = SwrSetVertexBuffers;
index a39420552b55932c122d2229aadf1949bae01484..577cfb157a516b84fc8218cf9a5244e062b545e5 100644 (file)
@@ -262,6 +262,13 @@ SWR_FUNC(void, SwrSync,
     uint64_t userData2,
     uint64_t userData3);
 
+//////////////////////////////////////////////////////////////////////////
+/// @brief Stall cmd. Stalls the backend until all previous work has been completed.
+///        Frontend work can continue to make progress
+/// @param hContext - Handle passed back from SwrCreateContext
+SWR_FUNC(void, SwrStallBE,
+    HANDLE hContext);
+
 //////////////////////////////////////////////////////////////////////////
 /// @brief Blocks until all rendering has been completed.
 /// @param hContext - Handle passed back from SwrCreateContext
@@ -709,6 +716,7 @@ struct SWR_INTERFACE
     PFNSwrSaveState pfnSwrSaveState;
     PFNSwrRestoreState pfnSwrRestoreState;
     PFNSwrSync pfnSwrSync;
+    PFNSwrStallBE pfnSwrStallBE;
     PFNSwrWaitForIdle pfnSwrWaitForIdle;
     PFNSwrWaitForIdleFE pfnSwrWaitForIdleFE;
     PFNSwrSetVertexBuffers pfnSwrSetVertexBuffers;