ui/egl: export qemu_egl_get_error_string()
It will be used from other units. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-2-marcandre.lureau@redhat.com>
This commit is contained in:
parent
2fc280734a
commit
044ca4bf45
|
@ -67,4 +67,6 @@ bool qemu_egl_has_dmabuf(void);
|
||||||
|
|
||||||
bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp);
|
bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp);
|
||||||
|
|
||||||
|
const char *qemu_egl_get_error_string(void);
|
||||||
|
|
||||||
#endif /* EGL_HELPERS_H */
|
#endif /* EGL_HELPERS_H */
|
||||||
|
|
|
@ -28,8 +28,7 @@ DisplayGLMode qemu_egl_mode;
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if defined(CONFIG_X11) || defined(CONFIG_GBM)
|
const char *qemu_egl_get_error_string(void)
|
||||||
static const char *egl_get_error_string(void)
|
|
||||||
{
|
{
|
||||||
EGLint error = eglGetError();
|
EGLint error = eglGetError();
|
||||||
|
|
||||||
|
@ -68,7 +67,6 @@ static const char *egl_get_error_string(void)
|
||||||
return "Unknown EGL error";
|
return "Unknown EGL error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void egl_fb_delete_texture(egl_fb *fb)
|
static void egl_fb_delete_texture(egl_fb *fb)
|
||||||
{
|
{
|
||||||
|
@ -480,20 +478,20 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
|
||||||
|
|
||||||
qemu_egl_display = qemu_egl_get_display(dpy, platform);
|
qemu_egl_display = qemu_egl_get_display(dpy, platform);
|
||||||
if (qemu_egl_display == EGL_NO_DISPLAY) {
|
if (qemu_egl_display == EGL_NO_DISPLAY) {
|
||||||
error_report("egl: eglGetDisplay failed: %s", egl_get_error_string());
|
error_report("egl: eglGetDisplay failed: %s", qemu_egl_get_error_string());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
b = eglInitialize(qemu_egl_display, &major, &minor);
|
b = eglInitialize(qemu_egl_display, &major, &minor);
|
||||||
if (b == EGL_FALSE) {
|
if (b == EGL_FALSE) {
|
||||||
error_report("egl: eglInitialize failed: %s", egl_get_error_string());
|
error_report("egl: eglInitialize failed: %s", qemu_egl_get_error_string());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
b = eglBindAPI(gles ? EGL_OPENGL_ES_API : EGL_OPENGL_API);
|
b = eglBindAPI(gles ? EGL_OPENGL_ES_API : EGL_OPENGL_API);
|
||||||
if (b == EGL_FALSE) {
|
if (b == EGL_FALSE) {
|
||||||
error_report("egl: eglBindAPI failed (%s mode): %s",
|
error_report("egl: eglBindAPI failed (%s mode): %s",
|
||||||
gles ? "gles" : "core", egl_get_error_string());
|
gles ? "gles" : "core", qemu_egl_get_error_string());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,7 +500,7 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
|
||||||
&qemu_egl_config, 1, &n);
|
&qemu_egl_config, 1, &n);
|
||||||
if (b == EGL_FALSE || n != 1) {
|
if (b == EGL_FALSE || n != 1) {
|
||||||
error_report("egl: eglChooseConfig failed (%s mode): %s",
|
error_report("egl: eglChooseConfig failed (%s mode): %s",
|
||||||
gles ? "gles" : "core", egl_get_error_string());
|
gles ? "gles" : "core", qemu_egl_get_error_string());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue