summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-31 20:58:10 -0400
committerMarek Olšák <[email protected]>2018-09-07 17:59:02 -0400
commit21ca322e637291b89a445159fc45b8dbf638e6c9 (patch)
treec0f2417651f7c6dba6c0ec9da1ee6755132e7181 /src/mesa/state_tracker/st_context.h
parent9ce2cef68f37a05cd2e4e4128395af38e7be963f (diff)
st/mesa: throttle texture uploads if their memory usage goes beyond a limit
This prevents radeonsi from running out of memory. It also increases texture upload performance by being nice to the kernel memory manager.
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r--src/mesa/state_tracker/st_context.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 6b1b5633ecc..14b9b018809 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -32,6 +32,7 @@
#include "state_tracker/st_api.h"
#include "main/fbobject.h"
#include "state_tracker/st_atom.h"
+#include "util/u_helpers.h"
#include "util/u_inlines.h"
#include "util/list.h"
#include "vbo/vbo.h"
@@ -302,6 +303,12 @@ struct st_context
/* Winsys buffers */
struct list_head winsys_buffers;
+
+ /* Throttling for texture uploads and similar operations to limit memory
+ * usage by limiting the number of in-flight operations based on
+ * the estimated allocated size needed to execute those operations.
+ */
+ struct util_throttle throttle;
};