tc drivers set this based on os_get_total_physical_memory()/divisor,
which is going to be totally wrong for 32bit processes and explode
the address space
this util function can be used to handle per-platform clamping
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11853>
tc_destroy(&tc->base);
return NULL;
}
+
+void
+threaded_context_init_bytes_mapped_limit(struct threaded_context *tc, unsigned divisor)
+{
+ uint64_t total_ram;
+ if (os_get_total_physical_memory(&total_ram)) {
+ tc->bytes_mapped_limit = total_ram / divisor;
+ if (sizeof(void*) == 4)
+ tc->bytes_mapped_limit = MIN2(tc->bytes_mapped_limit, 512*1024*1024UL);
+ }
+}
struct threaded_context **out);
void
+threaded_context_init_bytes_mapped_limit(struct threaded_context *tc, unsigned divisor);
+
+void
threaded_context_flush(struct pipe_context *_pipe,
struct tc_unflushed_batch_token *token,
bool prefer_async);