Hello community, I've been having problems about how to "enable HDR10/HDR10+" in a Vulkan Android application. Due to the lack of content about this and strange behavior in Vulkan mobile drivers the confusion only increases.
I am aware that HDR and WCG are different things but they are related. HDR is about contrast depth and WCG is about color depth and is related to color space.
My doubts are:1. Why the drivers provided by Arm for devices(with HDR10/HDR10+ display) do not expose surface formats with color space other than VK_KHR_SRGB_NONLINEAR_KHR (Samsung Galaxy S20/Exynos with VK_EXT_swapchain_colorspace extension properly enabled)?2. Why do drivers provided by Arm for devices(with HDR10/HDR10+ display) expose surface formats with color space other than VK_KHR_SRGB_NONLINEAR_KHR (Samsung Galaxy Note 9/Exynos with VK_EXT_swapchain_colorspace extension properly enabled)?3. Is there an alternative way on Android besides the one officially exposed by Vulkan to display HDR/WCG content on the display that supports it?
Thanks in advance for any additions, corrections, or responses.
Others: Enhance graphics with wide color content
Vulkan swapchain surface format availability requires support from two independent pieces of hardware. Both the GPU and the display controller must support the image surface format, and the display controller must support the color space. Note that the graphics driver itself does nothing with the color-space information, that's purely metadata passed to the Vulkan WSI and the display controller.
The GPU surface format support required here is relatively simple, as there is little color space handling in the GPU itself defined in the Vulkan specification. Only swapchain images using the R8G8B8A8_SRGB image format require a non-linear transfer function for the GPU. All the others are defined as a linear transfer function from the point of view of the GPU, and if a transfer function is required to modify the data the application must implement it in shaders. The GPU can therefore support nearly all of the extended color spaces, as most are using commonly available image formats such as RGB565, RGBA8, RGB10A2 or RGBAf16.
The main limitation on availability to applications is whether the display controller in the device supports the format or color space, and whether they are exposed by the device manufacturer via their integration with the Vulkan WSI. This is not part of the Arm IP or the Arm driver code - this is handled by the Android Vulkan WSI layer, which is outside of the core driver, and the integration with it provided by the display controller vendor.
There definitely are Mali devices that expose HDR color spaces e.g. Pixel 6: https://vulkan.gpuinfo.org/displayreport.php?id=20106#surfaceformats
HTH, Pete
We use U10A2_Pack32 + ST2084 for HDR10 on most of our platforms, but I don't see that listed. The only HDR format seems to be 16f + EXTENDED_SRGB_NONLINEAR_EXT in that whole list. But that's costly for 3 framebuffers. I don't think DISPLAY_P3_NONLINEAR_EXT is an extended format for HDR, and is only for EDR. But the Vulkan docs don't really make this clear as to what extends past 0 to 1.
Alec said:We use U10A2_Pack32 + ST2084 for HDR10 on most of our platforms, but I don't see that listed.
Vulkan supports VK_COLOR_SPACE_HDR10_ST2084_EXT, but again what is supported on any specific device depends on the display integration that is available.
VK_COLOR_SPACE_HDR10_ST2084_EXT
Alec said:I don't think DISPLAY_P3_NONLINEAR_EXT is an extended format for HDR, and is only for EDR.
Correct - Display P3 is a wider color gamut for the primaries, but it is still using the D65 whitepoint.
Alec said:But the Vulkan docs don't really make this clear as to what extends past 0 to 1.
This is a property of the color space transfer function. The source specifications for DISPLAY_P3 and ST2084 (PQ) define the expected input and output values.