mesa/src/intel
Kenneth Graunke 8975c22b52 anv: Don't report more memory available than the heap size
When calculating the system memory heap size, we report only 3/4 of
the total RAM size (or 1/2 for systems with less than 4GB of RAM).

In the memory budget extension query, we were reporting 90% of the
available system memory.  If most of the memory in the system is free,
this could result in the total heap size being 3/4 of RAM, but the
memory available being 9/10 of RAM.  But if the application tried to
allocate the memory reported as "available", it would exceed the heap
size.  This can confuse some applications.

This patch makes the memory budget query clamp the available RAM to
the heap size, so it will never report more available than the heap
can provide.  Unfortunately, this means that we'll report only 67.5%
of system memory as available (3/4 * 9/10).  We may want to adjust
this estimate in the future.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26553>
(cherry picked from commit a7b054c974)
2023-12-08 11:24:46 +00:00
..
blorp blorp: Use the correct miptail start LOD for surfaces 2023-10-13 21:58:59 +00:00
ci intel/ci: fix .hasvk-manual-rules 2023-11-28 13:03:57 +00:00
common intel/aux_map: introduce ref count of L1 entries 2023-12-03 08:05:27 +00:00
compiler intel/compiler: infer the number of operands using lsc_op_num_data_values 2023-12-08 11:24:46 +00:00
dev intel/dev: expand existing fix for all gfx12 with small EU count 2023-10-25 05:15:47 +00:00
ds intel/ds: provide names for different events of a timeline's row 2023-10-17 11:19:13 +00:00
genxml anv: enable FCV for Gen12.5 2023-10-11 12:18:15 +00:00
isl isl: disable MCS compression on R9G9B9E5 2023-11-10 14:46:19 +00:00
nullhw-layer meson: support installation tags 2023-09-11 13:00:45 +00:00
perf intel/perf: fix regex escaping 2023-11-28 13:03:56 +00:00
tools intel/common: Move intel_clflush.h to intel_mem.h/intel_mem.c 2023-09-06 01:39:53 +00:00
vulkan anv: Don't report more memory available than the heap size 2023-12-08 11:24:46 +00:00
vulkan_hasvk hasvk: Support builiding on non-Intel 2023-10-30 15:47:13 +00:00
meson.build intel: Only build perf if drivers or tools are enabled 2023-08-31 21:53:19 +00:00