summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/hw/qdev-properties.h10
-rw-r--r--include/hw/stream.h36
-rw-r--r--include/hw/xilinx.h21
-rw-r--r--include/sysemu/kvm.h12
-rw-r--r--include/ui/console.h55
-rw-r--r--include/ui/qemu-pixman.h9
-rw-r--r--include/ui/spice-display.h1
7 files changed, 91 insertions, 53 deletions
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index a37933998a..25dd1bb39a 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -6,6 +6,7 @@
/*** qdev-properties.c ***/
extern PropertyInfo qdev_prop_bit;
+extern PropertyInfo qdev_prop_bool;
extern PropertyInfo qdev_prop_uint8;
extern PropertyInfo qdev_prop_uint16;
extern PropertyInfo qdev_prop_uint32;
@@ -52,6 +53,15 @@ extern PropertyInfo qdev_prop_arraylen;
.defval = (bool)_defval, \
}
+#define DEFINE_PROP_BOOL(_name, _state, _field, _defval) { \
+ .name = (_name), \
+ .info = &(qdev_prop_bool), \
+ .offset = offsetof(_state, _field) \
+ + type_check(bool, typeof_field(_state, _field)), \
+ .qtype = QTYPE_QBOOL, \
+ .defval = (bool)_defval, \
+ }
+
#define PROP_ARRAY_LEN_PREFIX "len-"
/**
diff --git a/include/hw/stream.h b/include/hw/stream.h
index f6137d6e25..35eb083a7f 100644
--- a/include/hw/stream.h
+++ b/include/hw/stream.h
@@ -18,14 +18,40 @@ typedef struct StreamSlave {
Object Parent;
} StreamSlave;
+typedef void (*StreamCanPushNotifyFn)(void *opaque);
+
typedef struct StreamSlaveClass {
InterfaceClass parent;
-
- void (*push)(StreamSlave *obj, unsigned char *buf, size_t len,
- uint32_t *app);
+ /**
+ * can push - determine if a stream slave is capable of accepting at least
+ * one byte of data. Returns false if cannot accept. If not implemented, the
+ * slave is assumed to always be capable of recieveing.
+ * @notify: Optional callback that the slave will call when the slave is
+ * capable of recieving again. Only called if false is returned.
+ * @notify_opaque: opaque data to pass to notify call.
+ */
+ bool (*can_push)(StreamSlave *obj, StreamCanPushNotifyFn notify,
+ void *notify_opaque);
+ /**
+ * push - push data to a Stream slave. The number of bytes pushed is
+ * returned. If the slave short returns, the master must wait before trying
+ * again, the slave may continue to just return 0 waiting for the vm time to
+ * advance. The can_push() function can be used to trap the point in time
+ * where the slave is ready to recieve again, otherwise polling on a QEMU
+ * timer will work.
+ * @obj: Stream slave to push to
+ * @buf: Data to write
+ * @len: Maximum number of bytes to write
+ */
+ size_t (*push)(StreamSlave *obj, unsigned char *buf, size_t len);
} StreamSlaveClass;
-void
-stream_push(StreamSlave *sink, uint8_t *buf, size_t len, uint32_t *app);
+size_t
+stream_push(StreamSlave *sink, uint8_t *buf, size_t len);
+
+bool
+stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify,
+ void *notify_opaque);
+
#endif /* STREAM_H */
diff --git a/include/hw/xilinx.h b/include/hw/xilinx.h
index 6c1ee21c54..0c0251a2e9 100644
--- a/include/hw/xilinx.h
+++ b/include/hw/xilinx.h
@@ -55,16 +55,19 @@ xilinx_ethlite_create(NICInfo *nd, hwaddr base, qemu_irq irq,
}
static inline void
-xilinx_axiethernet_init(DeviceState *dev, NICInfo *nd, StreamSlave *peer,
- hwaddr base, qemu_irq irq, int txmem, int rxmem)
+xilinx_axiethernet_init(DeviceState *dev, NICInfo *nd, StreamSlave *ds,
+ StreamSlave *cs, hwaddr base, qemu_irq irq, int txmem,
+ int rxmem)
{
Error *errp = NULL;
qdev_set_nic_properties(dev, nd);
qdev_prop_set_uint32(dev, "rxmem", rxmem);
qdev_prop_set_uint32(dev, "txmem", txmem);
- object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
- &errp);
+ object_property_set_link(OBJECT(dev), OBJECT(ds),
+ "axistream-connected", &errp);
+ object_property_set_link(OBJECT(dev), OBJECT(cs),
+ "axistream-control-connected", &errp);
assert_no_error(errp);
qdev_init_nofail(dev);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
@@ -72,14 +75,16 @@ xilinx_axiethernet_init(DeviceState *dev, NICInfo *nd, StreamSlave *peer,
}
static inline void
-xilinx_axidma_init(DeviceState *dev, StreamSlave *peer, hwaddr base,
- qemu_irq irq, qemu_irq irq2, int freqhz)
+xilinx_axidma_init(DeviceState *dev, StreamSlave *ds, StreamSlave *cs,
+ hwaddr base, qemu_irq irq, qemu_irq irq2, int freqhz)
{
Error *errp = NULL;
qdev_prop_set_uint32(dev, "freqhz", freqhz);
- object_property_set_link(OBJECT(dev), OBJECT(peer), "axistream-connected",
- &errp);
+ object_property_set_link(OBJECT(dev), OBJECT(ds),
+ "axistream-connected", &errp);
+ object_property_set_link(OBJECT(dev), OBJECT(cs),
+ "axistream-control-connected", &errp);
assert_no_error(errp);
qdev_init_nofail(dev);
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index f2d97b580d..495e6f8dbd 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -250,8 +250,8 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
uint32_t index, int reg);
void kvm_cpu_synchronize_state(CPUArchState *env);
-void kvm_cpu_synchronize_post_reset(CPUArchState *env);
-void kvm_cpu_synchronize_post_init(CPUArchState *env);
+void kvm_cpu_synchronize_post_reset(CPUState *cpu);
+void kvm_cpu_synchronize_post_init(CPUState *cpu);
/* generic hooks - to be moved/refactored once there are more users */
@@ -262,17 +262,17 @@ static inline void cpu_synchronize_state(CPUArchState *env)
}
}
-static inline void cpu_synchronize_post_reset(CPUArchState *env)
+static inline void cpu_synchronize_post_reset(CPUState *cpu)
{
if (kvm_enabled()) {
- kvm_cpu_synchronize_post_reset(env);
+ kvm_cpu_synchronize_post_reset(cpu);
}
}
-static inline void cpu_synchronize_post_init(CPUArchState *env)
+static inline void cpu_synchronize_post_init(CPUState *cpu)
{
if (kvm_enabled()) {
- kvm_cpu_synchronize_post_init(env);
+ kvm_cpu_synchronize_post_init(cpu);
}
}
diff --git a/include/ui/console.h b/include/ui/console.h
index a234c72d2e..e591d742d4 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -21,7 +21,8 @@
#define QEMU_CAPS_LOCK_LED (1 << 2)
/* in ms */
-#define GUI_REFRESH_INTERVAL 30
+#define GUI_REFRESH_INTERVAL_DEFAULT 30
+#define GUI_REFRESH_INTERVAL_IDLE 3000
typedef void QEMUPutKBDEvent(void *opaque, int keycode);
typedef void QEMUPutLEDEvent(void *opaque, int ledstate);
@@ -174,27 +175,15 @@ typedef struct DisplayChangeListenerOps {
} DisplayChangeListenerOps;
struct DisplayChangeListener {
- int idle;
- uint64_t gui_timer_interval;
+ uint64_t update_interval;
const DisplayChangeListenerOps *ops;
DisplayState *ds;
+ QemuConsole *con;
QLIST_ENTRY(DisplayChangeListener) next;
};
-struct DisplayState {
- struct DisplaySurface *surface;
- struct QEMUTimer *gui_timer;
- bool have_gfx;
- bool have_text;
-
- QLIST_HEAD(, DisplayChangeListener) listeners;
-
- struct DisplayState *next;
-};
-
-void register_displaystate(DisplayState *ds);
-DisplayState *get_displaystate(void);
+DisplayState *init_displaystate(void);
DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
int linesize, uint8_t *data,
bool byteswap);
@@ -217,16 +206,15 @@ static inline int is_buffer_shared(DisplaySurface *surface)
return !(surface->flags & QEMU_ALLOCATED_FLAG);
}
-void gui_setup_refresh(DisplayState *ds);
-
void register_displaychangelistener(DisplayState *ds,
DisplayChangeListener *dcl);
+void update_displaychangelistener(DisplayChangeListener *dcl,
+ uint64_t interval);
void unregister_displaychangelistener(DisplayChangeListener *dcl);
void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_gfx_replace_surface(QemuConsole *con,
DisplaySurface *surface);
-void dpy_refresh(DisplayState *s);
void dpy_gfx_copy(QemuConsole *con, int src_x, int src_y,
int dst_x, int dst_y, int w, int h);
void dpy_text_cursor(QemuConsole *con, int x, int y);
@@ -281,24 +269,25 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
*dest = ch;
}
-typedef void (*vga_hw_update_ptr)(void *);
-typedef void (*vga_hw_invalidate_ptr)(void *);
-typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch,
- Error **errp);
-typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
+typedef struct GraphicHwOps {
+ void (*invalidate)(void *opaque);
+ void (*gfx_update)(void *opaque);
+ void (*text_update)(void *opaque, console_ch_t *text);
+ void (*update_interval)(void *opaque, uint64_t interval);
+} GraphicHwOps;
-QemuConsole *graphic_console_init(vga_hw_update_ptr update,
- vga_hw_invalidate_ptr invalidate,
- vga_hw_screen_dump_ptr screen_dump,
- vga_hw_text_update_ptr text_update,
+QemuConsole *graphic_console_init(const GraphicHwOps *ops,
void *opaque);
-void vga_hw_update(void);
-void vga_hw_invalidate(void);
-void vga_hw_text_update(console_ch_t *chardata);
+void graphic_hw_update(QemuConsole *con);
+void graphic_hw_invalidate(QemuConsole *con);
+void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);
+
+QemuConsole *qemu_console_lookup_by_index(unsigned int index);
+bool qemu_console_is_visible(QemuConsole *con);
+bool qemu_console_is_graphic(QemuConsole *con);
+bool qemu_console_is_fixedsize(QemuConsole *con);
-int is_graphic_console(void);
-int is_fixedsize_console(void);
void text_consoles_set_display(DisplayState *ds);
void console_select(unsigned int index);
void console_color_init(DisplayState *ds);
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index b032f529aa..f012ec5fc3 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -43,4 +43,13 @@ pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
pixman_image_t *image);
void qemu_pixman_image_unref(pixman_image_t *image);
+pixman_color_t qemu_pixman_color(PixelFormat *pf, uint32_t color);
+pixman_image_t *qemu_pixman_glyph_from_vgafont(int height, const uint8_t *font,
+ unsigned int ch);
+void qemu_pixman_glyph_render(pixman_image_t *glyph,
+ pixman_image_t *surface,
+ pixman_color_t *fgcol,
+ pixman_color_t *bgcol,
+ int x, int y, int cw, int ch);
+
#endif /* QEMU_PIXMAN_H */
diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h
index 7a20fc43ff..a46bc80019 100644
--- a/include/ui/spice-display.h
+++ b/include/ui/spice-display.h
@@ -71,7 +71,6 @@ typedef struct SimpleSpiceDisplay SimpleSpiceDisplay;
typedef struct SimpleSpiceUpdate SimpleSpiceUpdate;
struct SimpleSpiceDisplay {
- QemuConsole *con;
DisplaySurface *ds;
DisplayChangeListener dcl;
void *buf;