diff options
Diffstat (limited to 'meta-uhmi/meta-rvgpu')
19 files changed, 127 insertions, 1026 deletions
diff --git a/meta-uhmi/meta-rvgpu/README.md b/meta-uhmi/meta-rvgpu/README.md index 64ed4c00..b93e99d8 100644 --- a/meta-uhmi/meta-rvgpu/README.md +++ b/meta-uhmi/meta-rvgpu/README.md @@ -73,22 +73,30 @@ ifconfig <your environment> 192.168.0.10 netmask 255.255.255.0 Prepare two images, one as the Sender and the other as the Receiver. It is necessary for the Sender and Receiver to be within the same network. -**Receiver side** +**Receiver side** ``` $ export XDG_RUNTIME_DIR=/run/user/<your_UID> -$ rvgpu-renderer -b 1080x1500@0,0 -p <Port_Number> & +$ rvgpu-renderer -b <your_Area>@0,0 -p <Port_Number> & ``` + Replace the placeholders with the appropriate values: - `<your_UID>`: Specify according to your environment, for example:1001 +- `<your_Area>`: Enter an usable area for example: 1080x1488 + With the following command, you can know the usable area. + ``` + $ journalctl | grep -i "usable area" + # Example Output: + Nov 29 11:42:53 qemux86-64 agl-compositor[259]: [11:42:53.166] Usable area: 1080x1488+0,216 + ``` - `<Port_Number>`: Enter an available port number, for example: 55555 + **Sender side** Create the following shell script **run_remote_app.sh** in any `<WORKDIR>` for a smooth experience. ``` #!/bin/bash -mkdir -p /run/user/<New_UID> -export XDG_RUNTIME_DIR=/run/user/<New_UID> +export XDG_RUNTIME_DIR=/tmp export LD_LIBRARY_PATH=/usr/lib/mesa-virtio # ------------- @@ -96,36 +104,30 @@ export LD_LIBRARY_PATH=/usr/lib/mesa-virtio # ------------- $@ ``` -Replace the placeholders with the appropriate values: -- `<New_UID>`: You can assign any UID, for example: 0 Save the file and run the following to start weston. ``` -$ rvgpu-proxy -s 1080x1500@0,0 -n <IP_address_of_Receiver>:<Port_Number> & +$ rvgpu-proxy -s 1080x1488@0,0 -n <IP_address_of_Receiver>:<Port_Number> & $ <WORKDIR>/run_remote_app.sh weston --backend drm-backend.so -Swayland-0 --seat=seat_virtual -i 0 & ``` Replace the placeholders with the appropriate values: - `<Port_Number>`: Port set in the renderer. + After completing these steps, the Weston screen from the Sender will be transferred and displayed on the Receiver using rvgpu-proxy and rvgpu-renderer. You can verify that everything is functioning properly by launching wayland applications on the Sender side, such as: ``` -$ <WORKDIR>/run_remote_app.sh weston-simple-egl -f +$ weston-simple-egl -f ``` You can also verify the touch or keyboard operation support of the RVGPU by using app such as ``` -$ <WORKDIR>/run_remote_app.sh weston-smoke -$ <WORKDIR>/run_remote_app.sh weston-editor +$ weston-smoke +$ weston-editor ``` **Note**: There are known issues with mouse, such as the cursor becoming invisible and occasional flickering of a green screen. -**Appendix**: -- You can freely change the display position of the transferred surface in rvgpu-renderer by w option, such as - ``` - rvgpu-renderer -b 1080x1500@0,0 -p <Port_Number> -w <x>,<y> - ``` - The coordinates `<x>,<y> = 0,0` represent the top-left corner, and the default position is `0,250`. - +**Appendix** - By building the RVGPU on Ubuntu, it is possible to enable bidirectional remote rendering between the agl-demo-platform and Ubuntu. - For the build procedure on Ubuntu, see the following URL: https://github.com/unified-hmi/remote-virtio-gpu +For the build procedure on Ubuntu, see the following URL: https://github.com/unified-hmi/remote-virtio-gpu + 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 deleted file mode 100644 index 30be886a..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Enable-using-python3.patch +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index b598cd47..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-Use-wayland-scanner-in-the-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100644 index ccf08333..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-10.patch +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100644 index 0456841f..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-add-stride-status-to-virtgpu-3d-transfer-to-host-linux-5-15.patch +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100644 index f146c54f..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0001-glBufferData-Update-resource-backing-memory.patch +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100644 index af2e8c36..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/files/0002-mesa-virtio-Fix-missing-wayland-egl-backend-build-error.patch +++ /dev/null @@ -1,134 +0,0 @@ -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 deleted file mode 100644 index 8e4c96b5..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_18.2.0.bb +++ /dev/null @@ -1,66 +0,0 @@ -# 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 \ -" diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_20.3.5.bb b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_20.3.5.bb new file mode 100644 index 00000000..9a0dab2f --- /dev/null +++ b/meta-uhmi/meta-rvgpu/recipes-graphics/mesa-virtio/mesa-virtio_20.3.5.bb @@ -0,0 +1,59 @@ +SUMMARY = "Mesa library" +SECTION = "graphics" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=9aa1bc48c9826ad9fdb16661f6930496" + + +DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" +DEPENDS:append = " libdrm wayland wayland-native wayland-protocols python3-native" + +SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz" + +SRC_URI[md5] = "224d7576618ef4dd8ac69f30b5b90b38" +SRC_URI[sha256sum] = "909a72df63dfa3c0844ccf44a26ac028d148297ed333ab51560893923d7691ce" + +S = "${WORKDIR}/mesa-${PV}" + +RDEPENDS:${PN}:append = " libgcc wayland libdrm glibc libstdc++ zlib expat" + +inherit meson pkgconfig python3native gettext + +EXTRA_OEMESON = " \ + -Dshared-glapi=true \ + -Dgallium-opencl=disabled \ + -Dglx-read-only-text=true \ + -Dplatforms='wayland' \ +" + +EXTRA_OEMESON += " \ + --prefix=/usr/lib/mesa-virtio \ + --libdir=/usr/lib/mesa-virtio \ + --sysconfdir=/etc/mesa-virtio \ +" + +EXTRA_OEMESON += " \ + -Ddri-drivers='' \ + -Dgallium-drivers='virgl,swrast' \ + -Dglx=disabled \ + -Dgles1=disabled \ + -Dgles2=enabled \ + -Degl=true \ + -Dgbm=true \ + -Dllvm=disabled \ + -Dvulkan-drivers='[]' \ +" + +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 \ +" diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu.inc b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu.inc index 4a8e5357..ef5762f4 100644 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu.inc +++ b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu.inc @@ -1,5 +1,5 @@ PV = "0.0+git${SRCPV}" -SRCREV = "4b1f508003a7bf36256d5cc81986ef733e4cc79b" +SRCREV = "cd79224421fb2e3a0109c8e765264f5f39af9ef3" BRANCH ?= "main" SRC_URI = " \ git://github.com/unified-hmi/remote-virtio-gpu.git;protocol=https;branch=${BRANCH} \ diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0001-Remove-some-rvgpu-command-options.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0001-Remove-some-rvgpu-command-options.patch index 4548c53f..044c8420 100644 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0001-Remove-some-rvgpu-command-options.patch +++ b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0001-Remove-some-rvgpu-command-options.patch @@ -1,7 +1,7 @@ -From 0fc1cf03f76d21cec5b859ff46bee146cd4e52f7 Mon Sep 17 00:00:00 2001 -From: murakami <murakami.kenta002@jp.panasonic.jp> -Date: Fri, 28 Jul 2023 12:09:35 +0900 -Subject: [PATCH 1/2] Remove some rvgpu command options +From fb9d1134906356b20ac698fca64a3c7de0dd111c Mon Sep 17 00:00:00 2001 +From: Fumiya Kohzu <kohzu.fumiya@jp.panasonic.com> +Date: Mon, 20 Nov 2023 19:28:19 +0900 +Subject: [PATCH] Remove some rvgpu command options Remove vsync and card_index option supports from remote-virtio-gpu, because the kernel needs to be patched to run those options in @@ -16,7 +16,7 @@ Upstream-Status: Inappropriate [embedded specific] 4 files changed, 5 insertions(+), 36 deletions(-) diff --git a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h -index eb34b6a..76d747a 100644 +index 72adb07..29dc157 100644 --- a/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h +++ b/include/rvgpu-proxy/gpu/rvgpu-gpu-device.h @@ -35,7 +35,6 @@ struct gpu_device; @@ -28,10 +28,10 @@ index eb34b6a..76d747a 100644 unsigned int mem_limit; unsigned long framerate; diff --git a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c -index 947e81a..71f62ca 100644 +index 0db2d7f..6b84a0a 100644 --- a/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c +++ b/src/rvgpu-proxy/gpu/rvgpu-gpu-device.c -@@ -528,7 +528,6 @@ struct gpu_device *gpu_device_init(int lo_fd, int efd, uint32_t cidx, +@@ -655,7 +655,6 @@ struct gpu_device *gpu_device_init(int lo_fd, int efd, int capset, if (capset != -1) gpu_capset_init(g, capset); @@ -39,7 +39,7 @@ index 947e81a..71f62ca 100644 info.config = (__u8 *)&g->config; info.config_kick = g->config_fd; -@@ -939,8 +938,6 @@ static void gpu_device_trigger_vsync(struct gpu_device *g, +@@ -1013,8 +1012,6 @@ static void gpu_device_trigger_vsync(struct gpu_device *g, return; hdr->flags |= VIRTIO_GPU_FLAG_VSYNC; @@ -49,7 +49,7 @@ index 947e81a..71f62ca 100644 if ((!vsync_ts.tv_sec) && (!vsync_ts.tv_nsec)) { diff --git a/src/rvgpu-proxy/rvgpu-proxy.c b/src/rvgpu-proxy/rvgpu-proxy.c -index 6ff4e19..d082b72 100644 +index b9958b8..b78ed1c 100644 --- a/src/rvgpu-proxy/rvgpu-proxy.c +++ b/src/rvgpu-proxy/rvgpu-proxy.c @@ -47,7 +47,6 @@ static void usage(void) @@ -110,10 +110,10 @@ index 6ff4e19..d082b72 100644 params.mem_limit = (unsigned int)sanity_strtonum( optarg, VMEM_MIN_MB, VMEM_MAX_MB, &errstr); diff --git a/src/rvgpu-renderer/rvgpu-renderer.c b/src/rvgpu-renderer/rvgpu-renderer.c -index 7166fb9..3e74289 100644 +index 2757827..b21a168 100644 --- a/src/rvgpu-renderer/rvgpu-renderer.c +++ b/src/rvgpu-renderer/rvgpu-renderer.c -@@ -52,7 +52,6 @@ static void usage(void) +@@ -53,7 +53,6 @@ static void usage(void) info("\t-f\t\tRun in fullscreen mode\n"); info("\t-p port\t\tport for listening (default: %u)\n", RVGPU_DEFAULT_PORT); @@ -121,7 +121,7 @@ index 7166fb9..3e74289 100644 info("\t-h\t\tShow this message\n"); info("\nNote:\n"); -@@ -185,12 +184,12 @@ int main(int argc, char **argv) +@@ -186,13 +185,13 @@ int main(int argc, char **argv) unsigned int res_id, scanout; uint16_t port_nr = RVGPU_DEFAULT_PORT; FILE *input_stream = stdout; @@ -130,13 +130,14 @@ index 7166fb9..3e74289 100644 user_specified_scanouts = false; memset(sp, 0, sizeof(sp)); + memset(&pp, 0, sizeof(pp)); - while ((opt = getopt(argc, argv, "afhvi:c:s:S:b:B:p:g:")) != -1) { + while ((opt = getopt(argc, argv, "afhi:c:s:S:b:B:p:g:")) != -1) { switch (opt) { case 'a': translucent = true; -@@ -269,9 +268,6 @@ int main(int argc, char **argv) +@@ -271,9 +270,6 @@ int main(int argc, char **argv) errstr); } break; @@ -146,7 +147,7 @@ index 7166fb9..3e74289 100644 case 'h': usage(); exit(EXIT_SUCCESS); -@@ -309,7 +305,7 @@ int main(int argc, char **argv) +@@ -311,7 +307,7 @@ int main(int argc, char **argv) } while ((res_id = rvgpu_pr_dispatch(pr))) { @@ -156,5 +157,5 @@ index 7166fb9..3e74289 100644 if (pp.capset) -- -2.17.1 +2.25.1 diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0002-Add-agl-shell-desktop-and-xdg-shell-support.patch b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0002-Add-agl-shell-desktop-and-xdg-shell-support.patch deleted file mode 100644 index db5a6922..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu/0002-Add-agl-shell-desktop-and-xdg-shell-support.patch +++ /dev/null @@ -1,482 +0,0 @@ -From b60e0a361d29723643fe81b47bff8f86d5200258 Mon Sep 17 00:00:00 2001 -From: Kenta <murakami.kenta002@jp.panasonic.com> -Date: Wed, 6 Sep 2023 18:44:22 +0900 -Subject: [PATCH] Add agl-shell-desktop and xdg-shell supports - ---- - CMakeLists.txt | 25 +++ - include/rvgpu-renderer/renderer/rvgpu-egl.h | 9 +- - src/rvgpu-renderer/CMakeLists.txt | 3 + - src/rvgpu-renderer/backend/rvgpu-gbm.c | 2 + - src/rvgpu-renderer/backend/rvgpu-wayland.c | 192 +++++++++++++++++--- - src/rvgpu-renderer/renderer/rvgpu-egl.c | 3 + - src/rvgpu-renderer/rvgpu-renderer.c | 11 +- - 7 files changed, 220 insertions(+), 25 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f569ca2..85c875a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,6 +20,31 @@ cmake_minimum_required(VERSION 3.2) - project(rvgpu C) - set(CMAKE_C_STANDARD 11) - -+find_program(WAYLAND_SCANNER_EXECUTABLE wayland-scanner) -+ -+message("generating agl-shell-desktop client files from: agl-shell-desktop.xml") -+ -+execute_process ( COMMAND mkdir ${CMAKE_BINARY_DIR}/protocol) -+ -+execute_process ( COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code -+ ${CMAKE_SYSROOT}/usr/share/agl-compositor/protocols/agl-shell-desktop.xml -+ ${CMAKE_BINARY_DIR}/protocol/agl-shell-desktop-protocol.c) -+ -+execute_process ( COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header -+ ${CMAKE_SYSROOT}/usr/share/agl-compositor/protocols/agl-shell-desktop.xml -+ ${CMAKE_BINARY_DIR}/protocol/agl-shell-desktop-protocol.h) -+ -+message("generating agl-shell-desktop client files from: xdg-shell.xml") -+ -+execute_process ( COMMAND ${WAYLAND_SCANNER_EXECUTABLE} private-code -+ ${CMAKE_SYSROOT}/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml -+ ${CMAKE_BINARY_DIR}/protocol/xdg-shell-protocol.c) -+ -+execute_process ( COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header -+ ${CMAKE_SYSROOT}/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml -+ ${CMAKE_BINARY_DIR}/protocol/xdg-shell-protocol.h) -+ -+ - if (CMAKE_SYSROOT AND NOT ENV{PKG_CONFIG_LIBDIR}) - set(ENV{PKG_CONFIG_DIR} "") - set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig") -diff --git a/include/rvgpu-renderer/renderer/rvgpu-egl.h b/include/rvgpu-renderer/renderer/rvgpu-egl.h -index ebd2bd2..dcff36a 100644 ---- a/include/rvgpu-renderer/renderer/rvgpu-egl.h -+++ b/include/rvgpu-renderer/renderer/rvgpu-egl.h -@@ -59,6 +59,9 @@ struct rvgpu_scanout_params { - uint32_t id; /**< ID for scanout window (i.e. IVI id)*/ - bool enabled; /**< enable/disable scanout */ - bool boxed; /**< box is set by user */ -+ struct rvgpu_box agl_win; /** Window position & limit on AGL */ -+ bool agl_win_set; -+ - }; - - struct rvgpu_scanout { -@@ -118,6 +121,8 @@ struct rvgpu_egl_state { - bool spawn_support; - - bool use_scissors; -+ -+ bool user_specified_scanouts; - }; - - /** Initialize main context */ -@@ -150,11 +155,11 @@ void rvgpu_egl_destroy_scanout(struct rvgpu_egl_state *e, - - /** Draw Virgl output on the surface */ - void rvgpu_egl_draw(struct rvgpu_egl_state *e, struct rvgpu_scanout *s, -- bool vsync); -+ bool vsync); - - /** Redraw all scanouts with given resource id */ - void rvgpu_egl_drawall(struct rvgpu_egl_state *e, unsigned int res_id, -- bool vsync); -+ bool vsync); - - /* Async event handling */ - /** Call before polling */ -diff --git a/src/rvgpu-renderer/CMakeLists.txt b/src/rvgpu-renderer/CMakeLists.txt -index dc5f5b0..c8a8c34 100644 ---- a/src/rvgpu-renderer/CMakeLists.txt -+++ b/src/rvgpu-renderer/CMakeLists.txt -@@ -17,6 +17,8 @@ - - - add_executable(rvgpu-renderer -+ ${CMAKE_BINARY_DIR}/protocol/agl-shell-desktop-protocol.c -+ ${CMAKE_BINARY_DIR}/protocol/xdg-shell-protocol.c - backend/rvgpu-wayland.c - backend/rvgpu-gbm.c - renderer/rvgpu-egl.c -@@ -28,6 +30,7 @@ add_executable(rvgpu-renderer - target_include_directories(rvgpu-renderer - PRIVATE - ${PROJECT_SOURCE_DIR}/include -+ ${CMAKE_BINARY_DIR}/protocol - ${extlibs_INCLUDE_DIRS} - ) - target_compile_definitions(rvgpu-renderer PRIVATE _GNU_SOURCE) -diff --git a/src/rvgpu-renderer/backend/rvgpu-gbm.c b/src/rvgpu-renderer/backend/rvgpu-gbm.c -index 4194b0d..b2b3ed3 100644 ---- a/src/rvgpu-renderer/backend/rvgpu-gbm.c -+++ b/src/rvgpu-renderer/backend/rvgpu-gbm.c -@@ -259,6 +259,8 @@ static void rvgpu_gbm_create_scanout(struct rvgpu_egl_state *e, - - eglMakeCurrent(e->dpy, s->surface, s->surface, e->context); - glGenFramebuffers(1, &s->fb); -+ -+ rvgpu_egl_draw(e, s, false); - } - - static void rvgpu_gbm_page_flip_handler(int fd, unsigned int sequence, -diff --git a/src/rvgpu-renderer/backend/rvgpu-wayland.c b/src/rvgpu-renderer/backend/rvgpu-wayland.c -index 0aaeaa7..c00ff00 100644 ---- a/src/rvgpu-renderer/backend/rvgpu-wayland.c -+++ b/src/rvgpu-renderer/backend/rvgpu-wayland.c -@@ -39,12 +39,18 @@ - #include <rvgpu-renderer/renderer/rvgpu-egl.h> - #include <rvgpu-renderer/renderer/rvgpu-input.h> - -+#include "agl-shell-desktop-protocol.h" -+#include "xdg-shell-protocol.h" -+ - struct rvgpu_native { - /* Window structures */ - struct wl_surface *surface; - struct wl_shell_surface *shell_surface; - struct wl_egl_window *egl_window; - struct ivi_surface *ivi_surface; -+ struct xdg_surface *xdg_surface; -+ struct xdg_toplevel *xdg_toplevel; -+ bool wait_for_configure; - }; - - struct rvgpu_wl_state { -@@ -58,6 +64,9 @@ struct rvgpu_wl_state { - struct wl_keyboard *keyboard; - struct wl_shell *shell; - struct ivi_application *ivi_app; -+ struct xdg_wm_base *wm_base; -+ struct agl_shell_desktop *agl_shell_desktop; -+ struct wl_output *output; - - /* EGL structures */ - struct rvgpu_egl_state egl; -@@ -78,6 +87,16 @@ static inline struct rvgpu_wl_state *to_wl(struct rvgpu_egl_state *e) - return rvgpu_container_of(e, struct rvgpu_wl_state, egl); - } - -+static void xdg_wm_base_ping(void *data, struct xdg_wm_base *shell, -+ uint32_t serial) -+{ -+ xdg_wm_base_pong(shell, serial); -+} -+ -+static const struct xdg_wm_base_listener xdg_wm_base_listener = { -+ xdg_wm_base_ping, -+}; -+ - static struct wl_seat_listener seat_listener; - - static void registry_add_object(void *data, struct wl_registry *registry, -@@ -98,8 +117,17 @@ static void registry_add_object(void *data, struct wl_registry *registry, - wl_registry_bind(registry, name, &wl_seat_interface, 1); - wl_seat_add_listener(r->seat, &seat_listener, r); - } else if (!strcmp(interface, "ivi_application")) { -- r->ivi_app = wl_registry_bind(registry, name, -- &ivi_application_interface, 1); -+ r->ivi_app = wl_registry_bind(registry, name, &ivi_application_interface, 1); -+ } else if (strcmp(interface, "xdg_wm_base") == 0) { -+ r->wm_base = wl_registry_bind(registry, name, -+ &xdg_wm_base_interface, 1); -+ xdg_wm_base_add_listener(r->wm_base, &xdg_wm_base_listener, r); -+ } else if (strcmp(interface, "agl_shell_desktop") == 0) { -+ r->agl_shell_desktop = wl_registry_bind(registry, name, -+ &agl_shell_desktop_interface, 1); -+ } else if (strcmp(interface, "wl_output") == 0) { -+ r->output = wl_registry_bind(registry, name, -+ &wl_output_interface, 1); - } - } - -@@ -157,6 +185,57 @@ static const struct ivi_surface_listener ivi_surface_listener = { - handle_ivi_surface_configure, - }; - -+static void handle_xdg_toplevel_configure(void *data, -+ struct xdg_toplevel *xdg_toplevel, -+ int32_t width, int32_t height, struct wl_array *states) -+{ -+ (void)xdg_toplevel; -+ struct rvgpu_scanout *s = data; -+ -+ s->window.w = (unsigned int)width; -+ s->window.h = (unsigned int)height; -+ -+ wl_egl_window_resize(s->native->egl_window, width, height, 0, 0); -+} -+ -+static const struct xdg_toplevel_listener xdg_toplevel_listener = { -+ handle_xdg_toplevel_configure, -+}; -+ -+static struct config_param { -+ struct rvgpu_egl_state *egl_state; -+ struct rvgpu_scanout *scanout; -+}; -+ -+static void handle_xdg_surface_configure(void *data, -+ struct xdg_surface *surface, uint32_t serial) -+{ -+ struct config_param *cp = data; -+ struct rvgpu_scanout *s = cp->scanout; -+ struct rvgpu_egl_state *egl = cp->egl_state; -+ -+ if (surface == NULL) -+ return; -+ -+ xdg_surface_ack_configure(surface, serial); -+ if (s->native->wait_for_configure) { -+ if (egl->user_specified_scanouts){ -+ for (unsigned int i = 0; i < VIRTIO_GPU_MAX_SCANOUTS; i++) { -+ if (egl->scanouts[i].params.enabled) { -+ rvgpu_egl_draw(egl, &egl->scanouts[i], false); -+ } -+ } -+ } else { -+ rvgpu_egl_draw(egl, &egl->scanouts[0], false); -+ } -+ s->native->wait_for_configure = false; -+ } -+} -+ -+static const struct xdg_surface_listener xdg_surface_listener = { -+ handle_xdg_surface_configure, -+}; -+ - static void pointer_handle_enter(void *data, struct wl_pointer *pointer, - uint32_t serial, struct wl_surface *surface, - wl_fixed_t sx, wl_fixed_t sy) -@@ -493,6 +572,12 @@ static void rvgpu_wl_destroy_scanout(struct rvgpu_egl_state *e, - if (s->native->ivi_surface) - ivi_surface_destroy(s->native->ivi_surface); - -+ if (s->native->xdg_toplevel) -+ xdg_toplevel_destroy(s->native->xdg_toplevel); -+ -+ if (s->native->xdg_surface) -+ xdg_surface_destroy(s->native->xdg_surface); -+ - wl_surface_destroy(s->native->surface); - free(s->native); - } -@@ -510,6 +595,12 @@ static void rvgpu_wl_free(struct rvgpu_egl_state *e) - if (r->shell) - wl_shell_destroy(r->shell); - -+ if (r->wm_base) -+ xdg_wm_base_destroy(r->wm_base); -+ -+ if (r->agl_shell_desktop) -+ agl_shell_desktop_destroy(r->agl_shell_desktop); -+ - wl_seat_destroy(r->seat); - if (r->pointer) - wl_pointer_destroy(r->pointer); -@@ -564,6 +655,21 @@ static void rvgpu_wl_process_events(struct rvgpu_egl_state *e, const void *ev, - } - } - -+static void create_opaque_region(struct rvgpu_egl_state *e, -+ struct rvgpu_scanout *s) -+{ -+ struct rvgpu_wl_state *r = to_wl(e); -+ struct wl_region *region = -+ wl_compositor_create_region(r->comp); -+ assert(region); -+ wl_region_add(region, 0, 0, (int)s->window.w, -+ (int)s->window.h); -+ wl_surface_set_opaque_region(s->native->surface, -+ region); -+ wl_region_destroy(region); -+} -+ -+ - static void rvgpu_wl_set_scanout(struct rvgpu_egl_state *e, - struct rvgpu_scanout *s) - { -@@ -572,15 +678,9 @@ static void rvgpu_wl_set_scanout(struct rvgpu_egl_state *e, - if (!r->fullscreen) { - s->window = s->virgl.box; - if (s->native) { -- if (!r->translucent) { -- struct wl_region *region = -- wl_compositor_create_region(r->comp); -- wl_region_add(region, 0, 0, (int)s->window.w, -- (int)s->window.h); -- wl_surface_set_opaque_region(s->native->surface, -- region); -- wl_region_destroy(region); -- } -+ if (!r->translucent) -+ create_opaque_region(e, s); -+ - wl_egl_window_resize(s->native->egl_window, - (int)s->window.w, (int)s->window.h, - 0, 0); -@@ -629,6 +729,59 @@ static void rvgpu_wl_create_scanout(struct rvgpu_egl_state *e, - assert(n->ivi_surface); - ivi_surface_add_listener(n->ivi_surface, &ivi_surface_listener, - s); -+ -+ } else if (r->wm_base) { -+ if (r->agl_shell_desktop){ -+ /* Default create window at the center of the AGL homescreen */ -+ unsigned int agl_x = 0; -+ unsigned int agl_y = 215; -+ unsigned int agl_w = 1080; -+ unsigned int agl_h = 1500; -+ if (sp && sp->agl_win_set) { -+ agl_x = sp->agl_win.x; -+ agl_y = sp->agl_win.y; -+ } -+ -+ /* -+ * Because we can not resize the surface automatically, window size -+ * have to be fit to the size of renderer box. -+ */ -+ if (sp && sp->boxed) { -+ agl_w = s->window.w; -+ agl_h = s->window.h; -+ } -+ -+ agl_shell_desktop_set_app_property(r->agl_shell_desktop, -+ "rvgpu-renderer", -+ AGL_SHELL_DESKTOP_APP_ROLE_POPUP, -+ agl_x, agl_y, -+ 0, 0, agl_w, agl_h, -+ r->output); -+ } -+ -+ n->xdg_surface = -+ xdg_wm_base_get_xdg_surface(r->wm_base, n->surface); -+ assert(n->xdg_surface); -+ -+ struct config_param *cp = malloc(sizeof(*cp)); -+ assert(cp); -+ -+ cp->egl_state = e; -+ cp->scanout = s; -+ -+ xdg_surface_add_listener(n->xdg_surface, -+ &xdg_surface_listener, cp); -+ n->xdg_toplevel = xdg_surface_get_toplevel(n->xdg_surface); -+ assert(n->xdg_toplevel); -+ -+ xdg_toplevel_add_listener(n->xdg_toplevel, -+ &xdg_toplevel_listener, s); -+ -+ xdg_toplevel_set_app_id(n->xdg_toplevel, "rvgpu-renderer"); -+ wl_surface_commit(n->surface); -+ n->wait_for_configure = true; -+ create_opaque_region(e, s); -+ - } else if (r->shell) { - char title[32]; - -@@ -654,16 +807,9 @@ static void rvgpu_wl_create_scanout(struct rvgpu_egl_state *e, - NULL); - } else { - wl_shell_surface_set_toplevel(n->shell_surface); -- if (!r->translucent) { -- struct wl_region *region = -- wl_compositor_create_region(r->comp); -- assert(region); -- wl_region_add(region, 0, 0, (int)s->window.w, -- (int)s->window.h); -- wl_surface_set_opaque_region(n->surface, -- region); -- wl_region_destroy(region); -- } -+ if (!r->translucent) -+ create_opaque_region(e, s); -+ - } - } - -@@ -677,6 +823,10 @@ static void rvgpu_wl_create_scanout(struct rvgpu_egl_state *e, - eglMakeCurrent(e->dpy, s->surface, s->surface, e->context); - - glGenFramebuffers(1, &s->fb); -+ -+ if(!r->wm_base){ -+ rvgpu_egl_draw(e, s, false); -+ } - } - - static const struct rvgpu_egl_callbacks wl_callbacks = { -diff --git a/src/rvgpu-renderer/renderer/rvgpu-egl.c b/src/rvgpu-renderer/renderer/rvgpu-egl.c -index a9dd398..6918843 100644 ---- a/src/rvgpu-renderer/renderer/rvgpu-egl.c -+++ b/src/rvgpu-renderer/renderer/rvgpu-egl.c -@@ -21,6 +21,7 @@ - #include <assert.h> - #include <err.h> - #include <stdlib.h> -+#include <stdio.h> - - #include <rvgpu-renderer/renderer/rvgpu-egl.h> - -@@ -146,6 +147,7 @@ void rvgpu_egl_free(struct rvgpu_egl_state *e) - e->cb->free(e); - } - -+ - void rvgpu_egl_draw(struct rvgpu_egl_state *e, struct rvgpu_scanout *s, - bool vsync) - { -@@ -191,6 +193,7 @@ void rvgpu_egl_draw(struct rvgpu_egl_state *e, struct rvgpu_scanout *s, - (int)s->window.w, (int)s->window.h, - GL_COLOR_BUFFER_BIT, GL_NEAREST); - } -+ - if (e->cb->draw) - e->cb->draw(e, s, vsync); - else -diff --git a/src/rvgpu-renderer/rvgpu-renderer.c b/src/rvgpu-renderer/rvgpu-renderer.c -index 3e74289..40b78d4 100644 ---- a/src/rvgpu-renderer/rvgpu-renderer.c -+++ b/src/rvgpu-renderer/rvgpu-renderer.c -@@ -52,6 +52,7 @@ static void usage(void) - info("\t-f\t\tRun in fullscreen mode\n"); - info("\t-p port\t\tport for listening (default: %u)\n", - RVGPU_DEFAULT_PORT); -+ info("\t-w\t\tSet AGL window position\n"); - info("\t-h\t\tShow this message\n"); - - info("\nNote:\n"); -@@ -189,7 +190,7 @@ int main(int argc, char **argv) - - memset(sp, 0, sizeof(sp)); - -- while ((opt = getopt(argc, argv, "afhi:c:s:S:b:B:p:g:")) != -1) { -+ while ((opt = getopt(argc, argv, "afhi:c:s:S:b:w:B:p:g:")) != -1) { - switch (opt) { - case 'a': - translucent = true; -@@ -240,6 +241,13 @@ int main(int argc, char **argv) - } - cp->boxed = true; - break; -+ case 'w': -+ if (sscanf(optarg, "%u,%u", -+ &cp->agl_win.x, &cp->agl_win.y) != 2) { -+ errx(1, "invalid AGL popup application window%s", optarg); -+ } -+ cp->agl_win_set = true; -+ break; - case 'i': - cp->id = (uint32_t)sanity_strtonum( - optarg, 1, UINT32_MAX, &errstr); -@@ -300,7 +308,6 @@ int main(int argc, char **argv) - s->params = sp[i]; - if (sp[i].enabled) { - rvgpu_egl_create_scanout(egl, &egl->scanouts[i]); -- rvgpu_egl_draw(egl, &egl->scanouts[i], false); - } - } - --- -2.25.1 - diff --git a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu_git.bb b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu_git.bb index 899f81bb..d59c15b2 100644 --- a/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu_git.bb +++ b/meta-uhmi/meta-rvgpu/recipes-graphics/remote-virtio-gpu/remote-virtio-gpu_git.bb @@ -7,7 +7,6 @@ require remote-virtio-gpu.inc SRC_URI:append = " \ file://0001-Remove-some-rvgpu-command-options.patch \ - file://0002-Add-agl-shell-desktop-and-xdg-shell-support.patch \ " S = "${WORKDIR}/git" diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/linux/linux-rvgpu.inc b/meta-uhmi/meta-rvgpu/recipes-kernel/linux/linux-rvgpu.inc index b052dfd1..5d405afd 100644 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/linux/linux-rvgpu.inc +++ b/meta-uhmi/meta-rvgpu/recipes-kernel/linux/linux-rvgpu.inc @@ -1,3 +1,5 @@ +DESCRIPTION = "Enable linux virtio-loopback driver" + FILESEXTRAPATHS:prepend := "${THISDIR}/linux-common/:" SRC_URI:append = " \ diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver.inc b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver.inc index 3c21d446..fe0757d4 100644 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver.inc +++ b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver.inc @@ -1,5 +1,5 @@ PV = "0.0+git${SRCPV}" -SRCREV = "db18183e68033fd4a6798e8998a5d9a3c6410cfc" +SRCREV = "070ba544722c78e3f6a0f43e4fe08a0214c66a49" BRANCH ?= "main" SRC_URI = " \ git://github.com/unified-hmi/virtio-loopback-driver.git;protocol=https;branch=${BRANCH} \ diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/0001-Remove-card_index-option.patch b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/0001-Remove-card_index-option.patch index e20df709..b3305d3d 100644 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/0001-Remove-card_index-option.patch +++ b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/0001-Remove-card_index-option.patch @@ -1,24 +1,21 @@ -From ba9b19b36f7c7f7df8c4041569f7cef04b2d42da Mon Sep 17 00:00:00 2001 -From: murakami <murakami.kenta002@jp.panasonic.jp> -Date: Fri, 28 Jul 2023 13:05:19 +0900 -Subject: [PATCH] Remove card_index option - -Remove card_index option support from virtio-loopback-driver, -because the kernel needs to be patched to run that option -in rvgpu-proxy. +From 123a03d7e2ae90da1b8a00ada136f439ba5672db Mon Sep 17 00:00:00 2001 +From: Fumiya Kohzu <kohzu.fumiya@jp.panasonic.com> +Date: Mon, 20 Nov 2023 19:37:50 +0900 +Subject: [PATCH] Remove card_index option support from virtio-loopback-driver, + because the kernel needs to be patched to run that option in rvgpu-proxy. Upstream-Status: Inappropriate [embedded specific] --- - src/virtio_lo.h | 1 - - src/virtio_lo_device.c | 1 - - src/virtio_lo_device.h | 1 - - src/virtio_lo_driver.c | 3 --- + virtio_lo.h | 1 - + virtio_lo_device.c | 1 - + virtio_lo_device.h | 1 - + virtio_lo_driver.c | 3 --- 4 files changed, 6 deletions(-) -diff --git a/src/virtio_lo.h b/src/virtio_lo.h +diff --git a/virtio_lo.h b/virtio_lo.h index a07fa91..0da681e 100644 ---- a/src/virtio_lo.h -+++ b/src/virtio_lo.h +--- a/virtio_lo.h ++++ b/virtio_lo.h @@ -25,7 +25,6 @@ struct virtio_lo_devinfo { __u64 features; /* IN/OUT */ __u32 config_size; /* IN */ @@ -27,10 +24,10 @@ index a07fa91..0da681e 100644 __u32 padding; /* IN */ __u8 *config; /* IN/OUT */ struct virtio_lo_qinfo *qinfo; /* IN/OUT */ -diff --git a/src/virtio_lo_device.c b/src/virtio_lo_device.c +diff --git a/virtio_lo_device.c b/virtio_lo_device.c index 39e8788..22687b7 100644 ---- a/src/virtio_lo_device.c -+++ b/src/virtio_lo_device.c +--- a/virtio_lo_device.c ++++ b/virtio_lo_device.c @@ -171,7 +171,6 @@ static long vilo_ioctl_adddev(struct virtio_lo_owner *owner, dev->device_id = di.device_id; @@ -39,10 +36,10 @@ index 39e8788..22687b7 100644 dev->nqueues = di.nqueues; dev->features = dev->device_features = di.features; -diff --git a/src/virtio_lo_device.h b/src/virtio_lo_device.h +diff --git a/virtio_lo_device.h b/virtio_lo_device.h index 2d872a7..bc40b3e 100644 ---- a/src/virtio_lo_device.h -+++ b/src/virtio_lo_device.h +--- a/virtio_lo_device.h ++++ b/virtio_lo_device.h @@ -25,7 +25,6 @@ struct virtio_lo_device { unsigned idx; u32 device_id; @@ -51,10 +48,10 @@ index 2d872a7..bc40b3e 100644 struct platform_device *pdev; -diff --git a/src/virtio_lo_driver.c b/src/virtio_lo_driver.c +diff --git a/virtio_lo_driver.c b/virtio_lo_driver.c index 30d1852..d7f517d 100644 ---- a/src/virtio_lo_driver.c -+++ b/src/virtio_lo_driver.c +--- a/virtio_lo_driver.c ++++ b/virtio_lo_driver.c @@ -284,9 +284,6 @@ static int virtio_lo_probe(struct platform_device *pdev) vl_driv->device = device; vl_driv->pdev = pdev; @@ -66,5 +63,5 @@ index 30d1852..d7f517d 100644 vl_driv->vdev.dev.release = virtio_lo_release_dev_empty; vl_driv->vdev.config = &virtio_lo_config_ops; -- -2.17.1 +2.25.1 diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Kbuild b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Kbuild deleted file mode 100644 index 27e54e58..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Kbuild +++ /dev/null @@ -1,3 +0,0 @@ -# KBuild for virtio-lo -obj-m += virtio_lo.o -virtio_lo-y := virtio_lo_device.o virtio_lo_driver.o diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Makefile.driver b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Makefile.driver deleted file mode 100644 index 662c18ea..00000000 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver/Makefile.driver +++ /dev/null @@ -1,17 +0,0 @@ -# -# Makefile for virtio-lo -# -ifeq ($(KDIR),) -$(error "KDIR must be specified.") -endif - -default: - $(MAKE) -C $(KDIR) M=$$PWD/src - -modules_install: - $(MAKE) -C $(KDIR) M=$$PWD/src $@ - -clean: - $(MAKE) -C $(KDIR) M=$$PWD/src $@ - -.PHONY: default modules_install clean diff --git a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver_git.bb b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver_git.bb index 687c33dd..7a203767 100644 --- a/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver_git.bb +++ b/meta-uhmi/meta-rvgpu/recipes-kernel/virtio-loopback-driver/virtio-loopback-driver_git.bb @@ -7,24 +7,20 @@ require virtio-loopback-driver.inc SRC_URI:append = " \ file://0001-Remove-card_index-option.patch \ - file://Makefile.driver \ - file://Kbuild \ " S = "${WORKDIR}/git" -EXTRA_OEMAKE = "KDIR=${STAGING_KERNEL_BUILDDIR}" -MODULES_MODULE_SYMVERS_LOCATION = "src" inherit module -do_compile:prepend() { - cp ${WORKDIR}/Makefile.driver ${S}/Makefile - cp ${WORKDIR}/Kbuild ${S}/src/ -} +EXTRA_OEMAKE = "M=${S} -C ${STAGING_KERNEL_DIR}" do_install:append() { - install -d ${D}${PKG_CONFIG_SYSTEM_INCLUDE_PATH}/remote-virtio-gpu - install -m 755 ${S}/src/virtio_lo.h ${D}${PKG_CONFIG_SYSTEM_INCLUDE_PATH}/remote-virtio-gpu/virtio_lo.h + install -d ${D}${PKG_CONFIG_SYSTEM_INCLUDE_PATH}/linux + install -m 755 ${S}/virtio_lo.h ${D}${PKG_CONFIG_SYSTEM_INCLUDE_PATH}/linux/ + # Add this section to install virtio_lo.conf + install -d ${D}${sysconfdir}/modules-load.d + echo "virtio_lo" > ${D}${sysconfdir}/modules-load.d/virtio_lo.conf } FILES:${PN} = " \ @@ -32,10 +28,5 @@ FILES:${PN} = " \ ${sysconfdir}/modules-load.d \ " -RPROVIDES:${PN} += " \ - kernel-module-virtiolo \ - kernel-module-virtio-lo${KERNEL_MODULE_PACKAGE_SUFFIX} \ -" - # Autoload virtio lo driver KERNEL_MODULE_AUTOLOAD:append = " virtio_lo" |