mesa/src
Kenneth Graunke 72a28706a4 iris: Move some iris_bo entries into a union
We would like to start performing slab allocation of resources, where
multiple resources can be backed by a single GEM object.

Originally, I had thought to move busy tracking, cache domain tracking,
and so on into resources themselves, instead of having them at the BO
level.  Multiple resources would point at the same BO with an offset.
Unfortunately, this meant adjusting the batch BO pinning code to take
resources rather than BOs.  That cascades into needing iris_address
for genxml packing to store resources, not BOs.  Which means that places
which have use raw BOs would need to start creating resources instead.
Except some places, like aux BO handling, really don't make sense as
pipe resources and really would rather use raw BOs.  So iris_address
would need to store both, which convolutes the genxml field.  And,
having a BO and resource means that every place in the code needs to
handle that offset correctly.  It sounds simple, but is a giant mess.

Instead, we take a different route: adjust iris_bo itself, so that BOs
are either be backed by a GEM object (as is the case today), or backed
by another underlying BO.  "Real" BOs have bo->gem_handle != 0.  "Slab
allocated" or "fake" or "wrapper" BOs have bo->gem_handle == 0.  We move
fields into a union based on these cases.  amdgpu takes this approach.

This sounds complex at first glance---in theory, every place that
interacts with BOs might need to handle the wrapper BO special case.
But in practice, they don't.  For suballocated BOs, we can set the
wrapper's address field to the underlying BO's address plus any offset,
at which point it looks like any other BO.  Most other properties are
easily queried; the main code that needs updating is execbuf handling
and bufmgr internals.

For now, we simply move the fields.  Any code that accesses either
bo->real.* or bo->gem_handle will need updating in future patches to
actually handle the slab-allocated case.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12623>
2021-10-01 04:58:26 +00:00
..
amd radv: plug leaks in radv_device_init_accel_struct_build_state 2021-09-30 15:43:35 +00:00
android_stub egl/android: refactor to use the legit vndk/window.h header 2021-06-09 21:07:54 +00:00
asahi nir: add indirect loop unrolling to compiler options 2021-08-03 10:54:50 +00:00
broadcom v3dv: Use VK_DEFINE_*HANDLE_CASTS instead of rolling our own 2021-09-29 23:27:52 +00:00
compiler nir/lower_blend: Shrink blended result if needed 2021-09-30 16:54:42 +02:00
drm-shim drm-shim: Support kernels with >4k pages 2021-08-13 23:33:52 +00:00
egl gallium: add PIPE_CAP_PREFER_BACK_BUFFER_REUSE 2021-09-29 08:14:57 +00:00
etnaviv mesa: Prioritize checking for GLES2's uniform transpose error. 2021-09-21 23:06:42 +00:00
freedreno ci/freedreno: Disable flaky a530 for now. 2021-09-30 18:01:51 +00:00
gallium iris: Move some iris_bo entries into a union 2021-10-01 04:58:26 +00:00
gbm gbm: assume USE_SCANOUT in create_with_modifiers 2021-10-01 00:02:36 +02:00
getopt
glx gallium: add PIPE_CAP_PREFER_BACK_BUFFER_REUSE 2021-09-29 08:14:57 +00:00
gtest
hgl
imgui
intel anv/slice_hash: Don't allocate more than once with multiple queues 2021-09-30 18:21:51 +00:00
loader loader/dri3: fix swap out of order when changing swap interval 2021-09-30 03:27:14 +00:00
mapi mesa: GL_ARB_ES3_2_compatibility GL compat profile support 2021-09-23 11:10:23 +00:00
mesa intel/blorp: Convert blorp_clear color_write_disable to a bitmask 2021-09-30 17:41:33 +00:00
microsoft Move a bunch of the CLC stuff from src/microsoft to common code 2021-09-30 07:09:08 +00:00
nouveau
panfrost panvk/ci: Enable blend tests 2021-09-30 16:56:38 +02:00
tool pps: Panfrost pps driver 2021-07-13 11:03:55 +00:00
util drirc: Set vs_position_always_precise for Assault Android Cactus 2021-09-30 10:46:39 +00:00
virtio venus: keep layouts of descriptor sets alive 2021-09-30 03:16:19 +00:00
vulkan wsi/x11: fix uninit value by using zalloc for swapchain 2021-09-30 19:56:51 +00:00
meson.build meson: Include EGL after gallium 2021-09-15 20:17:31 +00:00