iris: CCS modifier tests failing with suballocation
The weekly CI job for the modifier test (piglit!374 (merged)) started failing on TGL (https://mesa-ci.01.org/nchery_piglit/compare?lhs=90&rhs=92) with !12623 (ce2e2296):
commit ce2e2296ab61558f02ea2d05ae0cf4a922df84a7
Author: Kenneth Graunke <kenneth@whitecape.org>
Date: Sat Aug 7 23:00:44 2021 -0700
iris: Suballocate BO using the Gallium pb_slab mechanism
With all the preparation in place to handle suballocated BOs at
submission and export, we can now wire up the actual suballocator.
We use Gallium's pb_slab infrastructure for this, which is already
used for this purpose in the amdgpu winsys and now zink as well.
Unlike those drivers, we don't use pb_buffer (it doesn't do much) nor
pb_cache (we already have a buffer cache). Just pb_slab for now.
We can now suballocate BOs at power-of-two (or 3/4 power-of-two)
granularity, between 256B and 2MB. Beyond that, we use actual GEM
objects as before. This should save us some memory on current GPUs
where we previously had a minimum allocation granularity of 4K (page
size), but should save us a /ton/ of memory on future GPUs where the
minimum page size is 64K. Fewer actual GEM objects should also mean
shorter exec_object2 lists passed to the kernel, which could reduce
CPU overhead a bit. Using large allocations where the underlying
GEM objects correspond with the PTE fragment size may also allow the
kernel to use a more efficient page table layout, improving memory
access times.
This cuts nearly half of the memory usage in a Unity3D demo on a
GPU that uses 64K pages.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4722
Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12623>
src/gallium/drivers/iris/iris_batch.c | 2 +
src/gallium/drivers/iris/iris_bufmgr.c | 344 ++++++++++++++++++++++++++++++++-
src/gallium/drivers/iris/iris_bufmgr.h | 2 +
3 files changed, 342 insertions(+), 6 deletions(-)
The stdout:
/tmp/build_root/m64/lib/piglit/bin/ext_image_dma_buf_import-intel_modifiers -auto
found 40 supported formats
format AR24 has 6 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
Probe at (0,0)
Expected: 0.250980 0.125490 0.066667 0.250980
Observed: 0.000000 0.000000 0.000000 0.000000
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
format AB24 has 6 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
Probe at (0,0)
Expected: 0.250980 0.125490 0.066667 0.250980
Observed: 0.000000 0.000000 0.000000 0.000000
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
Probe at (0,0)
Expected: 0.250980 0.125490 0.066667 0.250980
Observed: 0.000000 0.000000 0.000000 0.000000
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
format XR24 has 6 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
format XB24 has 6 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
Probe at (0,0)
Expected: 0.250980 0.125490 0.066667 1.000000
Observed: 0.000000 0.000000 0.000000 1.000000
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
piglit: debug: Testing view sampling
piglit: debug: Testing clears
piglit: debug: Testing view clears
piglit: debug: Testing import
piglit: debug: Testing clear, reimport, sample
format NV12 has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
format P010 has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
format P012 has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
format P016 has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
format YUYV has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling
format UYVY has 4 supported modifiers
piglit: debug: Testing import
piglit: debug: Testing export
piglit: debug: Testing sampling