From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 10/13] qemu: add a backported patch to fix egl-headless support
Date: Fri, 1 Feb 2019 14:05:51 +0100 [thread overview]
Message-ID: <20190201130554.90094-10-alex.kanavin@gmail.com> (raw)
In-Reply-To: <20190201130554.90094-1-alex.kanavin@gmail.com>
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
...-egl-headless-add-egl_create_context.patch | 50 +++++++++++++++++++
meta/recipes-devtools/qemu/qemu_3.1.0.bb | 1 +
2 files changed, 51 insertions(+)
create mode 100644 meta/recipes-devtools/qemu/qemu/0001-egl-headless-add-egl_create_context.patch
diff --git a/meta/recipes-devtools/qemu/qemu/0001-egl-headless-add-egl_create_context.patch b/meta/recipes-devtools/qemu/qemu/0001-egl-headless-add-egl_create_context.patch
new file mode 100644
index 00000000000..d9326c017ad
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-egl-headless-add-egl_create_context.patch
@@ -0,0 +1,50 @@
+From 952e5d584f5aabe41298c278065fe628f3f7aa7a Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Thu, 29 Nov 2018 13:35:02 +0100
+Subject: [PATCH] egl-headless: add egl_create_context
+
+We must set the correct context (via eglMakeCurrent) before
+calling qemu_egl_create_context, so we need a thin wrapper and can't
+hook qemu_egl_create_context directly as ->dpy_gl_ctx_create callback.
+
+Reported-by: Frederik Carlier <frederik.carlier@quamotion.mobi>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Message-id: 20181129123502.30129-1-kraxel@redhat.com
+
+Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=952e5d584f5aabe41298c278065fe628f3f7aa7a]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ ui/egl-headless.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/ui/egl-headless.c b/ui/egl-headless.c
+index 4cf3bbc0e4..519e7bad32 100644
+--- a/ui/egl-headless.c
++++ b/ui/egl-headless.c
+@@ -38,6 +38,14 @@ static void egl_gfx_switch(DisplayChangeListener *dcl,
+ edpy->ds = new_surface;
+ }
+
++static QEMUGLContext egl_create_context(DisplayChangeListener *dcl,
++ QEMUGLParams *params)
++{
++ eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
++ qemu_egl_rn_ctx);
++ return qemu_egl_create_context(dcl, params);
++}
++
+ static void egl_scanout_disable(DisplayChangeListener *dcl)
+ {
+ egl_dpy *edpy = container_of(dcl, egl_dpy, dcl);
+@@ -150,7 +158,7 @@ static const DisplayChangeListenerOps egl_ops = {
+ .dpy_gfx_update = egl_gfx_update,
+ .dpy_gfx_switch = egl_gfx_switch,
+
+- .dpy_gl_ctx_create = qemu_egl_create_context,
++ .dpy_gl_ctx_create = egl_create_context,
+ .dpy_gl_ctx_destroy = qemu_egl_destroy_context,
+ .dpy_gl_ctx_make_current = qemu_egl_make_context_current,
+ .dpy_gl_ctx_get_current = qemu_egl_get_current_context,
+--
+2.17.1
+
diff --git a/meta/recipes-devtools/qemu/qemu_3.1.0.bb b/meta/recipes-devtools/qemu/qemu_3.1.0.bb
index cd7cd67a3f0..ea4277eddea 100644
--- a/meta/recipes-devtools/qemu/qemu_3.1.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_3.1.0.bb
@@ -22,6 +22,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0010-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
file://0011-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \
file://0001-Add-a-missing-X11-include.patch \
+ file://0001-egl-headless-add-egl_create_context.patch \
"
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
--
2.17.1
next prev parent reply other threads:[~2019-02-01 13:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-01 13:05 [PATCH 01/13] virglrenderer: add a recipe Alexander Kanavin
2019-02-01 13:05 ` [PATCH 02/13] qemu: enable virglrenderer and glx options for native/nativesdk builds Alexander Kanavin
2019-02-01 13:05 ` [PATCH 03/13] qemu: drop --with-gtkabi option, as it is no longer supported Alexander Kanavin
2019-02-01 13:05 ` [PATCH 04/13] local.conf.sample: adjust the qemu config to enable gtk+ instead of sdl Alexander Kanavin
2019-02-01 13:05 ` [PATCH 05/13] qemu: build target variant with gtk+, and nativesdk variant without sdl Alexander Kanavin
2019-02-01 13:05 ` [PATCH 06/13] qemu: remove support for building against host sdl Alexander Kanavin
2019-02-01 13:05 ` [PATCH 07/13] qemu: add a gettext-native dependency to gtk option Alexander Kanavin
2019-02-01 13:05 ` [PATCH 08/13] qemu: add a patch to avoid a missing definition error Alexander Kanavin
2019-02-01 13:05 ` [PATCH 09/13] qemu: add environment variable wrappers to make qemu look good with gtk frontend Alexander Kanavin
2019-02-01 13:05 ` Alexander Kanavin [this message]
2019-02-01 13:05 ` [PATCH 11/13] runqemu: add options for enabling virgl GL acceleration Alexander Kanavin
2019-02-01 13:05 ` [PATCH 12/13] runqemu: do not check for GL libraries Alexander Kanavin
2019-02-01 13:05 ` [PATCH 13/13] selftest: add tests for virgl GL acceleration Alexander Kanavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190201130554.90094-10-alex.kanavin@gmail.com \
--to=alex.kanavin@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox