diff options
author | Daniel Díaz <daniel.diaz@linaro.org> | 2018-03-02 18:51:54 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-06 06:43:10 -0800 |
commit | eee3ee5c5b719b65fe50a000d501c2f1c9c27767 (patch) | |
tree | 24eeed926d4c9075f497547548b32724a0b5c090 /meta/recipes-graphics | |
parent | d1e6aa57f7ee44b92c3a2ec740b806c17254814a (diff) | |
download | poky-eee3ee5c5b719b65fe50a000d501c2f1c9c27767.tar.gz |
kmscube: Add patch for missing GBM function
Some implementations of GBM, like the one included with
libMali, do not have gbm_bo_map() nor gbm_bo_unmap().
This patch enables kmscube to work with those implementations
even if it doesn't work as great.
(From OE-Core rev: 54615151da5e8c77c803947ce5760d06c1691c58)
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch | 116 | ||||
-rw-r--r-- | meta/recipes-graphics/kmscube/kmscube_git.bb | 3 |
2 files changed, 118 insertions, 1 deletions
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 new file mode 100644 index 0000000000..3605446e44 --- /dev/null +++ b/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | From 761bf993ca55095f46380c0238583791c1797295 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> | ||
3 | Date: Tue, 11 Jul 2017 14:50:37 -0500 | ||
4 | Subject: [PATCH kmscube] Detect gst_bo_map/_unmap and use it (or avoid it) | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Those functions are not available on libMali, thus breaking | ||
10 | builds and creating havoc. | ||
11 | |||
12 | Removing the specific parts of the code that deal with | ||
13 | gbm_bo_map() and gbm_bo_unmap() renders the kmscube utility | ||
14 | a little less useful, but still valuable. | ||
15 | |||
16 | Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> | ||
17 | Cc: Rob Clark <robdclark@gmail.com> | ||
18 | Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> | ||
19 | |||
20 | Upstream-Status: Submitted [https://lists.freedesktop.org/archives/mesa-dev/2017-July/163020.html] | ||
21 | --- | ||
22 | Makefile.am | 5 ++++- | ||
23 | configure.ac | 3 +++ | ||
24 | gst-decoder.c | 7 ++++++- | ||
25 | kmscube.c | 4 ++++ | ||
26 | 4 files changed, 17 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/Makefile.am b/Makefile.am | ||
29 | index a36087d..ab4adbf 100644 | ||
30 | --- a/Makefile.am | ||
31 | +++ b/Makefile.am | ||
32 | @@ -43,7 +43,6 @@ kmscube_SOURCES = \ | ||
33 | common.c \ | ||
34 | common.h \ | ||
35 | cube-smooth.c \ | ||
36 | - cube-tex.c \ | ||
37 | drm-atomic.c \ | ||
38 | drm-common.c \ | ||
39 | drm-common.h \ | ||
40 | @@ -59,3 +58,7 @@ kmscube_LDADD += $(GST_LIBS) | ||
41 | kmscube_CFLAGS += $(GST_CFLAGS) | ||
42 | kmscube_SOURCES += cube-video.c gst-decoder.c | ||
43 | endif | ||
44 | + | ||
45 | +if ENABLE_GBM_MAP | ||
46 | +kmscube_SOURCES += cube-tex.c | ||
47 | +endif | ||
48 | diff --git a/configure.ac b/configure.ac | ||
49 | index 8397f7b..c7f1f4d 100644 | ||
50 | --- a/configure.ac | ||
51 | +++ b/configure.ac | ||
52 | @@ -65,5 +65,8 @@ if test "x$enable_gbm_modifiers" = xyes; then | ||
53 | AC_DEFINE(HAVE_GBM_MODIFIERS, 1, [Define if you can use GBM properties.]) | ||
54 | fi | ||
55 | |||
56 | +AC_CHECK_LIB([gbm], [gbm_bo_map], [HAVE_GBM_BO_MAP=yes], []) | ||
57 | +AM_CONDITIONAL(ENABLE_GBM_MAP, [test "x$HAVE_GBM_BO_MAP" = "xyes"]) | ||
58 | + | ||
59 | AC_CONFIG_FILES([Makefile]) | ||
60 | AC_OUTPUT | ||
61 | diff --git a/gst-decoder.c b/gst-decoder.c | ||
62 | index 2d6d581..b84980e 100644 | ||
63 | --- a/gst-decoder.c | ||
64 | +++ b/gst-decoder.c | ||
65 | @@ -332,6 +332,7 @@ set_last_frame(struct decoder *dec, EGLImage frame, GstSample *samp) | ||
66 | dec->last_samp = samp; | ||
67 | } | ||
68 | |||
69 | +#if HAVE_GBM_BO_MAP | ||
70 | // TODO this could probably be a helper re-used by cube-tex: | ||
71 | static int | ||
72 | buf_to_fd(const struct gbm *gbm, int size, void *ptr) | ||
73 | @@ -357,6 +358,7 @@ buf_to_fd(const struct gbm *gbm, int size, void *ptr) | ||
74 | |||
75 | return fd; | ||
76 | } | ||
77 | +#endif | ||
78 | |||
79 | static EGLImage | ||
80 | buffer_to_image(struct decoder *dec, GstBuffer *buf) | ||
81 | @@ -410,12 +412,15 @@ buffer_to_image(struct decoder *dec, GstBuffer *buf) | ||
82 | |||
83 | if (is_dmabuf_mem) { | ||
84 | dmabuf_fd = dup(gst_dmabuf_memory_get_fd(mem)); | ||
85 | - } else { | ||
86 | + } | ||
87 | +#if HAVE_GBM_BO_MAP | ||
88 | + else { | ||
89 | GstMapInfo map_info; | ||
90 | gst_buffer_map(buf, &map_info, GST_MAP_READ); | ||
91 | dmabuf_fd = buf_to_fd(dec->gbm, map_info.size, map_info.data); | ||
92 | gst_buffer_unmap(buf, &map_info); | ||
93 | } | ||
94 | +#endif | ||
95 | |||
96 | if (dmabuf_fd < 0) { | ||
97 | GST_ERROR("could not obtain DMABUF FD"); | ||
98 | diff --git a/kmscube.c b/kmscube.c | ||
99 | index 3a2c4dd..276dc55 100644 | ||
100 | --- a/kmscube.c | ||
101 | +++ b/kmscube.c | ||
102 | @@ -142,7 +142,11 @@ int main(int argc, char *argv[]) | ||
103 | else if (mode == VIDEO) | ||
104 | egl = init_cube_video(gbm, video); | ||
105 | else | ||
106 | +#if HAVE_GBM_BO_MAP | ||
107 | egl = init_cube_tex(gbm, mode); | ||
108 | +#else | ||
109 | + printf("gbm_bo_map() support missing\n"); | ||
110 | +#endif | ||
111 | |||
112 | if (!egl) { | ||
113 | printf("failed to initialize EGL\n"); | ||
114 | -- | ||
115 | 2.7.4 | ||
116 | |||
diff --git a/meta/recipes-graphics/kmscube/kmscube_git.bb b/meta/recipes-graphics/kmscube/kmscube_git.bb index 4265f8a8dc..5b64ed6438 100644 --- a/meta/recipes-graphics/kmscube/kmscube_git.bb +++ b/meta/recipes-graphics/kmscube/kmscube_git.bb | |||
@@ -7,7 +7,8 @@ DEPENDS = "virtual/libgles2 virtual/egl libdrm gstreamer1.0 gstreamer1.0-plugins | |||
7 | LIC_FILES_CHKSUM = "file://kmscube.c;beginline=1;endline=23;md5=8b309d4ee67b7315ff7381270dd631fb" | 7 | LIC_FILES_CHKSUM = "file://kmscube.c;beginline=1;endline=23;md5=8b309d4ee67b7315ff7381270dd631fb" |
8 | 8 | ||
9 | SRCREV = "0d8de4ce3a03f36af1817f9b0586d132ad2c5d2e" | 9 | SRCREV = "0d8de4ce3a03f36af1817f9b0586d132ad2c5d2e" |
10 | SRC_URI = "git://anongit.freedesktop.org/mesa/kmscube;branch=master;protocol=git" | 10 | SRC_URI = "git://anongit.freedesktop.org/mesa/kmscube;branch=master;protocol=git \ |
11 | file://detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch" | ||
11 | UPSTREAM_CHECK_COMMITS = "1" | 12 | UPSTREAM_CHECK_COMMITS = "1" |
12 | 13 | ||
13 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |