From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: alex.williamson@redhat.com, andrew@codeconstruct.com.au,
andrew@daynix.com, arei.gonglei@huawei.com, berrange@redhat.com,
berto@igalia.com, borntraeger@linux.ibm.com, clg@kaod.org,
david@redhat.com, den@openvz.org, eblake@redhat.com,
eduardo@habkost.net, farman@linux.ibm.com, farosas@suse.de,
hreitz@redhat.com, idryomov@gmail.com, iii@linux.ibm.com,
jamin_lin@aspeedtech.com, jasowang@redhat.com, joel@jms.id.au,
jsnow@redhat.com, kwolf@redhat.com, leetroy@gmail.com,
marcandre.lureau@redhat.com, marcel.apfelbaum@gmail.com,
michael.roth@amd.com, mst@redhat.com, mtosatti@redhat.com,
nsg@linux.ibm.com, pasic@linux.ibm.com, pbonzini@redhat.com,
peter.maydell@linaro.org, peterx@redhat.com, philmd@linaro.org,
pizhenwei@bytedance.com, pl@dlhnet.de,
richard.henderson@linaro.org, stefanha@redhat.com,
steven_lee@aspeedtech.com, thuth@redhat.com,
vsementsov@yandex-team.ru, wangyanan55@huawei.com,
yuri.benditovich@daynix.com, zhao1.liu@intel.com,
qemu-block@nongnu.org, qemu-arm@nongnu.org,
qemu-s390x@nongnu.org, kvm@vger.kernel.org, avihaih@nvidia.com
Subject: [PATCH v2 08/19] qapi/ui: Drop temporary 'prefix'
Date: Wed, 4 Sep 2024 13:18:25 +0200 [thread overview]
Message-ID: <20240904111836.3273842-9-armbru@redhat.com> (raw)
In-Reply-To: <20240904111836.3273842-1-armbru@redhat.com>
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 <armbru@redhat.com>
---
qapi/ui.json | 1 -
system/vl.c | 2 +-
ui/dbus.c | 8 ++++----
ui/egl-context.c | 2 +-
ui/egl-headless.c | 2 +-
ui/egl-helpers.c | 12 ++++++------
ui/gtk.c | 4 ++--
ui/sdl2-gl.c | 8 ++++----
ui/sdl2.c | 2 +-
ui/spice-core.c | 2 +-
10 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/qapi/ui.json b/qapi/ui.json
index f61a2b6b65..460a26b981 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1397,7 +1397,6 @@
# Since: 3.0
##
{ 'enum' : 'DisplayGLMode',
- 'prefix' : 'DISPLAYGL_MODE', # TODO drop
'data' : [ 'off', 'on', 'core', 'es' ] }
##
diff --git a/system/vl.c b/system/vl.c
index 01b8b8e77a..fe547ca47c 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1971,7 +1971,7 @@ static void qemu_create_early_backends(void)
qemu_console_early_init();
- if (dpy.has_gl && dpy.gl != DISPLAYGL_MODE_OFF && display_opengl == 0) {
+ if (dpy.has_gl && dpy.gl != DISPLAY_GL_MODE_OFF && display_opengl == 0) {
#if defined(CONFIG_OPENGL)
error_report("OpenGL is not supported by display backend '%s'",
DisplayType_str(dpy.type));
diff --git a/ui/dbus.c b/ui/dbus.c
index e08b5de064..7ecd39e784 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -176,7 +176,7 @@ dbus_display_add_console(DBusDisplay *dd, int idx, Error **errp)
assert(con);
if (qemu_console_is_graphic(con) &&
- dd->gl_mode != DISPLAYGL_MODE_OFF) {
+ dd->gl_mode != DISPLAY_GL_MODE_OFF) {
qemu_console_set_display_gl_ctx(con, &dd->glctx);
}
@@ -466,9 +466,9 @@ static const TypeInfo dbus_vc_type_info = {
static void
early_dbus_init(DisplayOptions *opts)
{
- DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF;
+ DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_OFF;
- if (mode != DISPLAYGL_MODE_OFF) {
+ if (mode != DISPLAY_GL_MODE_OFF) {
#ifdef CONFIG_OPENGL
egl_init(opts->u.dbus.rendernode, mode, &error_fatal);
#else
@@ -482,7 +482,7 @@ early_dbus_init(DisplayOptions *opts)
static void
dbus_init(DisplayState *ds, DisplayOptions *opts)
{
- DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF;
+ DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_OFF;
if (opts->u.dbus.addr && opts->u.dbus.p2p) {
error_report("dbus: can't accept both addr=X and p2p=yes options");
diff --git a/ui/egl-context.c b/ui/egl-context.c
index 9e0df466f3..aed3e3ba1f 100644
--- a/ui/egl-context.c
+++ b/ui/egl-context.c
@@ -17,7 +17,7 @@ QEMUGLContext qemu_egl_create_context(DisplayGLCtx *dgc,
EGL_CONTEXT_MINOR_VERSION_KHR, params->minor_ver,
EGL_NONE
};
- bool gles = (qemu_egl_mode == DISPLAYGL_MODE_ES);
+ bool gles = (qemu_egl_mode == DISPLAY_GL_MODE_ES);
ctx = eglCreateContext(qemu_egl_display, qemu_egl_config,
eglGetCurrentContext(),
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index 6187249c73..1f6b845500 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -207,7 +207,7 @@ static const DisplayGLCtxOps eglctx_ops = {
static void early_egl_headless_init(DisplayOptions *opts)
{
- DisplayGLMode mode = DISPLAYGL_MODE_ON;
+ DisplayGLMode mode = DISPLAY_GL_MODE_ON;
if (opts->has_gl) {
mode = opts->gl;
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index 99b2ebbe23..81a57fa975 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -503,7 +503,7 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
EGLint major, minor;
EGLBoolean b;
EGLint n;
- bool gles = (mode == DISPLAYGL_MODE_ES);
+ bool gles = (mode == DISPLAY_GL_MODE_ES);
qemu_egl_display = qemu_egl_get_display(dpy, platform);
if (qemu_egl_display == EGL_NO_DISPLAY) {
@@ -533,7 +533,7 @@ static int qemu_egl_init_dpy(EGLNativeDisplayType dpy,
return -1;
}
- qemu_egl_mode = gles ? DISPLAYGL_MODE_ES : DISPLAYGL_MODE_CORE;
+ qemu_egl_mode = gles ? DISPLAY_GL_MODE_ES : DISPLAY_GL_MODE_CORE;
return 0;
}
@@ -564,8 +564,8 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode)
int qemu_egl_init_dpy_win32(EGLNativeDisplayType dpy, DisplayGLMode mode)
{
/* prefer GL ES, as that's what ANGLE supports */
- if (mode == DISPLAYGL_MODE_ON) {
- mode = DISPLAYGL_MODE_ES;
+ if (mode == DISPLAY_GL_MODE_ON) {
+ mode = DISPLAY_GL_MODE_ES;
}
if (qemu_egl_init_dpy(dpy, 0, mode) < 0) {
@@ -618,7 +618,7 @@ EGLContext qemu_egl_init_ctx(void)
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
- bool gles = (qemu_egl_mode == DISPLAYGL_MODE_ES);
+ bool gles = (qemu_egl_mode == DISPLAY_GL_MODE_ES);
EGLContext ectx;
EGLBoolean b;
@@ -642,7 +642,7 @@ bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp)
{
ERRP_GUARD();
- if (mode == DISPLAYGL_MODE_OFF) {
+ if (mode == DISPLAY_GL_MODE_OFF) {
error_setg(errp, "egl: turning off GL doesn't make sense");
return false;
}
diff --git a/ui/gtk.c b/ui/gtk.c
index 8e14c2ac81..bf9d3dd679 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2514,7 +2514,7 @@ static void early_gtk_display_init(DisplayOptions *opts)
}
assert(opts->type == DISPLAY_TYPE_GTK);
- if (opts->has_gl && opts->gl != DISPLAYGL_MODE_OFF) {
+ if (opts->has_gl && opts->gl != DISPLAY_GL_MODE_OFF) {
#if defined(CONFIG_OPENGL)
#if defined(GDK_WINDOWING_WAYLAND)
if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
@@ -2530,7 +2530,7 @@ static void early_gtk_display_init(DisplayOptions *opts)
#endif
{
#ifdef CONFIG_X11
- DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_ON;
+ DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAY_GL_MODE_ON;
gtk_egl_init(mode);
#endif
}
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 91b7ee2419..e01d9ab0c7 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -147,11 +147,11 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
- if (scon->opts->gl == DISPLAYGL_MODE_ON ||
- scon->opts->gl == DISPLAYGL_MODE_CORE) {
+ if (scon->opts->gl == DISPLAY_GL_MODE_ON ||
+ scon->opts->gl == DISPLAY_GL_MODE_CORE) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_CORE);
- } else if (scon->opts->gl == DISPLAYGL_MODE_ES) {
+ } else if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_ES);
}
@@ -163,7 +163,7 @@ QEMUGLContext sdl2_gl_create_context(DisplayGLCtx *dgc,
/* If SDL fail to create a GL context and we use the "on" flag,
* then try to fallback to GLES.
*/
- if (!ctx && scon->opts->gl == DISPLAYGL_MODE_ON) {
+ if (!ctx && scon->opts->gl == DISPLAY_GL_MODE_ON) {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_ES);
ctx = SDL_GL_CreateContext(scon->real_window);
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 98ed974371..251ce97796 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -107,7 +107,7 @@ void sdl2_window_create(struct sdl2_console *scon)
if (scon->opengl) {
const char *driver = "opengl";
- if (scon->opts->gl == DISPLAYGL_MODE_ES) {
+ if (scon->opts->gl == DISPLAY_GL_MODE_ES) {
driver = "opengles2";
}
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 15be640286..bd9dbe03f1 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -840,7 +840,7 @@ static void qemu_spice_init(void)
"incompatible with -spice port/tls-port");
exit(1);
}
- egl_init(qemu_opt_get(opts, "rendernode"), DISPLAYGL_MODE_ON, &error_fatal);
+ egl_init(qemu_opt_get(opts, "rendernode"), DISPLAY_GL_MODE_ON, &error_fatal);
spice_opengl = 1;
}
#endif
--
2.46.0
next prev parent reply other threads:[~2024-09-04 11:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 11:18 [PATCH v2 00/19] qapi: Reduce use of 'prefix' Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 01/19] qapi: Smarter camel_to_upper() to reduce need for 'prefix' Markus Armbruster
2024-09-04 12:18 ` Daniel P. Berrangé
2024-09-05 5:59 ` Markus Armbruster
2024-09-05 15:52 ` Daniel P. Berrangé
2024-09-05 16:07 ` Peter Xu
2024-09-04 11:18 ` [PATCH v2 02/19] tests/qapi-schema: Drop temporary 'prefix' Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 03/19] qapi/block-core: " Markus Armbruster
2024-09-30 13:23 ` Vladimir Sementsov-Ogievskiy
2024-09-30 13:28 ` Vladimir Sementsov-Ogievskiy
2024-09-04 11:18 ` [PATCH v2 04/19] qapi/common: " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 05/19] qapi/crypto: " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 06/19] qapi/ebpf: " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 07/19] qapi/machine: " Markus Armbruster
2024-09-04 11:18 ` Markus Armbruster [this message]
2024-09-04 11:18 ` [PATCH v2 09/19] qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix' Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 10/19] qapi/crypto: Drop unwanted 'prefix' Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 11/19] qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 12/19] qapi/crypto: Rename QCryptoCipherAlgorithm " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 13/19] qapi/crypto: Rename QCryptoIVGenAlgorithm " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 14/19] qapi/crypto: Rename QCryptoAkCipherAlgorithm " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 15/19] qapi/crypto: Rename QCryptoRSAPaddingAlgorithm " Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 16/19] qapi/crypto: Rename QCryptoAFAlg to QCryptoAFAlgo Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 17/19] qapi/cryptodev: Drop unwanted 'prefix' Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 18/19] qapi/cryptodev: Rename QCryptodevBackendAlgType to *Algo, and drop prefix Markus Armbruster
2024-09-04 11:18 ` [PATCH v2 19/19] qapi/vfio: Rename VfioMigrationState to Qapi*, " Markus Armbruster
2024-09-04 11:59 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240904111836.3273842-9-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=andrew@codeconstruct.com.au \
--cc=andrew@daynix.com \
--cc=arei.gonglei@huawei.com \
--cc=avihaih@nvidia.com \
--cc=berrange@redhat.com \
--cc=berto@igalia.com \
--cc=borntraeger@linux.ibm.com \
--cc=clg@kaod.org \
--cc=david@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=farman@linux.ibm.com \
--cc=farosas@suse.de \
--cc=hreitz@redhat.com \
--cc=idryomov@gmail.com \
--cc=iii@linux.ibm.com \
--cc=jamin_lin@aspeedtech.com \
--cc=jasowang@redhat.com \
--cc=joel@jms.id.au \
--cc=jsnow@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=leetroy@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=nsg@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=pizhenwei@bytedance.com \
--cc=pl@dlhnet.de \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
--cc=steven_lee@aspeedtech.com \
--cc=thuth@redhat.com \
--cc=vsementsov@yandex-team.ru \
--cc=wangyanan55@huawei.com \
--cc=yuri.benditovich@daynix.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).