0065-egl-null-add-support-for-YU12-and-YV12.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 033231f1902849d2ff8ff3c82bef02174a62e01d Mon Sep 17 00:00:00 2001
  2. From: Luigi Santivetti <luigi.santivetti@imgtec.com>
  3. Date: Mon, 23 Aug 2021 09:18:37 +0100
  4. Subject: [PATCH] egl/null: add support for YU12 and YV12
  5. ---
  6. src/egl/drivers/dri2/platform_null.c | 28 ++++++++++++++++++++++++++++
  7. 1 file changed, 28 insertions(+)
  8. diff --git a/src/egl/drivers/dri2/platform_null.c b/src/egl/drivers/dri2/platform_null.c
  9. index c9409c0..03fb5e0 100644
  10. --- a/src/egl/drivers/dri2/platform_null.c
  11. +++ b/src/egl/drivers/dri2/platform_null.c
  12. @@ -107,6 +107,20 @@ static const struct dri2_null_yuv_attrib {
  13. .num_planes = 2,
  14. .plane_bpp = __DRI_ATTRIB_YUV_PLANE_BPP_8_BIT,
  15. },
  16. + {
  17. + /* __DRI_IMAGE_FORMAT_YU12 */
  18. + .order = __DRI_ATTRIB_YUV_ORDER_YUV_BIT,
  19. + .subsample = __DRI_ATTRIB_YUV_SUBSAMPLE_4_2_0_BIT,
  20. + .num_planes = 3,
  21. + .plane_bpp = __DRI_ATTRIB_YUV_PLANE_BPP_8_BIT,
  22. + },
  23. + {
  24. + /* __DRI_IMAGE_FORMAT_YV12 */
  25. + .order = __DRI_ATTRIB_YUV_ORDER_YVU_BIT,
  26. + .subsample = __DRI_ATTRIB_YUV_SUBSAMPLE_4_2_0_BIT,
  27. + .num_planes = 3,
  28. + .plane_bpp = __DRI_ATTRIB_YUV_PLANE_BPP_8_BIT,
  29. + },
  30. };
  31. /*
  32. @@ -162,6 +176,20 @@ static const struct dri2_null_format {
  33. .rgba_sizes = { 0, 0, 0, 0 },
  34. .yuv = &dri2_null_yuv_attribs[2],
  35. },
  36. + {
  37. + .drm_format = DRM_FORMAT_YUV420,
  38. + .dri_image_format = __DRI_IMAGE_FORMAT_YU12,
  39. + .rgba_shifts = { -1, -1, -1, -1 },
  40. + .rgba_sizes = { 0, 0, 0, 0 },
  41. + .yuv = &dri2_null_yuv_attribs[3],
  42. + },
  43. + {
  44. + .drm_format = DRM_FORMAT_YVU420,
  45. + .dri_image_format = __DRI_IMAGE_FORMAT_YV12,
  46. + .rgba_shifts = { -1, -1, -1, -1 },
  47. + .rgba_sizes = { 0, 0, 0, 0 },
  48. + .yuv = &dri2_null_yuv_attribs[4],
  49. + },
  50. };