dri: add P010, P012, P016 for 10bit/12bit/16bit YUV420 formats
authorTapani Pälli <tapani.palli@intel.com>
Mon, 11 Feb 2019 08:01:35 +0000 (10:01 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 12 Feb 2019 06:42:02 +0000 (08:42 +0200)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
include/GL/internal/dri_interface.h
src/egl/drivers/dri2/egl_dri2.c

index f2e46f65f9234906c75ccaa6569d9d654f3920c5..6d134e3a40f168a3f80f3d3b2f78ed0c93fded4b 100644 (file)
@@ -1352,6 +1352,10 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_FOURCC_YVU422      0x36315659
 #define __DRI_IMAGE_FOURCC_YVU444      0x34325659
 
+#define __DRI_IMAGE_FOURCC_P010                0x30313050
+#define __DRI_IMAGE_FOURCC_P012                0x32313050
+#define __DRI_IMAGE_FOURCC_P016                0x36313050
+
 /**
  * Queryable on images created by createImageFromNames.
  *
index 390e99d9a7a8e65142e55f944870e15088c96ed0..17bee797b4a31b4899990da5690424fb71b86d15 100644 (file)
 #include "util/u_vector.h"
 #include "mapi/glapi/glapi.h"
 
+/* Additional definitions not yet in the drm_fourcc.h.
+ */
+#ifndef DRM_FORMAT_P010
+#define DRM_FORMAT_P010         fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#endif
+
+#ifndef DRM_FORMAT_P012
+#define DRM_FORMAT_P012         fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+#endif
+
+#ifndef DRM_FORMAT_P016
+#define DRM_FORMAT_P016         fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+#endif
+
 #define NUM_ATTRIBS 12
 
 static void
@@ -2262,6 +2276,9 @@ dri2_num_fourcc_format_planes(EGLint format)
    case DRM_FORMAT_NV21:
    case DRM_FORMAT_NV16:
    case DRM_FORMAT_NV61:
+   case DRM_FORMAT_P010:
+   case DRM_FORMAT_P012:
+   case DRM_FORMAT_P016:
       return 2;
 
    case DRM_FORMAT_YUV410: