anv: Meet CCS alignment reqs with dedicated allocs
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 25 Aug 2023 20:10:29 +0000 (16:10 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 23 Oct 2023 21:37:24 +0000 (21:37 +0000)
commit4cdd3178fb10723e91060a75c34f379a1a92184c
tree0b54b5057bfedec311b03bc9f19a123ae24f1ded
parent2cbec810419e88c2f6acd18355b14b3d9568623c
anv: Meet CCS alignment reqs with dedicated allocs

At image bind time, we require BOs to meet aux-map alignment
requirements in order to enable CCS on images. This is a heuristic
controlled by anv_bo_allows_aux_map().

To improve the chances of getting a properly aligned BO, we make use of
the dedicated allocation extension. Firstly, we report to applications a
preference for dedicated memory if an image would like to use the aux
map. Secondly, we align the VMA for dedicated allocations to meet
aux-map requirements.

To make enabling modifiers much easier on integrated gfx12, report
dedicated allocations as a requirement for modifiers which specify CCS.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h