ui/sdl2.c | 2 ++ 1 file changed, 2 insertions(+)
From abfc1a95936dd832fc2ad9d64d4e3f3880c697e1 Mon Sep 17 00:00:00 2001
From: Ryan Zhang mailto:ryan.zhang@nxp.com
Date: Fri, 15 May 2026 19:21:55 +0800
Subject: [PATCH] ui/sdl2: Set GL ES profile before creating initial GL context
When the user selects GLES via '-display sdl,gl=es', we need to set
SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_ES before
calling SDL_GL_CreateContext(). This ensures SDL_GL_LoadLibrary()
loads the correct GLES driver instead of the desktop OpenGL driver.
Fix the below issue: qemu-system-aarch64: /usr/src/debug/libepoxy
/1.5.10/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion
`0 && "Couldn't find current GLX or EGL context.\n"' failed.
sdl2_gl_create_context() already sets the profile mask correctly for
ES mode, but the initial context created in sdl2_window_create() is
missing the same treatment.
Fixes:da3f7a3ab9ea0091955b58f8909dfcee01f4043e ("ui/sdl: try to instantiate the matching opengl renderer")
Signed-off-by: Ryan Zhang mailto:ryan.zhang@nxp.com
---
ui/sdl2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 4fcdbd79d3..9f826afefb 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -113,6 +113,8 @@ void sdl2_window_create(struct sdl2_console *scon)
if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
driver = "opengles2";
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
+ SDL_GL_CONTEXT_PROFILE_ES);
}
SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver);
--
2.43.0
Hi Qemu developers,
Since this is my first time submitting a patch to QEMU upstream, I have a few questions I would like to ask. I would like to know how to check the status of the patch, such as whether it has been submitted successfully and whether it is under review. If there are any issues with this patch, please let me know. Thanks in advance.
Best Regards,
Ryan
-----Original Message-----
From: Ryan Zhang
Sent: Friday, May 15, 2026 8:32 PM
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com
Subject: [PATCH] ui/sdl2: Set GL ES profile before creating initial GL context
From abfc1a95936dd832fc2ad9d64d4e3f3880c697e1 Mon Sep 17 00:00:00 2001
From: Ryan Zhang mailto:ryan.zhang@nxp.com
Date: Fri, 15 May 2026 19:21:55 +0800
Subject: [PATCH] ui/sdl2: Set GL ES profile before creating initial GL context
When the user selects GLES via '-display sdl,gl=es', we need to set SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_ES before calling SDL_GL_CreateContext(). This ensures SDL_GL_LoadLibrary() loads the correct GLES driver instead of the desktop OpenGL driver.
Fix the below issue: qemu-system-aarch64: /usr/src/debug/libepoxy
/1.5.10/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion
`0 && "Couldn't find current GLX or EGL context.\n"' failed.
sdl2_gl_create_context() already sets the profile mask correctly for ES mode, but the initial context created in sdl2_window_create() is missing the same treatment.
Fixes:da3f7a3ab9ea0091955b58f8909dfcee01f4043e ("ui/sdl: try to instantiate the matching opengl renderer")
Signed-off-by: Ryan Zhang mailto:ryan.zhang@nxp.com
---
ui/sdl2.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 4fcdbd79d3..9f826afefb 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -113,6 +113,8 @@ void sdl2_window_create(struct sdl2_console *scon)
if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
driver = "opengles2";
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
+ SDL_GL_CONTEXT_PROFILE_ES);
}
SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver);
--
2.43.0
© 2016 - 2026 Red Hat, Inc.