From: Carlos Rafael Giani Date: Fri, 11 Aug 2017 21:56:43 +0000 (+0200) Subject: mesa: Add patch to enable MESA_ycbcr support and WIP-st-dri-Allow-YUYV-import X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=d33b5b6ca0f39cef175288cd2b6a617d29e4159c;p=meta-freescale.git mesa: Add patch to enable MESA_ycbcr support and WIP-st-dri-Allow-YUYV-import Patch 15 is an experimental patch to enable MESA_ycbcr support. Might not be needed later on. WIP-st-dri-Allow-YUYV-import is an experimental patch to make use of the Vivante GPU's hardwired YUV->RGB converter. A clean implementation of this feature might require MESA_ycbcr or a derivative of that, but for now, this patch works. Signed-off-by: Carlos Rafael Giani (cherry picked from commit a5d0f53fa7ef0b6bbc98e752c16a39776829f5d5) Signed-off-by: Fabio Berton Change-Id: I15dad1389f0f20f350a10c45971fcf2031a07900 --- diff --git a/recipes-graphics/mesa/mesa/0015-Enable-MESA_ycbcr_texture-for-GLES1-and-GLES2.patch b/recipes-graphics/mesa/mesa/0015-Enable-MESA_ycbcr_texture-for-GLES1-and-GLES2.patch new file mode 100644 index 00000000..05b65bb6 --- /dev/null +++ b/recipes-graphics/mesa/mesa/0015-Enable-MESA_ycbcr_texture-for-GLES1-and-GLES2.patch @@ -0,0 +1,40 @@ +From 9b0000e2d6fcbcfefc6db7e7eac2a51ac1c6629c Mon Sep 17 00:00:00 2001 +From: Carlos Rafael Giani +Date: Sat, 1 Apr 2017 01:49:18 +0200 +Subject: [PATCH] Enable MESA_ycbcr_texture for GLES1 and GLES2 + +Signed-off-by: Carlos Rafael Giani +--- + src/mapi/glapi/registry/gl.xml | 2 +- + src/mesa/main/extensions_table.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/mapi/glapi/registry/gl.xml b/src/mapi/glapi/registry/gl.xml +index 3fc8863..6470d8c 100644 +--- a/src/mapi/glapi/registry/gl.xml ++++ b/src/mapi/glapi/registry/gl.xml +@@ -43321,7 +43321,7 @@ typedef unsigned int GLhandleARB; + + + +- ++ + + + +diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h +index ec71791..d223032 100644 +--- a/src/mesa/main/extensions_table.h ++++ b/src/mesa/main/extensions_table.h +@@ -311,7 +311,7 @@ EXT(MESA_pack_invert , MESA_pack_invert + EXT(MESA_shader_integer_functions , MESA_shader_integer_functions , GLL, GLC, x , 30, 2016) + EXT(MESA_texture_signed_rgba , EXT_texture_snorm , GLL, GLC, x , x , 2009) + EXT(MESA_window_pos , dummy_true , GLL, x , x , x , 2000) +-EXT(MESA_ycbcr_texture , MESA_ycbcr_texture , GLL, GLC, x , x , 2002) ++EXT(MESA_ycbcr_texture , MESA_ycbcr_texture , GLL, GLC, ES1, ES2, 2002) + + EXT(NVX_gpu_memory_info , NVX_gpu_memory_info , GLL, GLC, x , x , 2013) + +-- +2.7.4 + diff --git a/recipes-graphics/mesa/mesa/WIP-st-dri-Allow-YUYV-import.patch b/recipes-graphics/mesa/mesa/WIP-st-dri-Allow-YUYV-import.patch new file mode 100644 index 00000000..43103fa4 --- /dev/null +++ b/recipes-graphics/mesa/mesa/WIP-st-dri-Allow-YUYV-import.patch @@ -0,0 +1,41 @@ +From c276e110f520c8f9e1795b4a85dec3f28ef38d89 Mon Sep 17 00:00:00 2001 +From: Philipp Zabel +Date: Mon, 11 Apr 2016 18:50:58 +0200 +Subject: [PATCH] WIP: st/dri: Allow YUYV import + +Unclear whether this is the right way, but this allows to import +dma-buffers with YUYV pixel format. + +Signed-off-by: Philipp Zabel +--- + src/gallium/state_trackers/dri/dri2.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c +index b50e096443..9c61f01547 100644 +--- a/src/gallium/state_trackers/dri/dri2.c ++++ b/src/gallium/state_trackers/dri/dri2.c +@@ -84,6 +84,10 @@ static int convert_fourcc(int format, int *dri_components_p) + format = __DRI_IMAGE_FORMAT_GR88; + dri_components = __DRI_IMAGE_COMPONENTS_RG; + break; ++ case __DRI_IMAGE_FOURCC_YUYV: ++ format = __DRI_IMAGE_FOURCC_YUYV; ++ dri_components = __DRI_IMAGE_COMPONENTS_Y_XUXV; /* FIXME */ ++ break; + /* + * For multi-planar YUV formats, we return the format of the first + * plane only. Since there is only one caller which supports multi- +@@ -164,6 +168,9 @@ static enum pipe_format dri2_format_to_pipe_format (int format) + case __DRI_IMAGE_FORMAT_GR88: + pf = PIPE_FORMAT_RG88_UNORM; + break; ++ case __DRI_IMAGE_FOURCC_YUYV: ++ pf = PIPE_FORMAT_YUYV; ++ break; + default: + pf = PIPE_FORMAT_NONE; + break; +-- +2.11.0 + diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend index a89184ec..687e87fc 100644 --- a/recipes-graphics/mesa/mesa_%.bbappend +++ b/recipes-graphics/mesa/mesa_%.bbappend @@ -1,8 +1,16 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/mesa:" + PACKAGECONFIG_remove_imxgpu2d = "egl gles" PROVIDES_remove_imxgpu2d = "virtual/libgles1 virtual/libgles2 virtual/libopenvg virtual/egl" PROVIDES_remove_imxgpu3d = "virtual/libgl" +SRC_URI_append = " \ + file://0015-Enable-MESA_ycbcr_texture-for-GLES1-and-GLES2.patch \ + file://WIP-st-dri-Allow-YUYV-import.patch \ +" + + # FIXME: mesa should support 'x11-no-tls' option python () { overrides = d.getVar("OVERRIDES", True).split(":")