[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify()
From: |
John Baboval |
Subject: |
[Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify() |
Date: |
Thu, 19 Dec 2013 13:40:14 -0500 |
From: "John V. Baboval" <address@hidden>
Hook to notify a display adapter of interesting UI changes such as
monitor hotplug, orientation changes, etc...
Signed-off-by: John V. Baboval <address@hidden>
---
include/ui/console.h | 9 +++++++++
ui/console.c | 7 +++++++
2 files changed, 16 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 95ed12a..a69ac3d 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -110,6 +110,13 @@ struct QemuConsoleClass {
#define QEMU_BIG_ENDIAN_FLAG 0x01
#define QEMU_ALLOCATED_FLAG 0x02
+typedef enum {
+ GN_PNP, /* Guest should rescan PCI bus */
+ GN_MONITOR_PNP, /* Guest should reload monitor port EDIDs */
+ GN_DISPLAY_CONFIG, /* Guest should reload display orientation */
+ GN_MOUSE_ENABLED, /* Guest should reconfigure cursor */
+} gn_cmd_t;
+
struct PixelFormat {
uint8_t bits_per_pixel;
uint8_t bytes_per_pixel;
@@ -277,6 +284,7 @@ typedef struct GraphicHwOps {
void (*store_edid)(void *opaque, uint8_t *edid, size_t edid_size);
QemuConsole *(*add_display)(void *opaque);
void (*set_orientation)(void *opaque, uint32_t x, uint32_t y, uint32_t r);
+ void (*notify)(void *opaque, gn_cmd_t cmd, int value);
} GraphicHwOps;
QemuConsole *graphic_console_init(DeviceState *dev,
@@ -289,6 +297,7 @@ void graphic_hw_set_orientation(QemuConsole *con, uint32_t
x, uint32_t y, uint32
void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
QemuConsole *graphic_hw_add_display(void);
+void graphic_hw_notify(QemuConsole *con, gn_cmd_t cmd, int value);
QemuConsole *qemu_console_lookup_by_index(unsigned int index);
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev);
diff --git a/ui/console.c b/ui/console.c
index fc60570..0919973 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -293,6 +293,13 @@ QemuConsole *graphic_hw_add_display(void)
return NULL;
}
+void graphic_hw_notify(QemuConsole *con, gn_cmd_t cmd, int value)
+{
+ if (con && con->hw_ops->notify)
+ con->hw_ops->notify(con->hw, cmd, value);
+}
+
+
static void ppm_save(const char *filename, struct DisplaySurface *ds,
Error **errp)
{
--
1.7.9.5
- [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure, John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 6/7] ui: Add dpy_cursor_enable(), John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify(),
John Baboval <=
- [Qemu-devel] [PATCH 7/7] ui: Add an opaque pointer to the DisplayChangeListener, John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 5/7] ui: Add dpy_reset(), John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 1/7] console: Add graphic_hw_store_edid(), John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 2/7] console: Add graphic_hw_set_orientation(), John Baboval, 2013/12/19
- [Qemu-devel] [PATCH 3/7] console: Add graphic_hw_add_display(), John Baboval, 2013/12/19