Skip to content

Conversation

kpet
Copy link
Contributor

@kpet kpet commented Nov 28, 2023

  • Do we need a Vulkan mechanism to get a DRM format modifier for an image exported from Vulkan?

kpet added 2 commits November 23, 2023 14:41
Change-Id: I6c391b5ecaa203f7db566db68a7e3d124d6038a2
Signed-off-by: Kevin Petit <[email protected]>
Change-Id: I30630ac1232026301356e0265b074b8b41668cb2
Signed-off-by: Kevin Petit <[email protected]>
@bcalidas
Copy link

bcalidas commented Dec 5, 2023

Sharing some initial feedback.

  1. For cl_ext_image_tiling_control, is there really a need for the CL_DEVICE_IMAGE_TILING_DEVICE_ACCESS_EXT token.

  2. For cl_ext_image_tiling_control does CL_DEVICE_IMAGE_TILING_HOST_ACCESS_EXT relate to whether or not the implementation will detile the image on mapping?

  3. For cl_ext_image_tiling_control, is there an assumption that the image is linear if no explicit tiling mode is forced. To us it seemed that the spec implicitly suggested optimal tiling by default.

  4. For cl_ext_image_drm_format_modifer, why would a drm format modifier be required for an image. Shouldn't drm format modifiers be viewed as a decoration of top of optimal tiling. Our thinking was that drm format modifiers would be applied only when importing an optimally tiled image. Additionally, they could be queried for any image ( including linear ) but an application would only make the query when exporting an image.

  5. For cl_ext_image_drm_format_modifier, how are we planning to manage the drm format modifier header file from the implementation side and from the application side.

Comment on lines +138 to +141
{CL_MEM_IMAGE_DRM_FORMAT_MODIFIER_EXT} can be passed as part of the _properties_
parameter to *clCreateImageWithProperties* to provide the DRM format modifier
that describes the layout of image data when an image is created with
{CL_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for Vulkan, there are two ways to create an image with a DRM format modifier:

  1. Using VkImageDrmFormatModifierExplicitCreateInfoEXT, which requires creating the image with the exact DRM format modifier specified. This is analogous to the CL_MEM_IMAGE_DRM_FORMAT_MODIFIER_EXT property added by this extension.
  2. Using VkImageDrmFormatModifierListCreateInfoEXT, which allows creating the image from a set of specified DRM format modifiers. This provides the implementation with some freedom to choose what it considers to be the best DRM format modifier.

Should we support (2) and add the ability to pass a list of viable DRM format modifiers as well?

Note, if we added this functionality, then the application should still be able to query CL_IMAGE_DRM_FORMAT_MODIFIER_EXT to determine which of the DRM format modifiers in the set was chosen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in the 2025/04/15 memory TSG teleconference: another way of allowing implementations to express a preferred DRM modifier (which is what we'd really get with (2)) would be to state that the list of supported DRM modifiers reported by the implementation is ordered by preference. No strong preference for one or the other approach expressed on the call.

@nyanmisaka
Copy link

Just wondering if there is a way in ARM libMali to import AFBC compressed images? I came across this draft by accident while searching.

In my use case the hardware video decoder is able to produce images with the AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 DRM format modifer and it would help performance (reduce memory bandwidth utilizing) if libMali could directly import that instead of requiring linear images.

@kpet
Copy link
Contributor Author

kpet commented Apr 30, 2025

Just wondering if there is a way in ARM libMali to import AFBC compressed images? I came across this draft by accident while searching.

@nyanmisaka Yes, this is supported in shipping drivers using this extension. I'm happy to help you get going with it. Feel free to reach out at [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants