summaryrefslogtreecommitdiffstats
path: root/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio
diff options
context:
space:
mode:
Diffstat (limited to 'meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio')
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Enable-using-python3.patch29
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Use-wayland-scanner-in-the-path.patch37
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-10.patch44
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-15.patch47
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-glBufferData-Update-resource-backing-memory.patch91
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch134
-rw-r--r--meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_18.2.0.bb66
7 files changed, 448 insertions, 0 deletions
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Enable-using-python3.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Enable-using-python3.patch
new file mode 100644
index 00000000..30be886a
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Enable-using-python3.patch
@@ -0,0 +1,29 @@
+From b5aedd7844195a3ddae70f02de503636097a8ddb Mon Sep 17 00:00:00 2001
+From: Seimizu Joukan <joukan.seimizu@jp.panasonic.com>
+Date: Fri, 20 Aug 2021 15:56:37 +0900
+Subject: [PATCH] Enable using python3
+
+Python2 is not supported anymore since Yocto dunfell,
+but mesa-18.2.0 depends on python2.
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 42e1582..8c591ce 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,7 +124,7 @@ AC_PROG_GREP
+ AC_PROG_NM
+ AM_PROG_AS
+ AX_CHECK_GNU_MAKE
+-AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
++AC_CHECK_PROGS([PYTHON2], [python3 python2 python])
+ AC_PROG_SED
+ AC_PROG_MKDIR_P
+
+--
+2.17.1
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Use-wayland-scanner-in-the-path.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Use-wayland-scanner-in-the-path.patch
new file mode 100644
index 00000000..b598cd47
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Use-wayland-scanner-in-the-path.patch
@@ -0,0 +1,37 @@
+From 30da85819c26bb159fd2a6aaa2963f9332bda8d5 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 20 May 2019 14:50:19 +0300
+Subject: [PATCH] Simplify wayland-scanner lookup
+
+Don't use pkg-config to lookup the path of a binary that's in the path.
+
+Alternatively we'd have to prefix the path returned by pkg-config with
+PKG_CONFIG_SYSROOT_DIR.
+
+Upstream-Status: Pending
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index aa64c99..97070b8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1823,12 +1823,7 @@ for plat in $platforms; do
+ fi
+ WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+
+- PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
+- WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
+- WAYLAND_SCANNER='')
+- if test "x$WAYLAND_SCANNER" = x; then
+- AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
+- fi
++ AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
+
+ if test "x$WAYLAND_SCANNER" = "x:"; then
+ AC_MSG_ERROR([wayland-scanner is needed to compile the wayland platform])
+--
+2.7.4
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-10.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-10.patch
new file mode 100644
index 00000000..ccf08333
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-10.patch
@@ -0,0 +1,44 @@
+From 1301cdf196f7d27dc23cbd3de1b188369a66dc26 Mon Sep 17 00:00:00 2001
+From: "matsui.tetsuo" <matsui.tetsuo@jp.panasonic.com>
+Date: Tue, 10 Dec 2019 10:45:33 +0900
+Subject: [PATCH] Add stride status to virtgpu_3d_transfer_to_host
+
+The gallium driver in mesa-18.2.0 does not support kernel-5.10 stride
+variable definitions. We are currently working on an update to mesa,
+but currently need to use mesa-18.2.0, so the stride variable needs
+to be defined.
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 2 +-
+ src/gallium/winsys/virgl/drm/virtgpu_drm.h | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+index 7f542e7..06a28c1 100644
+--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
++++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+@@ -266,7 +266,7 @@ virgl_bo_transfer_put(struct virgl_winsys *vws,
+ tohostcmd.box.d = box->depth;
+ tohostcmd.offset = buf_offset;
+ tohostcmd.level = level;
+- // tohostcmd.stride = stride;
++ tohostcmd.stride = stride;
+ // tohostcmd.layer_stride = stride;
+ return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &tohostcmd);
+ }
+diff --git a/src/gallium/winsys/virgl/drm/virtgpu_drm.h b/src/gallium/winsys/virgl/drm/virtgpu_drm.h
+index 30bc3af..1b99a6b 100644
+--- a/src/gallium/winsys/virgl/drm/virtgpu_drm.h
++++ b/src/gallium/winsys/virgl/drm/virtgpu_drm.h
+@@ -102,6 +102,7 @@ struct drm_virtgpu_3d_transfer_to_host {
+ struct drm_virtgpu_3d_box box;
+ uint32_t level;
+ uint32_t offset;
++ uint32_t stride;
+ };
+
+ struct drm_virtgpu_3d_transfer_from_host {
+--
+2.7.4
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-15.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-15.patch
new file mode 100644
index 00000000..0456841f
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-15.patch
@@ -0,0 +1,47 @@
+From 6e2991baaccfae69721c47e8c533522cfa99c490 Mon Sep 17 00:00:00 2001
+From: murakami <murakami.kenta002@jp.panasonic.jp>
+Date: Tue, 28 Mar 2023 14:20:34 +0900
+Subject: [PATCH] Add stride status to virtgpu 3d transfer to host
+
+The gallium driver in mesa-18.2.0 does not support kernel-5.15 stride
+variable definitions. We are currently working on an update to mesa,
+but currently need to use mesa-18.2.0, so the stride variable needs
+to be defined.
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 4 ++--
+ src/gallium/winsys/virgl/drm/virtgpu_drm.h | 2 ++
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+index 3bb637e..0f859c3 100644
+--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
++++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+@@ -266,8 +266,8 @@ virgl_bo_transfer_put(struct virgl_winsys *vws,
+ tohostcmd.box.d = box->depth;
+ tohostcmd.offset = buf_offset;
+ tohostcmd.level = level;
+- // tohostcmd.stride = stride;
+- // tohostcmd.layer_stride = stride;
++ tohostcmd.stride = 0;
++ tohostcmd.layer_stride = 0;
+ return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &tohostcmd);
+ }
+
+diff --git a/src/gallium/winsys/virgl/drm/virtgpu_drm.h b/src/gallium/winsys/virgl/drm/virtgpu_drm.h
+index 028e78c..307bbbd 100644
+--- a/src/gallium/winsys/virgl/drm/virtgpu_drm.h
++++ b/src/gallium/winsys/virgl/drm/virtgpu_drm.h
+@@ -108,6 +108,8 @@ struct drm_virtgpu_3d_transfer_to_host {
+ struct drm_virtgpu_3d_box box;
+ uint32_t level;
+ uint32_t offset;
++ uint32_t stride;
++ uint32_t layer_stride;
+ };
+
+ struct drm_virtgpu_3d_transfer_from_host {
+--
+2.17.1
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-glBufferData-Update-resource-backing-memory.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-glBufferData-Update-resource-backing-memory.patch
new file mode 100644
index 00000000..f146c54f
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-glBufferData-Update-resource-backing-memory.patch
@@ -0,0 +1,91 @@
+From 6e23c8970762309d3f2b88f252333b2492aacd28 Mon Sep 17 00:00:00 2001
+From: Andrii Pauk <Andrii.Pauk@opensynergy.com>
+Date: Sat, 27 Feb 2021 17:42:00 +0200
+Subject: [PATCH] glBufferData: Update resource backing memory.
+
+Update buffer backing memory on buffer initialization with data.
+This is workaround for UHMI project, where
+VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D command is not implemented.
+
+The problem is in the following use-case:
+1) glBufferData --- reserves guest memory "backing" for resource,
+but doesn't fill it with data. Instead, data is serialized into
+virgl internal command and sent using VIRTIO_GPU_CMD_SUBMIT_3D
+comand. This command is opaque for rproxy/rvdds and serialized cmd buffer
+is just forwarded to virglrenderer, where it is deserialized and
+used for initialization of internal "gpu" memory with this data.
+2) glMapBuffer --- this calls TRANSFER_FROM_HOST_3D, which asks host/rproxy-->
+rvdds/virglrenderer to update backing memory (on source) with buffer data.
+And further this backing memory is mapped to guest application.
+In case of UHMI, TRANSFER_FROM_HOST_3D is not implemented, thus the memory is
+not "initialized".
+3) Modify buffer memory, but not whole memory, just some chunks.
+4) glUnmapBuffer --- this will trigger VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D
+command, which will send to target whole buffer memory and will overwrite
+previous memory. It's ok for modified in step 3 memory, but other is
+just garbage (I always saw zero filled memory).
+
+The above scenario produces artifacts on buffer-scene of glmark, in case of
+"update-method=map", which forces glmark to use 1-4 flow.
+
+As a workaround, fill buffer backing memory with data on step 1.
+
+Issue: EXDCLXXII-420
+
+Upstream-Status: Pending
+---
+ src/gallium/auxiliary/util/u_inlines.h | 21 +++++++++++++++++++++
+ src/mesa/state_tracker/st_cb_bufferobjects.c | 4 +++-
+ 2 files changed, 24 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
+index dee6f8f..4745f7b 100644
+--- a/src/gallium/auxiliary/util/u_inlines.h
++++ b/src/gallium/auxiliary/util/u_inlines.h
+@@ -462,6 +462,27 @@ pipe_buffer_read(struct pipe_context *pipe,
+ pipe_buffer_unmap(pipe, src_transfer);
+ }
+
++static inline void
++pipe_buffer_update_backing(struct pipe_context *pipe,
++ struct pipe_resource *buf,
++ unsigned offset,
++ unsigned size,
++ void *data)
++{
++ struct pipe_transfer *src_transfer;
++ ubyte *map;
++
++ map = (ubyte *) pipe_buffer_map_range(pipe,
++ buf,
++ offset, size,
++ PIPE_TRANSFER_WRITE,
++ &src_transfer);
++ if (!map)
++ return;
++
++ memcpy(map, data, size);
++ pipe_buffer_unmap(pipe, src_transfer);
++}
+
+ /**
+ * Map a resource for reading/writing.
+diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
+index 5ebe94f..cb33c8c 100644
+--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
++++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
+@@ -343,8 +343,10 @@ bufferobj_data(struct gl_context *ctx,
+ else {
+ st_obj->buffer = screen->resource_create(screen, &buffer);
+
+- if (st_obj->buffer && data)
++ if (st_obj->buffer && data) {
+ pipe_buffer_write(pipe, st_obj->buffer, 0, size, data);
++ pipe_buffer_update_backing(pipe, st_obj->buffer, 0, size, data);
++ }
+ }
+
+ if (!st_obj->buffer) {
+--
+2.7.4
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch
new file mode 100644
index 00000000..af2e8c36
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch
@@ -0,0 +1,134 @@
+From d676753e3089c5bccb73750fba0f14d287f8add9 Mon Sep 17 00:00:00 2001
+From: Ihor Korynkevych <Ihor.Korynkevych@opensynergy.com>
+Date: Mon, 20 May 2019 15:44:30 +0300
+Subject: [PATCH] mesa-virtio: Fix missing wayland-egl-backend build error.
+
+From the mesa 18.2.8 release notes: libwayland-egl is now distributed by Wayland
+(since 1.15, see announcement), and has been removed from Mesa in this release.
+
+Add back the wayland-egl-backend header file not to break the build.
+
+Issue: EXDCLXXII-59
+
+Upstream-Status: Pending
+
+Signed-off-by: Ihor Korynkevych <ihor.korynkevych@opensynergy.com>
+---
+ configure.ac | 4 --
+ src/egl/Makefile.am | 3 +
+ src/egl/wayland/wayland-egl/wayland-egl-backend.h | 67 +++++++++++++++++++++++
+ 3 files changed, 70 insertions(+), 4 deletions(-)
+ create mode 100644 src/egl/wayland/wayland-egl/wayland-egl-backend.h
+
+diff --git a/configure.ac b/configure.ac
+index 97070b8..afc81e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -90,7 +90,6 @@ LIBOMXIL_TIZONIA_REQUIRED=0.10.0
+ LIBVA_REQUIRED=0.39.0
+ VDPAU_REQUIRED=1.1
+ WAYLAND_REQUIRED=1.11
+-WAYLAND_EGL_BACKEND_REQUIRED=3
+ WAYLAND_PROTOCOLS_REQUIRED=1.8
+ XCB_REQUIRED=1.9.3
+ XCBDRI2_REQUIRED=1.8
+@@ -1818,9 +1817,6 @@ for plat in $platforms; do
+ PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= $WAYLAND_REQUIRED])
+ PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server >= $WAYLAND_REQUIRED])
+ PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED])
+- if test "x$enable_egl" = xyes; then
+- PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl-backend >= $WAYLAND_EGL_BACKEND_REQUIRED])
+- fi
+ WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+
+ AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
+diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
+index b43805d..0fcc24a 100644
+--- a/src/egl/Makefile.am
++++ b/src/egl/Makefile.am
+@@ -123,6 +123,9 @@ AM_CFLAGS += \
+ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
+ -D_EGL_BUILT_IN_DRIVER_DRI2
+
++AM_CFLAGS += \
++ -I$(top_srcdir)/src/egl/wayland/wayland-egl
++
+ nodist_libEGL_common_la_SOURCES = \
+ $(dri2_backend_GENERATED_FILES)
+
+diff --git a/src/egl/wayland/wayland-egl/wayland-egl-backend.h b/src/egl/wayland/wayland-egl/wayland-egl-backend.h
+new file mode 100644
+index 0000000..869c86f
+--- /dev/null
++++ b/src/egl/wayland/wayland-egl/wayland-egl-backend.h
+@@ -0,0 +1,67 @@
++/*
++ * Copyright © 2011 Benjamin Franzke
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Authors:
++ * Benjamin Franzke <benjaminfranzke@googlemail.com>
++ */
++
++#ifndef _WAYLAND_EGL_PRIV_H
++#define _WAYLAND_EGL_PRIV_H
++
++#include <stdint.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ * NOTE: This version must be kept in sync with the Version field in the
++ * wayland-egl-backend.pc.in file.
++ */
++#define WL_EGL_WINDOW_VERSION 3
++
++struct wl_surface;
++
++struct wl_egl_window {
++ const intptr_t version;
++
++ int width;
++ int height;
++ int dx;
++ int dy;
++
++ int attached_width;
++ int attached_height;
++
++ void *driver_private;
++ void (*resize_callback)(struct wl_egl_window *, void *);
++ void (*destroy_window_callback)(void *);
++
++ struct wl_surface *surface;
++};
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--
+2.7.4
+
diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_18.2.0.bb b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_18.2.0.bb
new file mode 100644
index 00000000..8e4c96b5
--- /dev/null
+++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_18.2.0.bb
@@ -0,0 +1,66 @@
+# This recipe temporarily install mesa-18.2.0 as mesa-virtio to run remote-virtio-gpu.
+# The mesa-virtio will be removed after remote-virtio-gpu supports upstream mesa.
+
+SUMMARY = "Mesa library"
+SECTION = "graphics"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native"
+DEPENDS:append = " libdrm wayland wayland-native wayland-protocols python3-native"
+
+RDEPENDS:${PN}:append = " libgcc wayland libdrm glibc libstdc++ zlib expat"
+
+LINUX_MAJOR = "${@(d.getVar('PREFERRED_VERSION_linux-yocto') or "x.y").split('.')[0]}"
+LINUX_MINOR = "${@(d.getVar('PREFERRED_VERSION_linux-yocto') or "x.y").split('.')[1].split('%')[0]}"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
+ file://0001-glBufferData-Update-resource-backing-memory.patch \
+ file://0001-Use-wayland-scanner-in-the-path.patch \
+ file://0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch \
+ file://0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-${LINUX_MAJOR}-${LINUX_MINOR}.patch \
+ file://0001-Enable-using-python3.patch \
+"
+
+SRC_URI[md5sum] = "88e1a7f31f259cec69bb76b3cb10c956"
+SRC_URI[sha256sum] = "22452bdffff8e11bf4284278155a9f77cb28d6d73a12c507f1490732d0d9ddce"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OEMAKE += "WAYLAND_PROTOCOLS_DATADIR=${STAGING_DATADIR}/wayland-protocols"
+
+EXTRA_OECONF = " \
+ --prefix=/usr/lib/mesa-virtio \
+ --exec_prefix=/usr/lib/mesa-virtio \
+ --libdir=/usr/lib/mesa-virtio \
+ --includedir=/usr/include/mesa-virtio \
+ --sysconfdir=/etc/mesa-virtio \
+ --datadir=/usr/share/mesa-virtio \
+"
+
+EXTRA_OECONF:append = " \
+ --with-dri-drivers=swrast \
+ --with-gallium-drivers=swrast,virgl \
+ --with-platforms=drm,wayland \
+ --disable-glx \
+ --disable-dri3 \
+"
+
+EXCLUDE_FROM_SHLIBS = "1"
+
+FILES:${PN} = " \
+ /usr/lib/mesa-virtio/* \
+ /etc/mesa-virtio/drirc \
+ /usr/share/mesa-virtio/* \
+"
+
+FILES:${PN}-dev += " \
+ /usr/lib/mesa-virtio/libglapi.so \
+ /usr/lib/mesa-virtio/libEGL.so \
+ /usr/lib/mesa-virtio/libgbm.so \
+ /usr/lib/mesa-virtio/libGLESv2.so \
+ /usr/lib/mesa-virtio/libGLESv1_CM.so \
+"