All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 09/12] qemu: add a backported patch to fix egl-headless support
Date: Fri,  8 Feb 2019 15:45:50 +0100	[thread overview]
Message-ID: <23429716ca07a990ca4189e1f4c2cac84f996f71.1549637121.git.alex.kanavin@gmail.com> (raw)
In-Reply-To: <cover.1549637121.git.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



  parent reply	other threads:[~2019-02-08 14:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 14:45 [PATCH 00/12] Enable accelerated OpenGL in qemu Alexander Kanavin
2019-02-08 14:45 ` [PATCH 01/12] virglrenderer: add a recipe Alexander Kanavin
2019-02-09  9:44   ` Martin Jansa
2019-02-09 10:06     ` Alexander Kanavin
2019-02-09 13:19       ` Martin Jansa
2019-02-09 16:43         ` Alexander Kanavin
2019-02-09 17:09           ` Martin Jansa
2019-02-09 17:16             ` Alexander Kanavin
2019-02-09 17:23         ` Khem Raj
2019-02-11 15:24           ` Khem Raj
2019-02-12 11:33             ` Alexander Kanavin
2019-02-08 14:45 ` [PATCH 02/12] qemu: enable virglrenderer and glx options for native/nativesdk builds Alexander Kanavin
2019-02-08 23:12   ` Martin Jansa
2019-02-08 23:32     ` Alexander Kanavin
2019-02-09  9:32       ` Martin Jansa
2019-02-09 10:04         ` Alexander Kanavin
2019-02-08 14:45 ` [PATCH 03/12] local.conf.sample: adjust the qemu config to enable gtk+ instead of sdl Alexander Kanavin
2019-02-08 14:45 ` [PATCH 04/12] qemu: build target variant with gtk+, and nativesdk variant without sdl Alexander Kanavin
2019-02-08 15:31   ` Mark Hatle
2019-02-08 15:43     ` Alexander Kanavin
2019-02-08 15:55       ` Mark Hatle
2019-02-08 15:58         ` Alexander Kanavin
2019-02-12 10:20           ` Mark Hatle
2019-02-12 10:58             ` Alexander Kanavin
2019-02-08 14:45 ` [PATCH 05/12] qemu: remove support for building against host sdl Alexander Kanavin
2019-02-08 14:45 ` [PATCH 06/12] qemu: add a gettext-native dependency to gtk option Alexander Kanavin
2019-02-08 14:45 ` [PATCH 07/12] qemu: add a patch to avoid a missing definition error Alexander Kanavin
2019-02-08 14:45 ` [PATCH 08/12] qemu: add environment variable wrappers to make qemu look good with gtk frontend Alexander Kanavin
2019-02-08 14:45 ` Alexander Kanavin [this message]
2019-02-08 14:45 ` [PATCH 10/12] runqemu: add options for enabling virgl GL acceleration Alexander Kanavin
2019-02-08 14:45 ` [PATCH 11/12] runqemu: do not check for GL libraries Alexander Kanavin
2019-02-08 14:45 ` [PATCH 12/12] selftest: add tests for virgl GL acceleration Alexander Kanavin
2019-02-22 14:33 [PATCH 00/12] Enable accelerated OpenGL in qemu Alexander Kanavin
2019-02-22 14:33 ` [PATCH 09/12] qemu: add a backported patch to fix egl-headless support 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=23429716ca07a990ca4189e1f4c2cac84f996f71.1549637121.git.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.