qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "David Airlie" <airlied@linux.ie>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 02/11] sdl2: stop flickering
Date: Thu, 24 Sep 2015 11:04:53 +0200	[thread overview]
Message-ID: <1443085502-596-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1443085502-596-1-git-send-email-kraxel@redhat.com>

Optimizing updates by copying the dirty rectangle
only do not work because of double-buffering.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
 ui/sdl2-2d.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c
index d0b340f..191ee3b 100644
--- a/ui/sdl2-2d.c
+++ b/ui/sdl2-2d.c
@@ -45,10 +45,23 @@ void sdl2_2d_update(DisplayChangeListener *dcl,
         return;
     }
 
+    /*
+     * SDL2 seems to do some double-buffering, and trying to only
+     * update the changed areas results in only one of the two buffers
+     * being updated.  Which flickers alot.  So lets not try to be
+     * clever do a full update every time ...
+     */
+#if 0
     rect.x = x;
     rect.y = y;
     rect.w = w;
     rect.h = h;
+#else
+    rect.x = 0;
+    rect.y = 0;
+    rect.w = surface_width(surf);
+    rect.h = surface_height(surf);
+#endif
 
     SDL_UpdateTexture(scon->texture, NULL, surface_data(surf),
                       surface_stride(surf));
-- 
1.8.3.1

  parent reply	other threads:[~2015-09-24  9:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  9:04 [Qemu-devel] [PATCH v2 00/11] add virgl rendering support Gerd Hoffmann
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 01/11] shaders: initialize vertexes once Gerd Hoffmann
2015-09-28 15:32   ` Max Reitz
2015-09-24  9:04 ` Gerd Hoffmann [this message]
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 03/11] ui/console: add opengl context and scanout support interfaces Gerd Hoffmann
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 04/11] virtio-gpu: move iov free to virtio_gpu_cleanup_mapping_iov Gerd Hoffmann
2015-09-24 10:16   ` Michael S. Tsirkin
2015-09-25 13:14     ` Gerd Hoffmann
2015-09-29 13:13       ` Michael S. Tsirkin
2015-09-28 15:46   ` Max Reitz
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 05/11] virtio-gpu: change licence from GPLv2 to GPLv2+ Gerd Hoffmann
2015-09-28 15:57   ` Max Reitz
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 06/11] virtio-gpu: update headers for virgl/3d Gerd Hoffmann
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 07/11] virtio-gpu: add 3d mode and virgl rendering support Gerd Hoffmann
2015-09-28 16:00   ` Max Reitz
2015-09-24  9:04 ` [Qemu-devel] [PATCH v2 08/11] sdl2/opengl: add opengl context and scanout support Gerd Hoffmann
2015-09-28 16:03   ` Max Reitz
2015-09-24  9:05 ` [Qemu-devel] [PATCH v2 09/11] opengl: add egl-context.[ch] helpers Gerd Hoffmann
2015-09-24  9:05 ` [Qemu-devel] [PATCH v2 10/11] gtk/opengl: add opengl context and scanout support (egl) Gerd Hoffmann
2015-09-24  9:05 ` [Qemu-devel] [PATCH v2 11/11] gtk/opengl: add opengl context and scanout support (GtkGLArea) Gerd Hoffmann
2015-09-24 17:09 ` [Qemu-devel] [PATCH v2 00/11] add virgl rendering support Marc-André Lureau
2015-09-25 13:30   ` Gerd Hoffmann
2015-09-28 16:07   ` Max Reitz
2015-09-29 12:46     ` Gerd Hoffmann

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=1443085502-596-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=marcandre.lureau@gmail.com \
    --cc=mreitz@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).