[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 01/10] ui/sdl2: Restore original context after new context cre
From: |
Dmitry Osipenko |
Subject: |
[PATCH v6 01/10] ui/sdl2: Restore original context after new context creation |
Date: |
Sun, 26 Jan 2025 23:11:12 +0300 |
SDL API changes GL context to a newly created GL context, which differs
from other GL providers that don't switch context. Change SDL backend to
restore the original GL context. This allows Qemu's virtio-gpu to support
new virglrenderer async-fencing feature for Virgl contexts, otherwise
virglrenderer's vrend creates a fence-sync context on the Qemu's
main-loop thread that erroneously stays in-use by the main-loop after
creation, not allowing vrend's fence-sync thread switch to this new
context that belongs to it.
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
ui/sdl2-gl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index e01d9ab0c7bf..b1fe96d6af22 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -168,6 +168,9 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
SDL_GL_CONTEXT_PROFILE_ES);
ctx = SDL_GL_CreateContext(scon->real_window);
}
+
+ SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
+
return (QEMUGLContext)ctx;
}
--
2.47.1
- [PATCH v6 00/10] Support virtio-gpu DRM native context, Dmitry Osipenko, 2025/01/26
- [PATCH v6 01/10] ui/sdl2: Restore original context after new context creation,
Dmitry Osipenko <=
- [PATCH v6 02/10] ui/sdl2: Implement dpy dmabuf functions, Dmitry Osipenko, 2025/01/26
- [PATCH v6 03/10] virtio-gpu: Handle virgl fence creation errors, Dmitry Osipenko, 2025/01/26
- [PATCH v6 04/10] virtio-gpu: Support asynchronous fencing, Dmitry Osipenko, 2025/01/26
- [PATCH v6 05/10] virtio-gpu: Support DRM native context, Dmitry Osipenko, 2025/01/26
- [PATCH v6 06/10] ui/sdl2: Don't disable scanout when display is refreshed, Dmitry Osipenko, 2025/01/26
- [PATCH v6 07/10] ui/gtk: Don't disable scanout when display is refreshed, Dmitry Osipenko, 2025/01/26
- [PATCH v6 08/10] docs/system: virtio-gpu: Add link to Mesa VirGL doc, Dmitry Osipenko, 2025/01/26
- [PATCH v6 09/10] docs/system: virtio-gpu: Update Venus link, Dmitry Osipenko, 2025/01/26
- [PATCH v6 10/10] docs/system: virtio-gpu: Document host/guest requirements, Dmitry Osipenko, 2025/01/26