From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv43e-0004ie-NR for qemu-devel@nongnu.org; Wed, 20 May 2015 09:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv43b-0001Ic-2C for qemu-devel@nongnu.org; Wed, 20 May 2015 09:29:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv43a-0001IU-QV for qemu-devel@nongnu.org; Wed, 20 May 2015 09:29:11 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4KDT977020217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 20 May 2015 09:29:09 -0400 Message-ID: <555C8C21.90205@redhat.com> Date: Wed, 20 May 2015 15:29:05 +0200 From: Max Reitz MIME-Version: 1.0 References: <1432045761-15543-1-git-send-email-kraxel@redhat.com> <1432045761-15543-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1432045761-15543-5-git-send-email-kraxel@redhat.com> Content-Type: multipart/alternative; boundary="------------090706060601090303070600" Subject: Re: [Qemu-devel] [PATCH 4/4] gtk: add opengl support, using egl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Cc: Paolo Bonzini This is a multi-part message in MIME format. --------------090706060601090303070600 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id t4KDT977020217 On 19.05.2015 16:29, Gerd Hoffmann wrote: > This adds opengl rendering support to the gtk ui, using egl. > It's off by default for now, use 'qemu -display gtk,gl=3Don' > to play with this. > > Note that gtk got native opengl support with release 3.16. > There most likely will be a separate implementation for 3.16+, > using the native gtk opengl support. This patch covers older > versions (and for the time being 3.16 too, hopefully without > rendering quirks). > > Signed-off-by: Gerd Hoffmann > --- > include/ui/console.h | 2 +- > include/ui/gtk.h | 23 +++++++++ > ui/Makefile.objs | 3 ++ > ui/gtk-egl.c | 141 ++++++++++++++++++++++++++++++++++++++++++= +++++++++ > ui/gtk.c | 77 ++++++++++++++++++++++------ > vl.c | 11 +++- > 6 files changed, 240 insertions(+), 17 deletions(-) > create mode 100644 ui/gtk-egl.c I can't give any R-b, because that would require really digging into=20 Gtk... The code is pretty similar to the SDL code, though (not by chance=20 I guess), so it looks fine to me. If it would compile, that is, see below. (It does work with Gtk 2, though) ((at least on my laptop with mesa; on my desktop with fglrx, creating=20 the shader fails, which may or may not have to do something with "libEGL=20 warning: DRI2: failed to authenticate" (which is probably in turn my own=20 fault for using a proprietary driver))) Konsole output [snip] > diff --git a/ui/gtk.c b/ui/gtk.c > index c58028f..bf66014 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c [snip] > @@ -1713,7 +1737,16 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s= , VirtualConsole *vc, > gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), > vc->tab_item, gtk_label_new(vc->label)); > =20 > - vc->gfx.dcl.ops =3D &dcl_ops; > +#if defined(CONFIG_OPENGL) > + if (display_opengl) { > + gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE); gcc said: > Konsole output qemu/ui/gtk.c:1742:9: Fehler:=20 =BBgtk_widget_set_double_buffered=AB is deprecated (declared at=20 /usr/include/gtk-3.0/gtk/gtkwidget.h:896) [-Werror=3Ddeprecated-declarati= ons] (yes, the mix of German and English is gcc's doing) But then again it didn't compile before, either: qemu/ui/gtk.c:1927:5:=20 Fehler: =BBgdk_cursor_new=AB is deprecated (declared at=20 /usr/include/gtk-3.0/gdk/gdkcursor.h:223) [-Werror=3Ddeprecated-declarati= ons] But that function was deprecated in 3.16,=20 gtk_widget_set_double_buffered() was deprecated in 3.14 already (as far=20 as I can see from the header file alone). Max --------------090706060601090303070600 Content-Type: text/html; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id t4KDT977020217
On 19.05.2015 16:29, Gerd Hoffmann wrote:
This adds opengl rendering support to the gtk ui, us=
ing egl.
It's off by default for now, use 'qemu -display gtk,gl=3Don'
to play with this.

Note that gtk got native opengl support with release 3.16.
There most likely will be a separate implementation for 3.16+,
using the native gtk opengl support.  This patch covers older
versions (and for the time being 3.16 too, hopefully without
rendering quirks).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h |   2 +-
 include/ui/gtk.h     |  23 +++++++++
 ui/Makefile.objs     |   3 ++
 ui/gtk-egl.c         | 141 +++++++++++++++++++++++++++++++++++++++++++++=
++++++
 ui/gtk.c             |  77 ++++++++++++++++++++++------
 vl.c                 |  11 +++-
 6 files changed, 240 insertions(+), 17 deletions(-)
 create mode 100644 ui/gtk-egl.c

I can't give any R-b, because that would require really digging into Gtk... The code is pretty similar to the SDL code, though (not by chance I guess), so it looks fine to me. If it would compile, that is, see below.

(It does work with Gtk 2, though)

((at least on my laptop with mesa; on my desktop with fglrx, creating the shader fails, which may or may not have to do something with "libEGL warning: DRI2: failed to authenticate" (which is probably in turn my own fault for using a proprietary driver))) Konsole output

[snip]

diff --git a/ui/gtk.c b/ui/gtk.c
index c58028f..bf66014 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c

[snip]

@@ -1713,7 +1737,16 @@ static GSList *gd_vc_gfx_init=
(GtkDisplayState *s, VirtualConsole *vc,
     gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook),
                              vc->tab_item, gtk_label_new(vc->label=
));
=20
-    vc->gfx.dcl.ops =3D &dcl_ops;
+#if defined(CONFIG_OPENGL)
+    if (display_opengl) {
+        gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE);<=
/pre>
    

gcc said:
> Konsole output qemu/ui/gtk.c:1742:9: Fehler: =BBgtk_widget_set_double_buffered=AB is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkwidget.h:896) [-Werror=3Ddeprecated-declarations]

(yes, the mix of German and English is gcc's doing)

But then again it didn't compile before, either: qemu/ui/gtk.c:1927:5: Fehler: =BBgdk_cursor_new=AB is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:223) [-Werror=3Ddeprecated-declarations]

But that function was deprecated in 3.16, gtk_widget_set_double_buffered() was deprecated in 3.14 already (as far as I can see from the header file alone).

Max
--------------090706060601090303070600--