From: Marc-André Lureau <[email protected]>
Fix SDL backend compilation for win32.
Fixes: commit 31287d1af4 ("ui/sdl2: Implement dpy dmabuf functions")
Signed-off-by: Marc-André Lureau <[email protected]>
---
ui/sdl2-gl.c | 2 ++
ui/sdl2.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 31f8fbe032..6bceeed565 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -251,6 +251,7 @@ void sdl2_gl_scanout_flush(DisplayChangeListener *dcl,
SDL_GL_SwapWindow(scon->real_window);
}
+#ifdef CONFIG_GBM
void sdl2_gl_scanout_dmabuf(DisplayChangeListener *dcl,
QemuDmaBuf *dmabuf)
{
@@ -312,3 +313,4 @@ void sdl2_gl_console_init(struct sdl2_console *scon)
scon->surface = NULL;
scon->hidden = hidden;
}
+#endif /* CONFIG_GBM */
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 9439745443..8c9df23343 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -806,9 +806,11 @@ static const DisplayChangeListenerOps dcl_gl_ops = {
.dpy_gl_scanout_texture = sdl2_gl_scanout_texture,
.dpy_gl_update = sdl2_gl_scanout_flush,
+#ifdef CONFIG_GBM
.dpy_gl_scanout_dmabuf = sdl2_gl_scanout_dmabuf,
.dpy_gl_release_dmabuf = sdl2_gl_release_dmabuf,
.dpy_has_dmabuf = sdl2_gl_has_dmabuf,
+#endif
};
static bool
@@ -939,7 +941,9 @@ static void sdl2_display_init(DisplayState *ds,
DisplayOptions *o)
sdl2_console[i].kbd = qkbd_state_init(con);
if (display_opengl) {
qemu_console_set_display_gl_ctx(con, &sdl2_console[i].dgc);
+#ifdef CONFIG_GBM
sdl2_gl_console_init(&sdl2_console[i]);
+#endif
}
register_displaychangelistener(&sdl2_console[i].dcl);
--
2.47.0