mesa/src/intel/vulkan
Kenneth Graunke a7b054c974 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>
2023-12-07 15:12:38 -08:00
..
grl intel: Generate source file with utf-8 encoding from mako template 2023-12-07 12:41:07 +00:00
i915 anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
layers anv: handle missing astc for gfx125 in CreateImageView 2023-05-12 06:59:34 +00:00
shaders anv/xehp+: Enable TBIMR in generated draw calls. 2023-10-27 14:50:42 -07:00
tests anv: fail pool allocation when over the maximal size 2023-10-30 14:47:18 +00:00
xe anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
anv_allocator.c anv: Promote bos to host_cached+host_coherent in platforms with LLC 2023-12-06 22:18:26 +00:00
anv_android.c anv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo() 2023-11-08 01:20:42 +00:00
anv_android.h anv: Use the new vk_device_memory base struct 2023-03-31 14:57:03 +00:00
anv_android_stubs.c anv,hasvk: android ahb is not always exportable 2023-05-11 22:18:03 +00:00
anv_astc_emu.c anv: add gen9 astc workaround 2023-10-25 00:06:04 +00:00
anv_batch_chain.c anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
anv_blorp.c blorp: set min/max viewport depths to -FLT_MAX/FLT_MAX when EXT_depth_range_unrestricted is enabled 2023-12-01 13:23:54 +00:00
anv_bo_sync.c anv: Add a tracepoint for the fallback implicit sync wait path. 2023-01-12 20:21:03 +00:00
anv_cmd_buffer.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_descriptor_set.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_device.c anv: Don't report more memory available than the heap size 2023-12-07 15:12:38 -08:00
anv_formats.c anv/sparse: check if the non-sparse version is supported first 2023-12-06 00:29:58 +00:00
anv_gem.c anv: Calculate mmap mode based on alloc_flags 2023-11-08 01:20:42 +00:00
anv_gem_stubs.c anv/trtt: add struct anv_trtt_batch_bo and pass it around 2023-11-17 17:58:29 +00:00
anv_genX.h anv: implement dummy blit for Wa_16018063123 2023-11-29 08:09:06 +00:00
anv_image.c anv: update symbols that have become aliases for newer ones 2023-12-04 18:06:57 +00:00
anv_internal_kernels.c intel/compiler: Remove unused parameter from brw_nir_analyze_ubo_ranges() 2023-11-08 18:10:31 +00:00
anv_internal_kernels.h anv: fixup 32bit build of internal shaders 2023-10-25 11:47:40 +00:00
anv_kmd_backend.c anv: Add gem VM bind and unbind to backend 2023-03-11 17:56:01 +00:00
anv_kmd_backend.h anv/trtt: add struct anv_trtt_batch_bo and pass it around 2023-11-17 17:58:29 +00:00
anv_measure.c anv: Rename ANV_BO_ALLOC_SNOOPED to ANV_BO_ALLOC_HOST_CACHED_COHERENT 2023-11-29 14:57:42 +00:00
anv_measure.h anv: add a custom AcquireNextImage2KHR func 2022-02-17 22:15:23 +00:00
anv_mesh_perprim_wa.c treewide: Merge num_mesh_vertices_per_primitive and u_vertices_per_prim into mesa_vertices_per_prim 2023-10-26 09:35:04 +00:00
anv_nir.h anv/hasvk: track robustness per pipeline stage 2023-08-09 09:00:12 +03:00
anv_nir_apply_pipeline_layout.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_nir_compute_push_layout.c treewide: Avoid use align as variable, replace it with other names 2023-12-07 02:30:53 +00:00
anv_nir_lower_load_patch_vertices_in.c treewide: Use nir_shader_intrinsic_pass sometimes 2023-08-24 15:48:02 +00:00
anv_nir_lower_multiview.c treewide: Use nir_before/after_impl for more elaborate cases 2023-08-30 19:30:58 +00:00
anv_nir_lower_resource_intel.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_nir_lower_ubo_loads.c treewide: Use nir_shader_intrinsic_pass sometimes 2023-08-24 15:48:02 +00:00
anv_nir_push_descriptor_analysis.c nir: Drop nir_dest 2023-08-14 21:22:53 +00:00
anv_perf.c anv/iris: report counter symbols with debug option 2023-03-08 12:45:43 +00:00
anv_pipeline.c anv: update symbols that have become aliases for newer ones 2023-12-04 18:06:57 +00:00
anv_pipeline_cache.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_private.h anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
anv_queue.c anv: Execute an empty batch to sync main and companion RCS batch 2023-09-07 06:39:06 +00:00
anv_sparse.c anv/sparse: document USAGE_2D_3D_COMPATIBLE as non-standard too 2023-12-06 00:29:58 +00:00
anv_util.c anv: fix missing naming for dirty bit 2023-11-17 10:17:51 +00:00
anv_utrace.c anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
anv_va.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
anv_video.c anv/video: only report matching memory types for protected sessions 2023-12-06 19:17:17 +00:00
anv_wsi.c anv: Avoid unnecessary intel_flush calls 2023-12-06 22:18:26 +00:00
genX_acceleration_structure.c intel/ds: track acceleration RT commands 2023-10-06 11:10:12 +00:00
genX_blorp_exec.c anv/blorp: move helper function about BTI changes to blorp 2023-11-17 10:17:51 +00:00
genX_cmd_buffer.c intel/genxml/xe2: Update PIPELINE_SELECT 2023-12-07 14:16:18 +00:00
genX_cmd_draw_generated_indirect.h anv: Fix MI_ARB_CHECK calls in generated indirect draws optimization 2023-12-04 22:02:59 +00:00
genX_cmd_draw_helpers.h anv: get rid of the duplicate pipeline fields in command buffer state 2023-11-17 10:17:51 +00:00
genX_gfx_state.c anv: ensure that we clamp only when EXT_depth_range_unrestricted is not enabled 2023-12-01 13:23:54 +00:00
genX_gpu_memcpy.c anv: WA 16014538804 for DG2, MTL A0 2023-11-08 11:00:55 +00:00
genX_init_state.c anv: use 2 different buffers for surfaces/samplers in descriptor sets 2023-12-04 23:06:05 +00:00
genX_pipeline.c anv/xe2+: Use Region-based Tessellation redistribution 2023-12-02 02:22:07 +00:00
genX_query.c anv: Rename ANV_BO_ALLOC_SNOOPED to ANV_BO_ALLOC_HOST_CACHED_COHERENT 2023-11-29 14:57:42 +00:00
genX_simple_shader.c anv: fix CC_VIEWPORT pointer dirty after blorp/simple-shaders 2023-11-17 10:17:51 +00:00
genX_video.c anv: Calculate mmap mode based on alloc_flags 2023-11-08 01:20:42 +00:00
meson.build anv: fail pool allocation when over the maximal size 2023-10-30 14:47:18 +00:00