/* Preferences */
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return 0;
+ case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET: {
+ /* etnaviv is being run on systems as small as 256MB total RAM so
+ * we need to provide a sane value for such a device. Limit the
+ * memory budget to min(~3% of pyhiscal memory, 64MB).
+ *
+ * a simple divison by 32 provides the numbers we want.
+ * 256MB / 32 = 8MB
+ * 2048MB / 32 = 64MB
+ */
+ uint64_t system_memory;
+
+ if (!os_get_total_physical_memory(&system_memory))
+ system_memory = 4096 << 20;
+
+ return MIN2(system_memory / 32, 64 * 1024 * 1024);
+ }
case PIPE_CAP_MAX_VARYINGS:
return screen->specs.max_varyings;