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 10/12] runqemu: add options for enabling virgl GL acceleration
Date: Fri,  8 Feb 2019 15:45:51 +0100	[thread overview]
Message-ID: <b2a05ae940c4cc6f49374e23e4bac8f1ac21dae7.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>
---
 scripts/runqemu | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index c4a0ca811d9..50888a532e8 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -74,6 +74,9 @@ of the following environment variables (in any order):
   MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
   Simplified QEMU command-line options can be passed with:
     nographic - disable video console
+    gl - enable virgl-based GL acceleration
+    gl-es - enable virgl-based GL acceleration, using OpenGL ES
+    egl-headless - enable headless EGL output; use vnc or spice to see it
     serial - enable a serial console on /dev/ttyS0
     serialstdio - enable a serial console on the console (regardless of graphics mode)
     slirp - enable user networking, no root privileges is required
@@ -433,6 +436,26 @@ class BaseConfig(object):
             elif arg == 'nographic':
                 self.qemu_opt_script += ' -nographic'
                 self.kernel_cmdline_script += ' console=ttyS0'
+            elif arg == 'gl':
+                self.qemu_opt_script += ' -vga virtio -display gtk,gl=on'
+            elif arg == 'gl-es':
+                self.qemu_opt_script += ' -vga virtio -display gtk,gl=es'
+            elif arg == 'egl-headless':
+                self.qemu_opt_script += ' -vga virtio -display egl-headless'
+                # As runqemu can be run within bitbake (when using testimage, for example),
+                # we need to ensure that we run host pkg-config, and that it does not
+                # get mis-directed to native build paths set by bitbake.
+                try:
+                    del os.environ['PKG_CONFIG_PATH']
+                    del os.environ['PKG_CONFIG_DIR']
+                    del os.environ['PKG_CONFIG_LIBDIR']
+                except KeyError:
+                    pass
+                try:
+                    dripath = subprocess.check_output("PATH=/bin:/usr/bin:$PATH pkg-config --variable=dridriverdir dri", shell=True)
+                except subprocess.CalledProcessError as e:
+                    raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.")
+                os.environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip()
             elif arg == 'serial':
                 self.kernel_cmdline_script += ' console=ttyS0'
                 self.serialconsole = True
-- 
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 ` [PATCH 09/12] qemu: add a backported patch to fix egl-headless support Alexander Kanavin
2019-02-08 14:45 ` Alexander Kanavin [this message]
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 10/12] runqemu: add options for enabling 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=b2a05ae940c4cc6f49374e23e4bac8f1ac21dae7.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.