Skip to content

Commit 154fd4d

Browse files
author
Markus Armbruster
committed
qapi/ui: Drop temporary 'prefix'
Recent commit "qapi: Smarter camel_to_upper() to reduce need for 'prefix'" added a temporary 'prefix' to delay changing the generated code. Revert it. This improves DisplayGLMode's generated enumeration constant prefix from DISPLAYGL_MODE to DISPLAY_GL_MODE. Signed-off-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]>
1 parent 0aa4bd6 commit 154fd4d

File tree

10 files changed

+21
-22
lines changed

10 files changed

+21
-22
lines changed

qapi/ui.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,6 @@
13971397
# Since: 3.0
13981398
##
13991399
{ 'enum' : 'DisplayGLMode',
1400-
'prefix' : 'DISPLAYGL_MODE', # TODO drop
14011400
'data' : [ 'off', 'on', 'core', 'es' ] }
14021401

14031402
##

system/vl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ static void qemu_create_early_backends(void)
19711971

19721972
qemu_console_early_init();
19731973

1974-
if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
1974+
if (dpy.has_gl && dpy.gl != DISPLAY_GL_MODE_OFF && display_opengl == 0) {
19751975
#if defined(CONFIG_OPENGL)
19761976
error_report("OpenGL is not supported by display backend '%s'",
19771977
DisplayType_str(dpy.type));

ui/dbus.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ dbus_display_add_console(DBusDisplay *dd, int idx, Error **errp)
176176
assert(con);
177177

178178
if (qemu_console_is_graphic(con) &&
179-
dd->gl_mode != DISPLAYGL_MODE_OFF) {
179+
dd->gl_mode != DISPLAY_GL_MODE_OFF) {
180180
qemu_console_set_display_gl_ctx(con, &dd->glctx);
181181
}
182182

@@ -466,9 +466,9 @@ static const TypeInfo dbus_vc_type_info = {
466466
static void
467467
early_dbus_init(DisplayOptions *opts)
468468
{
469-
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF;
469+
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_OFF;
470470

471-
if (mode != DISPLAYGL_MODE_OFF) {
471+
if (mode != DISPLAY_GL_MODE_OFF) {
472472
#ifdef CONFIG_OPENGL
473473
egl_init(opts->u.dbus.rendernode, mode, &error_fatal);
474474
#else
@@ -482,7 +482,7 @@ early_dbus_init(DisplayOptions *opts)
482482
static void
483483
dbus_init(DisplayState *ds, DisplayOptions *opts)
484484
{
485-
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF;
485+
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_OFF;
486486

487487
if (opts->u.dbus.addr && opts->u.dbus.p2p) {
488488
error_report("dbus: can't accept both addr=X and p2p=yes options");

ui/egl-context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ QEMUGLContext qemu_egl_create_context(DisplayGLCtx *dgc,
1717
EGL_CONTEXT_MINOR_VERSION_KHR, params->minor_ver,
1818
EGL_NONE
1919
};
20-
bool gles = (qemu_egl_mode == DISPLAYGL_MODE_ES);
20+
bool gles = (qemu_egl_mode == DISPLAY_GL_MODE_ES);
2121

2222
ctx = eglCreateContext(qemu_egl_display, qemu_egl_config,
2323
eglGetCurrentContext(),

ui/egl-headless.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static const DisplayGLCtxOps eglctx_ops = {
207207

208208
static void early_egl_headless_init(DisplayOptions *opts)
209209
{
210-
DisplayGLMode mode = DISPLAYGL_MODE_ON;
210+
DisplayGLMode mode = DISPLAY_GL_MODE_ON;
211211

212212
if (opts->has_gl) {
213213
mode = opts->gl;

ui/egl-helpers.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
503503
EGLint major, minor;
504504
EGLBoolean b;
505505
EGLint n;
506-
bool gles = (mode == DISPLAYGL_MODE_ES);
506+
bool gles = (mode == DISPLAY_GL_MODE_ES);
507507

508508
qemu_egl_display = qemu_egl_get_display(dpy, platform);
509509
if (qemu_egl_display == EGL_NO_DISPLAY) {
@@ -533,7 +533,7 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
533533
return -1;
534534
}
535535

536-
qemu_egl_mode = gles ? DISPLAYGL_MODE_ES : DISPLAYGL_MODE_CORE;
536+
qemu_egl_mode = gles ? DISPLAY_GL_MODE_ES : DISPLAY_GL_MODE_CORE;
537537
return 0;
538538
}
539539

@@ -564,8 +564,8 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode)
564564
int qemu_egl_init_dpy_win32(EGLNativeDisplayType dpy, DisplayGLMode mode)
565565
{
566566
/* prefer GL ES, as that's what ANGLE supports */
567-
if (mode == DISPLAYGL_MODE_ON) {
568-
mode = DISPLAYGL_MODE_ES;
567+
if (mode == DISPLAY_GL_MODE_ON) {
568+
mode = DISPLAY_GL_MODE_ES;
569569
}
570570

571571
if (qemu_egl_init_dpy(dpy, 0, mode) < 0) {
@@ -618,7 +618,7 @@ EGLContext qemu_egl_init_ctx(void)
618618
EGL_CONTEXT_CLIENT_VERSION, 2,
619619
EGL_NONE
620620
};
621-
bool gles = (qemu_egl_mode == DISPLAYGL_MODE_ES);
621+
bool gles = (qemu_egl_mode == DISPLAY_GL_MODE_ES);
622622
EGLContext ectx;
623623
EGLBoolean b;
624624

@@ -642,7 +642,7 @@ bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp)
642642
{
643643
ERRP_GUARD();
644644

645-
if (mode == DISPLAYGL_MODE_OFF) {
645+
if (mode == DISPLAY_GL_MODE_OFF) {
646646
error_setg(errp, "egl: turning off GL doesn't make sense");
647647
return false;
648648
}

ui/gtk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ static void early_gtk_display_init(DisplayOptions *opts)
25142514
}
25152515

25162516
assert(opts->type == DISPLAY_TYPE_GTK);
2517-
if (opts->has_gl && opts->gl != DISPLAYGL_MODE_OFF) {
2517+
if (opts->has_gl && opts->gl != DISPLAY_GL_MODE_OFF) {
25182518
#if defined(CONFIG_OPENGL)
25192519
#if defined(GDK_WINDOWING_WAYLAND)
25202520
if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
@@ -2530,7 +2530,7 @@ static void early_gtk_display_init(DisplayOptions *opts)
25302530
#endif
25312531
{
25322532
#ifdef CONFIG_X11
2533-
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_ON;
2533+
DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_ON;
25342534
gtk_egl_init(mode);
25352535
#endif
25362536
}

ui/sdl2-gl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
147147
SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
148148

149149
SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
150-
if (scon->opts->gl == DISPLAYGL_MODE_ON ||
151-
scon->opts->gl == DISPLAYGL_MODE_CORE) {
150+
if (scon->opts->gl == DISPLAY_GL_MODE_ON ||
151+
scon->opts->gl == DISPLAY_GL_MODE_CORE) {
152152
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
153153
SDL_GL_CONTEXT_PROFILE_CORE);
154-
} else if (scon->opts->gl == DISPLAYGL_MODE_ES) {
154+
} else if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
155155
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
156156
SDL_GL_CONTEXT_PROFILE_ES);
157157
}
@@ -163,7 +163,7 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
163163
/* If SDL fail to create a GL context and we use the "on" flag,
164164
* then try to fallback to GLES.
165165
*/
166-
if (!ctx && scon->opts->gl == DISPLAYGL_MODE_ON) {
166+
if (!ctx && scon->opts->gl == DISPLAY_GL_MODE_ON) {
167167
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
168168
SDL_GL_CONTEXT_PROFILE_ES);
169169
ctx = SDL_GL_CreateContext(scon->real_window);

ui/sdl2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void sdl2_window_create(struct sdl2_console *scon)
107107
if (scon->opengl) {
108108
const char *driver = "opengl";
109109

110-
if (scon->opts->gl == DISPLAYGL_MODE_ES) {
110+
if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
111111
driver = "opengles2";
112112
}
113113

ui/spice-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ static void qemu_spice_init(void)
840840
"incompatible with -spice port/tls-port");
841841
exit(1);
842842
}
843-
egl_init(qemu_opt_get(opts, "rendernode"), DISPLAYGL_MODE_ON, &error_fatal);
843+
egl_init(qemu_opt_get(opts, "rendernode"), DISPLAY_GL_MODE_ON, &error_fatal);
844844
spice_opengl = 1;
845845
}
846846
#endif

0 commit comments

Comments
 (0)