Skip to content

anv: add initial multi-planar format support with DRM format modifier

Yiwei Zhang requested to merge zzyiwei/mesa:anv-mod-multi-planar into main

This MR adds initial multi-planar format support on the images with modifiers:

  • No aux usage.
  • Each format plane must map to a distinct memory plane.
  • Disjoint bit disabled as suggested for initial support.

For the other cases, currently there is no way to properly map memory planes to format planes and aux planes due to the lack of defined ABI for external multi-planar images.

For some potentially supported cases like all format planes mapping to a single memory plane, additional refactoring is needed to workaround explicit offset + implicit offset combo, thus is out of the scope of this MR.

This MR only enables the below VkFormat Needed for camera/media interop in Venus on top of ANV:

  • VK_FORMAT_G8_B8R8_2PLANE_420_UNORM

This MR ensures no regression on the cts:

  • dEQP-VK.drm_format_modifiers.*

This MR ensures below APIs work correctly on the enabled multi-planar format:

vkGetPhysicalDeviceFormatProperties2
vkGetPhysicalDeviceImageFormatProperties2
vkCreateImage
vkGetImageSubresourceLayout
vkGetImageDrmFormatModifierPropertiesEXT
vkGetImageMemoryRequirements
vkGetImageMemoryRequirements2

Manual testing:

  • I915_FORMAT_MOD_Y_TILED and linear with VK_FORMAT_G8_B8R8_2PLANE_420_UNORM

/cc @chadversary @olv @jekstrand

Edited by Yiwei Zhang

Merge request reports