Skip to contentSkip to conversation

sdl2: redraw correctly when scanout_mode enabled.

PATCH In review Tao Wu 2 participants 3 messages Jul 26, 2018 – Aug 21, 2018

lore
Share & tools
lore

Tao Wu

author
#0 lore raw

PATCH 1/1 sdl2: redraw correctly when scanout_mode enabled.

When scanout_mode enabled, surface is out of sync with actual screen. In such case, we just call sdl2_gl_scanout_flush to do redraw. This fixes bug reported in
https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/001330.html

---
 ui/sdl2-gl.c | 5 +++++
 1 file changed, 5 insertions(+)
ui/sdl2-gl.c +5 -0
index 83b71853d1..1bf4542d8d 100644
@@ -124,6 +124,11 @@ void sdl2_gl_redraw(struct sdl2_console *scon)
 {
     assert(scon->opengl);
 
+    if (scon->scanout_mode) {
+        /* sdl2_gl_scanout_flush actually only care about
+         * the first argument. */
+        return sdl2_gl_scanout_flush(&scon->dcl, 0, 0, 0, 0);
+    }
     if (scon->surface) {
         sdl2_gl_render_surface(scon);
     }
Signature · 1 line
2.18.0.345.g5c9ce644c3-goog
#1 lore raw
Quoted 28 lines · Tao Wu

When scanout_mode enabled, surface is out of sync with actual screen. In such case, we just call sdl2_gl_scanout_flush to do redraw. This fixes bug reported in
https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/001330.html

---
 ui/sdl2-gl.c | 5 +++++
 1 file changed, 5 insertions(+)
ui/sdl2-gl.c +5 -1
index 83b71853d1..1bf4542d8d 100644
@@ -124,6 +124,11 @@ void sdl2_gl_redraw(struct sdl2_console *scon)
 {
     assert(scon->opengl);
 
+    if (scon->scanout_mode) {
+        /* sdl2_gl_scanout_flush actually only care about
+         * the first argument. */
+        return sdl2_gl_scanout_flush(&scon->dcl, 0, 0, 0, 0);
+    }
     if (scon->surface) {
         sdl2_gl_render_surface(scon);
     }
--
Quoted 2 lines

2.18.0.345.g5c9ce644c3-goog

Ping, thanks!