From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 6/6] gtk-egl: add scanout_disable support
Date: Tue, 21 Feb 2017 10:37:21 +0100 [thread overview]
Message-ID: <1487669841-13668-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1487669841-13668-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/gtk.h | 1 +
ui/gtk-egl.c | 15 ++++++++++-----
ui/gtk.c | 1 +
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 408e21b..ca9a226 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -103,6 +103,7 @@ void gd_egl_switch(DisplayChangeListener *dcl,
DisplaySurface *surface);
QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
QEMUGLParams *params);
+void gd_egl_scanout_disable(DisplayChangeListener *dcl);
void gd_egl_scanout_texture(DisplayChangeListener *dcl,
uint32_t backing_id,
bool backing_y_0_top,
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index d5541c3..d53288f 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -170,6 +170,16 @@ QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
return qemu_egl_create_context(dcl, params);
}
+void gd_egl_scanout_disable(DisplayChangeListener *dcl)
+{
+ VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+
+ vc->gfx.w = 0;
+ vc->gfx.h = 0;
+ vc->gfx.tex_id = 0;
+ gtk_egl_set_scanout_mode(vc, false);
+}
+
void gd_egl_scanout_texture(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
uint32_t backing_width, uint32_t backing_height,
@@ -188,11 +198,6 @@ void gd_egl_scanout_texture(DisplayChangeListener *dcl,
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, vc->gfx.ectx);
- if (vc->gfx.tex_id == 0 || vc->gfx.w == 0 || vc->gfx.h == 0) {
- gtk_egl_set_scanout_mode(vc, false);
- return;
- }
-
gtk_egl_set_scanout_mode(vc, true);
if (!vc->gfx.fbo_id) {
glGenFramebuffers(1, &vc->gfx.fbo_id);
diff --git a/ui/gtk.c b/ui/gtk.c
index 1dd0b53..640ff84 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -688,6 +688,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {
.dpy_gl_ctx_destroy = qemu_egl_destroy_context,
.dpy_gl_ctx_make_current = gd_egl_make_current,
.dpy_gl_ctx_get_current = qemu_egl_get_current_context,
+ .dpy_gl_scanout_disable = gd_egl_scanout_disable,
.dpy_gl_scanout_texture = gd_egl_scanout_texture,
.dpy_gl_update = gd_egl_scanout_flush,
};
--
1.8.3.1
next prev parent reply other threads:[~2017-02-21 9:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 9:37 [Qemu-devel] [PATCH 0/6] ui: some gl scanout improvements Gerd Hoffmann
2017-02-21 9:37 ` [Qemu-devel] [PATCH 1/6] console: rename dpy_gl_scanout to dpy_gl_scanout_texture Gerd Hoffmann
2017-02-21 9:37 ` [Qemu-devel] [PATCH 2/6] console: add dpy_gl_scanout_disable Gerd Hoffmann
2017-02-21 9:37 ` [Qemu-devel] [PATCH 3/6] virtio-gpu: use dpy_gl_scanout_disable Gerd Hoffmann
2017-02-21 9:37 ` [Qemu-devel] [PATCH 4/6] spice: add scanout_disable support Gerd Hoffmann
2017-02-21 9:37 ` [Qemu-devel] [PATCH 5/6] sdl2: " Gerd Hoffmann
2017-02-21 9:37 ` Gerd Hoffmann [this message]
2017-02-21 10:31 ` [Qemu-devel] [PATCH 0/6] ui: some gl scanout improvements Marc-André Lureau
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=1487669841-13668-7-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).