* [Qemu-devel] [PATCH 1/7] console: Add graphic_hw_store_edid()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 2/7] console: Add graphic_hw_set_orientation() John Baboval
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
Add a hook in GraphicHwOps to pass monitor EDID for a QemuConsole
from the ui to the hw.
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 2 ++
ui/console.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 4156a87..9c928fa 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -274,6 +274,7 @@ typedef struct GraphicHwOps {
void (*gfx_update)(void *opaque);
void (*text_update)(void *opaque, console_ch_t *text);
void (*update_interval)(void *opaque, uint64_t interval);
+ void (*store_edid)(void *opaque, uint8_t *edid, size_t edid_size);
} GraphicHwOps;
QemuConsole *graphic_console_init(DeviceState *dev,
@@ -281,6 +282,7 @@ QemuConsole *graphic_console_init(DeviceState *dev,
void *opaque);
void graphic_hw_update(QemuConsole *con);
+void graphic_hw_store_edid(QemuConsole *con, uint8_t *edid, size_t edid_size);
void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
diff --git a/ui/console.c b/ui/console.c
index 502e160..1f6c840 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -245,6 +245,16 @@ static void gui_setup_refresh(DisplayState *ds)
ds->have_text = have_text;
}
+void graphic_hw_store_edid(QemuConsole *con, uint8_t *edid, size_t edid_size)
+{
+ if (!con) {
+ con = active_console;
+ }
+ if (con && con->hw_ops->store_edid) {
+ con->hw_ops->store_edid(con->hw, edid, edid_size);
+ }
+}
+
void graphic_hw_update(QemuConsole *con)
{
if (!con) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/7] console: Add graphic_hw_set_orientation()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 1/7] console: Add graphic_hw_store_edid() John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 3/7] console: Add graphic_hw_add_display() John Baboval
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
Add a hook in GraphicHwOps for the ui to inform the hw of display orientation changes
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 2 ++
ui/console.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 9c928fa..61455d6 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -275,6 +275,7 @@ typedef struct GraphicHwOps {
void (*text_update)(void *opaque, console_ch_t *text);
void (*update_interval)(void *opaque, uint64_t interval);
void (*store_edid)(void *opaque, uint8_t *edid, size_t edid_size);
+ void (*set_orientation)(void *opaque, uint32_t x, uint32_t y, uint32_t r);
} GraphicHwOps;
QemuConsole *graphic_console_init(DeviceState *dev,
@@ -283,6 +284,8 @@ QemuConsole *graphic_console_init(DeviceState *dev,
void graphic_hw_update(QemuConsole *con);
void graphic_hw_store_edid(QemuConsole *con, uint8_t *edid, size_t edid_size);
+void graphic_hw_set_orientation(QemuConsole *con, uint32_t x, uint32_t y,
+ uint32_t r);
void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
diff --git a/ui/console.c b/ui/console.c
index 1f6c840..22de32c 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -255,6 +255,17 @@ void graphic_hw_store_edid(QemuConsole *con, uint8_t *edid, size_t edid_size)
}
}
+void graphic_hw_set_orientation(QemuConsole *con, uint32_t x, uint32_t y,
+ uint32_t r)
+{
+ if (!con) {
+ con = active_console;
+ }
+ if (con && con->hw_ops->set_orientation) {
+ con->hw_ops->set_orientation(con->hw, x, y, r);
+ }
+}
+
void graphic_hw_update(QemuConsole *con)
{
if (!con) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 3/7] console: Add graphic_hw_add_display()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 1/7] console: Add graphic_hw_store_edid() John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 2/7] console: Add graphic_hw_set_orientation() John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify() John Baboval
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
Hook for adding another QemuConsole to the active display adapter.
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 2 ++
ui/console.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 61455d6..95ed12a 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -275,6 +275,7 @@ typedef struct GraphicHwOps {
void (*text_update)(void *opaque, console_ch_t *text);
void (*update_interval)(void *opaque, uint64_t interval);
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);
} GraphicHwOps;
@@ -287,6 +288,7 @@ void graphic_hw_store_edid(QemuConsole *con, uint8_t *edid, size_t edid_size);
void graphic_hw_set_orientation(QemuConsole *con, uint32_t x, uint32_t y, uint32_t r);
void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
+QemuConsole *graphic_hw_add_display(void);
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 22de32c..fc60570 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -285,6 +285,15 @@ void graphic_hw_invalidate(QemuConsole *con)
}
}
+QemuConsole *graphic_hw_add_display(void)
+{
+ if (active_console && active_console->hw_ops->add_display) {
+ return active_console->hw_ops->add_display(active_console->hw);
+ }
+
+ return NULL;
+}
+
static void ppm_save(const char *filename, struct DisplaySurface *ds,
Error **errp)
{
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
` (2 preceding siblings ...)
2013-12-19 18:40 ` [Qemu-devel] [PATCH 3/7] console: Add graphic_hw_add_display() John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 5/7] ui: Add dpy_reset() John Baboval
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
Hook to notify a display adapter of interesting UI changes such as
monitor hotplug, orientation changes, etc...
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 5/7] ui: Add dpy_reset()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
` (3 preceding siblings ...)
2013-12-19 18:40 ` [Qemu-devel] [PATCH 4/7] console: Add graphic_hw_notify() John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 6/7] ui: Add dpy_cursor_enable() John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 7/7] ui: Add an opaque pointer to the DisplayChangeListener John Baboval
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
To be called by graphics adapter to have the ui re-initialize monitor state.
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 3 +++
ui/console.c | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index a69ac3d..a7171cc 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -176,6 +176,8 @@ typedef struct DisplayChangeListenerOps {
void (*dpy_text_update)(DisplayChangeListener *dcl,
int x, int y, int w, int h);
+ void (*dpy_reset)(DisplayChangeListener *dcl);
+
void (*dpy_mouse_set)(DisplayChangeListener *dcl,
int x, int y, int on);
void (*dpy_cursor_define)(DisplayChangeListener *dcl,
@@ -230,6 +232,7 @@ void dpy_text_resize(QemuConsole *con, int w, int h);
void dpy_mouse_set(QemuConsole *con, int x, int y, int on);
void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor);
bool dpy_cursor_define_supported(QemuConsole *con);
+void dpy_reset(QemuConsole *con);
static inline int surface_stride(DisplaySurface *s)
{
diff --git a/ui/console.c b/ui/console.c
index 0919973..201e602 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1560,6 +1560,17 @@ bool dpy_cursor_define_supported(QemuConsole *con)
return false;
}
+void dpy_reset(QemuConsole *con)
+{
+ DisplayState *s = con->ds;
+ struct DisplayChangeListener *dcl;
+ QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (dcl->ops->dpy_reset) {
+ dcl->ops->dpy_reset(dcl);
+ }
+ }
+}
+
/***********************************************************/
/* register display */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 6/7] ui: Add dpy_cursor_enable()
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
` (4 preceding siblings ...)
2013-12-19 18:40 ` [Qemu-devel] [PATCH 5/7] ui: Add dpy_reset() John Baboval
@ 2013-12-19 18:40 ` John Baboval
2013-12-19 18:40 ` [Qemu-devel] [PATCH 7/7] ui: Add an opaque pointer to the DisplayChangeListener John Baboval
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
This is an optimization to allow the UI to show/hide the current cursor without
setting it to a new bitmap.
In-guest screen sharing applications which show/hide the cursor when capturing
the screen every frame (GoToMeeting, WebEx, etc.) cause high QEMU CPU usage if
cursor hiding/restoring is implemented as setting a blank cursor and re-setting
the original glyph. In-guest driver APIs typically have enable/disable called
out as a separate operation to provide input for this optimization.
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 3 +++
ui/console.c | 11 +++++++++++
2 files changed, 14 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index a7171cc..7efa119 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -182,6 +182,8 @@ typedef struct DisplayChangeListenerOps {
int x, int y, int on);
void (*dpy_cursor_define)(DisplayChangeListener *dcl,
QEMUCursor *cursor);
+ void (*dpy_cursor_enable)(DisplayChangeListener *dcl,
+ bool state);
} DisplayChangeListenerOps;
struct DisplayChangeListener {
@@ -232,6 +234,7 @@ void dpy_text_resize(QemuConsole *con, int w, int h);
void dpy_mouse_set(QemuConsole *con, int x, int y, int on);
void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor);
bool dpy_cursor_define_supported(QemuConsole *con);
+void dpy_cursor_enable(QemuConsole *con, bool state);
void dpy_reset(QemuConsole *con);
static inline int surface_stride(DisplaySurface *s)
diff --git a/ui/console.c b/ui/console.c
index 201e602..e9f74c9 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1560,6 +1560,17 @@ bool dpy_cursor_define_supported(QemuConsole *con)
return false;
}
+void dpy_cursor_enable(QemuConsole *con, bool state)
+{
+ DisplayState *s = con->ds;
+ struct DisplayChangeListener *dcl;
+ QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (dcl->ops->dpy_cursor_enable) {
+ dcl->ops->dpy_cursor_enable(dcl, state);
+ }
+ }
+}
+
void dpy_reset(QemuConsole *con)
{
DisplayState *s = con->ds;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 7/7] ui: Add an opaque pointer to the DisplayChangeListener
2013-12-19 18:40 [Qemu-devel] [PATCH 0/7] Multi-head support infrastructure John Baboval
` (5 preceding siblings ...)
2013-12-19 18:40 ` [Qemu-devel] [PATCH 6/7] ui: Add dpy_cursor_enable() John Baboval
@ 2013-12-19 18:40 ` John Baboval
6 siblings, 0 replies; 8+ messages in thread
From: John Baboval @ 2013-12-19 18:40 UTC (permalink / raw)
To: qemu-devel; +Cc: John V. Baboval
From: "John V. Baboval" <john.baboval@citrix.com>
The pointer is a place for the UI to hang a structure off of. In the multi-head
case, the UI can use this pointer to distinguish which QemuConsole a dpy_* call
was made for.
Signed-off-by: John V. Baboval <john.baboval@citrix.com>
---
include/ui/console.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 7efa119..271f577 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -191,6 +191,7 @@ struct DisplayChangeListener {
const DisplayChangeListenerOps *ops;
DisplayState *ds;
QemuConsole *con;
+ void *ui;
QLIST_ENTRY(DisplayChangeListener) next;
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread