@@ -1377,6 +1377,21 @@ passed since 1970, i.e. unix epoch.
ETEXI
{
+ .name = "framebuffer-display",
+ .args_type = "enable:b",
+ .params = "on|off",
+ .help = "enable/disable linux console framebuffer display",
+ .mhandler.cmd = hmp_framebuffer_display,
+ },
+
+STEXI
+@item framebuffer-display on | off
+@findex framebuffer-display
+
+enable/disable linux console framebuffer display.
+ETEXI
+
+ {
.name = "info",
.args_type = "item:s?",
.params = "[subcommand]",
@@ -1168,3 +1168,12 @@ void hmp_screen_dump(Monitor *mon, const QDict *qdict)
qmp_screendump(filename, &err);
hmp_handle_error(mon, &err);
}
+
+void hmp_framebuffer_display(Monitor *mon, const QDict *qdict)
+{
+ int enable = qdict_get_bool(qdict, "enable");
+ Error *errp = NULL;
+
+ qmp_framebuffer_display(enable, &errp);
+ hmp_handle_error(mon, &errp);
+}
@@ -73,5 +73,6 @@ void hmp_getfd(Monitor *mon, const QDict *qdict);
void hmp_closefd(Monitor *mon, const QDict *qdict);
void hmp_send_key(Monitor *mon, const QDict *qdict);
void hmp_screen_dump(Monitor *mon, const QDict *qdict);
+void hmp_framebuffer_display(Monitor *mon, const QDict *qdict);
#endif
@@ -2619,3 +2619,16 @@
# Since: 0.14.0
##
{ 'command': 'screendump', 'data': {'filename': 'str'} }
+
+# @framebuffer-display:
+#
+# Enable/disable linux console framebuffer display.
+#
+# @enable: whenever the framebuffer display should be enabled or disabled.
+#
+# Returns: Nothing.
+#
+# Since: 1.3
+#
+##
+{ 'command': 'framebuffer-display', 'data': {'enable': 'bool'} }
@@ -2539,3 +2539,9 @@ EQMP
.args_type = "",
.mhandler.cmd_new = qmp_marshal_input_query_target,
},
+
+ {
+ .name = "framebuffer-display",
+ .args_type = "enable:b",
+ .mhandler.cmd_new = qmp_marshal_input_framebuffer_display,
+ },
@@ -391,6 +391,25 @@ void qmp_change(const char *device, const char *target,
}
}
+void qmp_framebuffer_display(bool enable, Error **errp)
+{
+#if defined(CONFIG_LINUX)
+ DisplayState *ds = get_displaystate();
+
+ if (enable) {
+ if (fbdev_display_init(ds, NULL, errp) != 0) {
+ if (!error_is_set(errp)) {
+ error_setg(errp, "fbdev initialization failed");
+ }
+ }
+ } else {
+ fbdev_display_uninit(ds);
+ }
+#else
+ error_setg(errp, "fbdev support disabled at compile time");
+#endif
+}
+
static void qom_list_types_tramp(ObjectClass *klass, void *data)
{
ObjectTypeInfoList *e, **pret = data;
This patch adds a fbdev monitor command to enable/disable the fbdev display at runtime to both qmp and hmp. qmp: framebuffer-display enable=on|off hmp: framebuffer-display on|off Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- hmp-commands.hx | 15 +++++++++++++++ hmp.c | 9 +++++++++ hmp.h | 1 + qapi-schema.json | 13 +++++++++++++ qmp-commands.hx | 6 ++++++ qmp.c | 19 +++++++++++++++++++ 6 files changed, 63 insertions(+), 0 deletions(-)