[Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.

Elie Tournier posted 2 patches 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180117145029.28736-1-tournier.elie@gmail.com
Test checkpatch failed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppc passed
Test s390x passed
There is a newer version of this series
include/sysemu/sysemu.h |  1 +
include/ui/sdl2.h       |  1 +
qemu-options.hx         |  5 ++++-
ui/sdl2-gl.c            |  8 ++++++--
ui/sdl2.c               |  8 ++++++++
vl.c                    | 12 +++++++++++-
6 files changed, 31 insertions(+), 4 deletions(-)
[Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Elie Tournier 7 years, 9 months ago
Hello everyone,

At Collabora, we are working on adding an OpenGL ES backend on virglrenderer [1].
I submit these patches as an RFC because our work didn't land in virglrenderer yet.
Currently, we support OpenGL ES 2.0 on the guest side and OpenGL ES 3.0 on the host side.
Our plan is to increase the guest support to OpenGL ES 3.0.
Thanks to this work, we are able to run QEMU on system that only support OpenGL ES.

In order to use this feature, we need to create a gles context.
This series add an option (`-display sdl,gles=on`) in the SDL display to create that context.

The source code is available on our gitlab instance.
For virglrenderer [2] and qemu [3].

Feel free to review/comment the series.

Have a nice day,
Elie

[1] https://cgit.freedesktop.org/virglrenderer
[2] https://gitlab.collabora.com/jakob/virglrenderer-gles/tree/hacks
[3] https://gitlab.collabora.com/elie/qemu/tree/gles-option

Elie Tournier (2):
  sdl2: Add gles options
  sdl2: gles option will create a gles context

 include/sysemu/sysemu.h |  1 +
 include/ui/sdl2.h       |  1 +
 qemu-options.hx         |  5 ++++-
 ui/sdl2-gl.c            |  8 ++++++--
 ui/sdl2.c               |  8 ++++++++
 vl.c                    | 12 +++++++++++-
 6 files changed, 31 insertions(+), 4 deletions(-)

-- 
2.15.1


Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by no-reply@patchew.org 7 years, 9 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180117145029.28736-1-tournier.elie@gmail.com
Subject: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180117145029.28736-1-tournier.elie@gmail.com -> patchew/20180117145029.28736-1-tournier.elie@gmail.com
Switched to a new branch 'test'
0e1d36af8a sdl2: gles option will create a gles context
b552b7e807 sdl2: Add gles options

=== OUTPUT BEGIN ===
Checking PATCH 1/2: sdl2: Add gles options...
Checking PATCH 2/2: sdl2: gles option will create a gles context...
ERROR: braces {} are necessary for all arms of this statement
#45: FILE: ui/sdl2-gl.c:145:
+    if (scon->opengl_es)
[...]
+    else
[...]

total: 1 errors, 0 warnings, 60 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Elie Tournier 7 years, 8 months ago
On Wed, Jan 17, 2018 at 02:50:27PM +0000, Elie Tournier wrote:
> Hello everyone,
> 
> At Collabora, we are working on adding an OpenGL ES backend on virglrenderer [1].
> I submit these patches as an RFC because our work didn't land in virglrenderer yet.
> Currently, we support OpenGL ES 2.0 on the guest side and OpenGL ES 3.0 on the host side.
> Our plan is to increase the guest support to OpenGL ES 3.0.
> Thanks to this work, we are able to run QEMU on system that only support OpenGL ES.
> 
> In order to use this feature, we need to create a gles context.
> This series add an option (`-display sdl,gles=on`) in the SDL display to create that context.
> 
> The source code is available on our gitlab instance.
> For virglrenderer [2] and qemu [3].
> 
> Feel free to review/comment the series.

Hello,

Humble ping.
I didn't get any comment on this series.
Are you interested by running QEMU on systems that only support OpenGL ES?
If yes, did I proceed correctly?

> 
> Have a nice day,
> Elie
> 
> [1] https://cgit.freedesktop.org/virglrenderer
> [2] https://gitlab.collabora.com/jakob/virglrenderer-gles/tree/hacks
> [3] https://gitlab.collabora.com/elie/qemu/tree/gles-option
> 
> Elie Tournier (2):
>   sdl2: Add gles options
>   sdl2: gles option will create a gles context
> 
>  include/sysemu/sysemu.h |  1 +
>  include/ui/sdl2.h       |  1 +
>  qemu-options.hx         |  5 ++++-
>  ui/sdl2-gl.c            |  8 ++++++--
>  ui/sdl2.c               |  8 ++++++++
>  vl.c                    | 12 +++++++++++-
>  6 files changed, 31 insertions(+), 4 deletions(-)
> 
> -- 
> 2.15.1
> 

Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Gerd Hoffmann 7 years, 8 months ago
  Hi,

> > In order to use this feature, we need to create a gles context.
> > This series add an option (`-display sdl,gles=on`) in the SDL display to create that context.
> 
> Humble ping.
> I didn't get any comment on this series.

Well, display configuration is going to be rewritten, and while that is
in flight adding new config options isn't a good idea b/c things will
conflict ...

Beside that:  Is a new config option actually needed in the first place?

Ideally qemu (or sdl) would figure on its own that a full core context
isn't available and try fallback to gles then.

cheers,
  Gerd


Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Elie Tournier 7 years, 8 months ago
On Mon, Jan 29, 2018 at 07:08:30PM +0100, Gerd Hoffmann wrote:
Hello,

First, thanks for your reply.
I added some comments and questions below.

Cheers,
Elie

>   Hi,
> 
> > > In order to use this feature, we need to create a gles context.
> > > This series add an option (`-display sdl,gles=on`) in the SDL display to create that context.
> > 
> > Humble ping.
> > I didn't get any comment on this series.
> 
> Well, display configuration is going to be rewritten, and while that is
> in flight adding new config options isn't a good idea b/c things will
> conflict ...
I'm wondering how extensive this rewrite is going to be. Did you plan to modify the qemu interface?
If someone already start working on this task, can you send me the link to the repository?
I will be happy to help if needed.
> 
> Beside that:  Is a new config option actually needed in the first place?
> 
> Ideally qemu (or sdl) would figure on its own that a full core context
> isn't available and try fallback to gles then.
I'm fine with this idea.
However, I think we still need to add a way to the user to choose the backend he want.
> 
> cheers,
>   Gerd
> 

Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Gerd Hoffmann 7 years, 8 months ago
  Hi,

> > Well, display configuration is going to be rewritten, and while that is
> > in flight adding new config options isn't a good idea b/c things will
> > conflict ...
> I'm wondering how extensive this rewrite is going to be. Did you plan to modify the qemu interface?
> If someone already start working on this task, can you send me the link to the repository?
> I will be happy to help if needed.

https://www.kraxel.org/cgit/qemu/log/?h=sirius/display-cmdline

> > Beside that:  Is a new config option actually needed in the first place?
> > 
> > Ideally qemu (or sdl) would figure on its own that a full core context
> > isn't available and try fallback to gles then.
> I'm fine with this idea.
> However, I think we still need to add a way to the user to choose the backend he want.

Changing gl from bool to multiple choice looks more useful to me then,
i.e. have "gl={on,core,gles,off}", where "on" automatically picks "core"
or "gles" depending on what is available.

What is the status of the virglrenderer patches btw?

cheers,
  Gerd


Re: [Qemu-devel] [RFC 0/2] Use SDL to create an OpenGL ES context for virglrenderer.
Posted by Elie Tournier 7 years, 8 months ago
On Tue, Jan 30, 2018 at 04:22:33PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > > Well, display configuration is going to be rewritten, and while that is
> > > in flight adding new config options isn't a good idea b/c things will
> > > conflict ...
> > I'm wondering how extensive this rewrite is going to be. Did you plan to modify the qemu interface?
> > If someone already start working on this task, can you send me the link to the repository?
> > I will be happy to help if needed.
> 
> https://www.kraxel.org/cgit/qemu/log/?h=sirius/display-cmdline
Awesome, thanks. I will definitely have a look to it.
> 
> > > Beside that:  Is a new config option actually needed in the first place?
> > > 
> > > Ideally qemu (or sdl) would figure on its own that a full core context
> > > isn't available and try fallback to gles then.
> > I'm fine with this idea.
> > However, I think we still need to add a way to the user to choose the backend he want.
> 
> Changing gl from bool to multiple choice looks more useful to me then,
> i.e. have "gl={on,core,gles,off}", where "on" automatically picks "core"
> or "gles" depending on what is available.
I like that solution. ;). I will implement it on top of your work.
> 
> What is the status of the virglrenderer patches btw?
We keep upstreaming no invasive patches.
But with upstream virglrenderer, you will not be able to use a gles backend.
If you want to know more about the current status of the project, you can have a look to our repo [1].

Currently, we are working through bugs, cleaning up the remaing patches.
Our short term goal is to pass the GLES2 CTS [2] in the guest side.

Regards,
Elie

[1] https://gitlab.collabora.com/jakob/virglrenderer-gles/tree/hacks
[2] https://github.com/KhronosGroup/VK-GL-CTS
> 
> cheers,
>   Gerd
>