diff -Nru ../orig/qemu-8.2.1/include/ui/egl-helpers.h ./include/ui/egl-helpers.h --- ../orig/qemu-8.2.1/include/ui/egl-helpers.h +++ ./include/ui/egl-helpers.h @@ -2,7 +2,15 @@ #define EGL_HELPERS_H #include +#ifdef CONFIG_EGL #include +#else +typedef int EGLConfig; +typedef int EGLContext; +typedef int EGLDisplay; +typedef int EGLNativeWindowType; +typedef int EGLSurface; +#endif #ifdef CONFIG_GBM #include #endif diff -Nru ../orig/qemu-8.2.1/meson.build ./meson.build --- ../orig/qemu-8.2.1/meson.build +++ ./meson.build @@ -1431,12 +1431,14 @@ required: get_option('coreaudio')) endif +egl = not_found opengl = not_found if not get_option('opengl').auto() or have_system or have_vhost_user_gpu epoxy = dependency('epoxy', method: 'pkg-config', required: get_option('opengl')) + opengl = epoxy if cc.has_header('epoxy/egl.h', dependencies: epoxy) - opengl = epoxy + egl = epoxy elif get_option('opengl').enabled() error('epoxy/egl.h not found') endif @@ -2122,6 +2124,7 @@ endif config_host_data.set('CONFIG_CURL', curl.found()) config_host_data.set('CONFIG_CURSES', curses.found()) +config_host_data.set('CONFIG_EGL', egl.found()) config_host_data.set('CONFIG_GBM', gbm.found()) config_host_data.set('CONFIG_GIO', gio.found()) config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found()) @@ -4369,6 +4372,7 @@ summary_info += {'libusb': libusb} summary_info += {'usb net redir': usbredir} summary_info += {'OpenGL support (epoxy)': opengl} +summary_info += {'EGL': egl} summary_info += {'GBM': gbm} summary_info += {'libiscsi support': libiscsi} summary_info += {'libnfs support': libnfs} diff -Nru ../orig/qemu-8.2.1/ui/egl-helpers.c ./ui/egl-helpers.c --- ../orig/qemu-8.2.1/ui/egl-helpers.c +++ ./ui/egl-helpers.c @@ -33,6 +33,7 @@ const char *qemu_egl_get_error_string(void) { +#ifdef CONFIG_EGL EGLint error = eglGetError(); switch (error) { @@ -69,6 +70,9 @@ default: return "Unknown EGL error"; } +#else + return "Unknown error"; +#endif //CONFIG_EGL } static void egl_fb_delete_texture(egl_fb *fb) @@ -394,6 +398,8 @@ /* ---------------------------------------------------------------------- */ +#ifdef CONFIG_EGL + EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win) { EGLSurface esurface; @@ -661,3 +667,5 @@ display_opengl = 1; return true; } + +#endif //#ifdef CONFIG_EGL diff -Nru ../orig/qemu-8.2.1/ui/meson.build ./ui/meson.build --- ../orig/qemu-8.2.1/ui/meson.build +++ ./ui/meson.build @@ -62,13 +62,15 @@ opengl_ss = ss.source_set() opengl_ss.add(gbm, pixman) opengl_ss.add(when: [opengl], - if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) + if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c')) + opengl_ss.add(when: [opengl, egl], + if_true: files('egl-context.c')) ui_modules += {'opengl' : opengl_ss} endif if opengl.found() egl_headless_ss = ss.source_set() - egl_headless_ss.add(when: [opengl, pixman], + egl_headless_ss.add(when: [opengl, egl, pixman], if_true: [files('egl-headless.c'), gbm]) ui_modules += {'egl-headless' : egl_headless_ss} endif @@ -114,8 +116,8 @@ gtk_ss.add(files('gtk-clipboard.c')) endif gtk_ss.add(when: x11, if_true: files('x_keymap.c')) - gtk_ss.add(when: opengl, if_true: files('gtk-gl-area.c')) - gtk_ss.add(when: [x11, opengl], if_true: files('gtk-egl.c')) + gtk_ss.add(when: [opengl, egl], if_true: files('gtk-gl-area.c')) + gtk_ss.add(when: [x11, opengl, egl], if_true: files('gtk-egl.c')) ui_modules += {'gtk' : gtk_ss} endif