diff options
Diffstat (limited to 'meta/recipes-graphics/kmscube')
3 files changed, 48 insertions, 122 deletions
diff --git a/meta/recipes-graphics/kmscube/kmscube/0001-cube-gears-Change-header-file-to-GLES3-gl3.h.patch b/meta/recipes-graphics/kmscube/kmscube/0001-cube-gears-Change-header-file-to-GLES3-gl3.h.patch new file mode 100644 index 0000000000..415515b908 --- /dev/null +++ b/meta/recipes-graphics/kmscube/kmscube/0001-cube-gears-Change-header-file-to-GLES3-gl3.h.patch @@ -0,0 +1,31 @@ +From 38237aee63d671cc418902951b8945b59a41a4fd Mon Sep 17 00:00:00 2001 +From: Fabio Estevam <festevam@gmail.com> +Date: Mon, 8 Jan 2024 15:00:01 -0300 +Subject: [PATCH] cube-gears: Change header file to <GLES3/gl3.h> + +Since commit 96d63eb59e34 ("kmscube: Add gears mode"), kmscube fails +to build on platforms without <GL/gl.h>. + +Fix it by changing the header file to <GLES3/gl3.h>. + +Reported-by: Martin Jansa <martin.jansa@gmail.com> +Suggested-by: Martin Jansa <martin.jansa@gmail.com> +Signed-off-by: Fabio Estevam <festevam@gmail.com> +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/kmscube/-/merge_requests/51] +--- + cube-gears.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cube-gears.c b/cube-gears.c +index d5b7a5f..cb538ec 100644 +--- a/cube-gears.c ++++ b/cube-gears.c +@@ -31,7 +31,7 @@ + #include <sys/time.h> + #include <math.h> + +-#include <GL/gl.h> ++#include <GLES3/gl3.h> + + #include "common.h" + #include "esUtil.h" diff --git a/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch b/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch deleted file mode 100644 index a7a08f14e6..0000000000 --- a/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch +++ /dev/null @@ -1,117 +0,0 @@ -From a91c588b5a4122506e7fe949c37d530621bdd997 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> -Date: Tue, 11 Jul 2017 14:50:37 -0500 -Subject: [PATCH] Detect gst_bo_map/_unmap and use it (or avoid it) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Those functions are not available on libMali, thus breaking -builds and creating havoc. - -Removing the specific parts of the code that deal with -gbm_bo_map() and gbm_bo_unmap() renders the kmscube utility -a little less useful, but still valuable. - -Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> -Cc: Rob Clark <robdclark@gmail.com> -Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> - -Upstream-Status: Submitted [https://lists.freedesktop.org/archives/mesa-dev/2017-July/163020.html] -Signed-off-by: Zoltan Kuscsik <zoltan.kuscsik@solution57.com> ---- - Makefile.am | 5 ++++- - configure.ac | 3 +++ - gst-decoder.c | 7 ++++++- - kmscube.c | 4 ++++ - 4 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index ba064e4..3a0a50b 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -43,7 +43,6 @@ kmscube_SOURCES = \ - common.c \ - common.h \ - cube-smooth.c \ -- cube-tex.c \ - drm-atomic.c \ - drm-common.c \ - drm-common.h \ -@@ -68,3 +67,7 @@ texturator_SOURCES = \ - drm-common.c \ - drm-legacy.c \ - texturator.c -+ -+if ENABLE_GBM_MAP -+kmscube_SOURCES += cube-tex.c -+endif -diff --git a/configure.ac b/configure.ac -index 6be6541..3d20121 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -49,5 +49,8 @@ if test "x$HAVE_GST" = "xyes"; then - fi - AM_CONDITIONAL(ENABLE_GST, [test "x$HAVE_GST" = "xyes"]) - -+AC_CHECK_LIB([gbm], [gbm_bo_map], [HAVE_GBM_BO_MAP=yes], []) -+AM_CONDITIONAL(ENABLE_GBM_MAP, [test "x$HAVE_GBM_BO_MAP" = "xyes"]) -+ - AC_CONFIG_FILES([Makefile]) - AC_OUTPUT -diff --git a/gst-decoder.c b/gst-decoder.c -index 5431014..0aa7a55 100644 ---- a/gst-decoder.c -+++ b/gst-decoder.c -@@ -332,6 +332,7 @@ set_last_frame(struct decoder *dec, EGLImage frame, GstSample *samp) - dec->last_samp = samp; - } - -+#if HAVE_GBM_BO_MAP - // TODO this could probably be a helper re-used by cube-tex: - static int - buf_to_fd(const struct gbm *gbm, int size, void *ptr) -@@ -357,6 +358,7 @@ buf_to_fd(const struct gbm *gbm, int size, void *ptr) - - return fd; - } -+#endif - - static EGLImage - buffer_to_image(struct decoder *dec, GstBuffer *buf) -@@ -410,12 +412,15 @@ buffer_to_image(struct decoder *dec, GstBuffer *buf) - - if (is_dmabuf_mem) { - dmabuf_fd = dup(gst_dmabuf_memory_get_fd(mem)); -- } else { -+ } -+#if HAVE_GBM_BO_MAP -+ else { - GstMapInfo map_info; - gst_buffer_map(buf, &map_info, GST_MAP_READ); - dmabuf_fd = buf_to_fd(dec->gbm, map_info.size, map_info.data); - gst_buffer_unmap(buf, &map_info); - } -+#endif - - if (dmabuf_fd < 0) { - GST_ERROR("could not obtain DMABUF FD"); -diff --git a/kmscube.c b/kmscube.c -index 81803be..e93da67 100644 ---- a/kmscube.c -+++ b/kmscube.c -@@ -166,7 +166,11 @@ int main(int argc, char *argv[]) - else if (mode == VIDEO) - egl = init_cube_video(gbm, video, samples); - else -+#if HAVE_GBM_BO_MAP - egl = init_cube_tex(gbm, mode, samples); -+#else -+ printf("gbm_bo_map() support missing\n"); -+#endif - - if (!egl) { - printf("failed to initialize EGL\n"); --- -2.22.0 - diff --git a/meta/recipes-graphics/kmscube/kmscube_git.bb b/meta/recipes-graphics/kmscube/kmscube_git.bb index 2b6837fef6..34d5a7d71d 100644 --- a/meta/recipes-graphics/kmscube/kmscube_git.bb +++ b/meta/recipes-graphics/kmscube/kmscube_git.bb @@ -1,21 +1,33 @@ -DESCRIPTION = "Demo application to showcase 3D graphics using kms and gbm" +SUMMARY = "Demo application to showcase 3D graphics using kms and gbm" +DESCRIPTION = "kmscube is a little demonstration program for how to drive bare metal graphics \ +without a compositor like X11, wayland or similar, using DRM/KMS (kernel mode \ +setting), GBM (graphics buffer manager) and EGL for rendering content using \ +OpenGL or OpenGL ES." HOMEPAGE = "https://cgit.freedesktop.org/mesa/kmscube/" LICENSE = "MIT" SECTION = "graphics" -DEPENDS = "virtual/libgles2 virtual/egl libdrm" +DEPENDS = "virtual/libgles3 virtual/libgles2 virtual/egl libdrm virtual/libgbm" LIC_FILES_CHKSUM = "file://kmscube.c;beginline=1;endline=23;md5=8b309d4ee67b7315ff7381270dd631fb" -SRCREV = "f632b23a528ed6b4e1fddd774db005c30ab65568" +SRCREV = "467e86c5cbeb2a2051b31ce2c240d6ddf5bc3112" SRC_URI = "git://gitlab.freedesktop.org/mesa/kmscube;branch=master;protocol=https \ - file://detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch" + file://0001-cube-gears-Change-header-file-to-GLES3-gl3.h.patch \ + " + UPSTREAM_CHECK_COMMITS = "1" S = "${WORKDIR}/git" -inherit meson pkgconfig distro_features_check +BASEPV = "0.0.1" +PV = "${BASEPV}+git" + +inherit meson pkgconfig features_check REQUIRED_DISTRO_FEATURES = "opengl" PACKAGECONFIG ??= "" PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,gstreamer1.0 gstreamer1.0-plugins-base" + +CFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}" + |