mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
llvmpipe: Cap to 2 GB on 32 bits
On 32 bits system, application memory is quite limited. llvmpipe uses application memory. To help prevent memory exhaustion, limit reported memory availability to 2GB. Some gallium nine apps do check reported memory by allocating resources until memory is full. Gallium nine refuses allocations when 80% of the reported memory limit is used. This change helps some apps to start. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
218459771a
commit
814ca96d0d
1 changed files with 6 additions and 0 deletions
|
|
@ -280,6 +280,12 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
|||
if (!os_get_total_physical_memory(&system_memory))
|
||||
return 0;
|
||||
|
||||
if (sizeof(void *) == 4)
|
||||
/* Cap to 2 GB on 32 bits system. We do this because llvmpipe does
|
||||
* eat application memory, which is quite limited on 32 bits. App
|
||||
* shouldn't expect too much available memory. */
|
||||
system_memory = MIN2(system_memory, 2048 << 20);
|
||||
|
||||
return (int)(system_memory >> 20);
|
||||
}
|
||||
case PIPE_CAP_UMA:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue