[Mesa-dev] [PATCH 12/13] anv/icl: enable 16bit single plane YCbCr formats

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Nov 5 15:36:06 UTC 2018


Now that we have the ability to sample easily for this on Gen11 and
also the refactoring to just enable this on that particular platform,
let's turn this on.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/vulkan/anv_formats.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index c23fc1c5b1f..ff66b8c5256 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -420,12 +420,18 @@ static const struct anv_format *ycbcr_formats[] = {
    fmt_list(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, fmt_unsupported),
    fmt_list(VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16,  fmt_unsupported),
    fmt_list(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, fmt_unsupported),
-   /* TODO: it is possible to enable the following 2 formats, but that
-    * requires further refactoring of how we handle multiplanar formats.
+   /* The following 2 formats are only available on Gen11+ because there is no
+    * HW support for YCbCr formats with 16bits per component and using 2
+    * different views of the same buffer only works on Gen11+.
     */
-   fmt_list(VK_FORMAT_G16B16G16R16_422_UNORM, fmt_unsupported),
-   fmt_list(VK_FORMAT_B16G16R16G16_422_UNORM, fmt_unsupported),
-
+   fmt_list(VK_FORMAT_G16B16G16R16_422_UNORM,
+            ycbcr_gen_fmt(2, gen11_compatible,
+                          y_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO)),
+                          chroma_plane(0, ISL_FORMAT_R16G16B16A16_UNORM, RGBA, _ISL_SWIZZLE(ZERO, BLUE, ZERO, RED), 2, 1))),
+   fmt_list(VK_FORMAT_B16G16R16G16_422_UNORM,
+            ycbcr_gen_fmt(2, gen11_compatible,
+                          y_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(ZERO, GREEN, ZERO, ZERO)),
+                          chroma_plane(0, ISL_FORMAT_R16G16B16A16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, RED, ZERO), 2, 1))),
    fmt_list(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM,
             ycbcr_fmt(3,
                       y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO)),
-- 
2.19.1



More information about the mesa-dev mailing list