mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
radeonsi: use thread_context::bytes_mapped_limit
Limit the amount of "in-flight" mapping to 1/4 of the total RAM. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2735 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4508>
This commit is contained in:
parent
15cf7d170b
commit
dcb1e8fef8
1 changed files with 11 additions and 3 deletions
|
|
@ -686,6 +686,7 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, v
|
||||||
{
|
{
|
||||||
struct si_screen *sscreen = (struct si_screen *)screen;
|
struct si_screen *sscreen = (struct si_screen *)screen;
|
||||||
struct pipe_context *ctx;
|
struct pipe_context *ctx;
|
||||||
|
uint64_t total_ram;
|
||||||
|
|
||||||
if (sscreen->debug_flags & DBG(CHECK_VM))
|
if (sscreen->debug_flags & DBG(CHECK_VM))
|
||||||
flags |= PIPE_CONTEXT_DEBUG;
|
flags |= PIPE_CONTEXT_DEBUG;
|
||||||
|
|
@ -706,9 +707,16 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, v
|
||||||
|
|
||||||
/* Use asynchronous flushes only on amdgpu, since the radeon
|
/* Use asynchronous flushes only on amdgpu, since the radeon
|
||||||
* implementation for fence_server_sync is incomplete. */
|
* implementation for fence_server_sync is incomplete. */
|
||||||
return threaded_context_create(ctx, &sscreen->pool_transfers, si_replace_buffer_storage,
|
struct pipe_context * tc = threaded_context_create(
|
||||||
sscreen->info.is_amdgpu ? si_create_fence : NULL,
|
ctx, &sscreen->pool_transfers, si_replace_buffer_storage,
|
||||||
&((struct si_context *)ctx)->tc);
|
sscreen->info.is_amdgpu ? si_create_fence : NULL,
|
||||||
|
&((struct si_context *)ctx)->tc);
|
||||||
|
|
||||||
|
if (os_get_total_physical_memory(&total_ram)) {
|
||||||
|
((struct threaded_context *) tc)->bytes_mapped_limit = total_ram / 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
return tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue