diff mbox series

sdl2: redraw correctly when scanout_mode enabled.

Message ID 20180726225900.180698-1-lepton@google.com (mailing list archive)
State New, archived
Headers show
Series sdl2: redraw correctly when scanout_mode enabled. | expand

Commit Message

Zhijian Li (Fujitsu)" via July 26, 2018, 10:59 p.m. UTC
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

Signed-off-by: Tao Wu <lepton@google.com>
---
 ui/sdl2-gl.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Zhijian Li (Fujitsu)" via Aug. 1, 2018, 11:49 p.m. UTC | #1
On Fri, Jul 27, 2018 at 6:59 AM Tao Wu <lepton@google.com> wrote:
>
> 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
>
> Signed-off-by: Tao Wu <lepton@google.com>
> ---
>  ui/sdl2-gl.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
> index 83b71853d1..1bf4542d8d 100644
> --- a/ui/sdl2-gl.c
> +++ b/ui/sdl2-gl.c
> @@ -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);
>      }
> --
> 2.18.0.345.g5c9ce644c3-goog
>
Ping, thanks!
Gerd Hoffmann Aug. 21, 2018, 5:42 a.m. UTC | #2
On Thu, Jul 26, 2018 at 03:59:00PM -0700, Tao Wu wrote:
> 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

Added to ui queue.

thanks,
  Gerd
diff mbox series

Patch

diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 83b71853d1..1bf4542d8d 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -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);
     }