]> code.ossystems Code Review - meta-freescale.git/commitdiff
mesa: Add patch to enable MESA_ycbcr support and WIP-st-dri-Allow-YUYV-import 41/18141/1
authorCarlos Rafael Giani <dv7777@gmail.com>
Fri, 11 Aug 2017 21:56:43 +0000 (23:56 +0200)
committerFabio Berton <fabio.berton@ossystems.com.br>
Mon, 11 Dec 2017 12:16:08 +0000 (10:16 -0200)
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 <dv7777@gmail.com>
(cherry picked from commit a5d0f53fa7ef0b6bbc98e752c16a39776829f5d5)
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Change-Id: I15dad1389f0f20f350a10c45971fcf2031a07900

recipes-graphics/mesa/mesa/0015-Enable-MESA_ycbcr_texture-for-GLES1-and-GLES2.patch [new file with mode: 0644]
recipes-graphics/mesa/mesa/WIP-st-dri-Allow-YUYV-import.patch [new file with mode: 0644]
recipes-graphics/mesa/mesa_%.bbappend

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 (file)
index 0000000..05b65bb
--- /dev/null
@@ -0,0 +1,40 @@
+From 9b0000e2d6fcbcfefc6db7e7eac2a51ac1c6629c Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+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 <dv@pseudoterminal.org>
+---
+ 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;
+                 <command name="glWindowPos4svMESA"/>
+             </require>
+         </extension>
+-        <extension name="GL_MESA_ycbcr_texture" supported="gl">
++        <extension name="GL_MESA_ycbcr_texture" supported="gl|gles1|gles2">
+             <require>
+                 <enum name="GL_UNSIGNED_SHORT_8_8_MESA"/>
+                 <enum name="GL_UNSIGNED_SHORT_8_8_REV_MESA"/>
+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 (file)
index 0000000..43103fa
--- /dev/null
@@ -0,0 +1,41 @@
+From c276e110f520c8f9e1795b4a85dec3f28ef38d89 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+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 <p.zabel@pengutronix.de>
+---
+ 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
+
index a89184ec6d68f6249a23106acca05c7b92b512e2..687e87fcb22eb401be1105d405c1f723f32dbf8a 100644 (file)
@@ -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(":")