util: add a resource wrapper to get resource samples
[mesa.git] / src / gallium / auxiliary / util / u_threaded_context.h
index 53c5a7e8c4c8ad5e8f6c806e5a33516d1fc84ed1..c54dec0b1d7c51cdf1e80e6e2930a7258105e3c8 100644 (file)
@@ -220,7 +220,7 @@ struct tc_unflushed_batch_token;
  * The idea is to have batches as small as possible but large enough so that
  * the queuing and mutex overhead is negligible.
  */
-#define TC_CALLS_PER_BATCH    192
+#define TC_CALLS_PER_BATCH    768
 
 /* Threshold for when to use the queue or sync. */
 #define TC_MAX_STRING_MARKER_BYTES  512
@@ -361,6 +361,12 @@ struct threaded_context {
    unsigned num_direct_slots;
    unsigned num_syncs;
 
+   /* Estimation of how much vram/gtt bytes are mmap'd in
+    * the current tc_batch.
+    */
+   uint64_t bytes_mapped_estimate;
+   uint64_t bytes_mapped_limit;
+
    struct util_queue queue;
    struct util_queue_fence *fence;
 
@@ -408,14 +414,6 @@ threaded_transfer(struct pipe_transfer *transfer)
    return (struct threaded_transfer*)transfer;
 }
 
-static inline struct pipe_context *
-threaded_context_unwrap_unsync(struct pipe_context *pipe)
-{
-   if (!pipe || !pipe->priv)
-      return pipe;
-   return (struct pipe_context*)pipe->priv;
-}
-
 static inline void
 tc_unflushed_batch_token_reference(struct tc_unflushed_batch_token **dst,
                                    struct tc_unflushed_batch_token *src)