From 697f3214fd16adcd524456003619f7f44ddd031b Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Fri, 24 Oct 2014 10:51:05 +0200 Subject: chardev: remove write polling In an effort to reduce the wakeups per second, get rid of the "write_to_dev" timer when the implementation supports SPICE_CHAR_DEVICE_NOTIFY_WRITABLE. When this flag is set, the frontend instance is responsible for calling spice_char_device_wakeup() when the device is ready to perform IO. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=912763 --- server/spice.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/spice.h') diff --git a/server/spice.h b/server/spice.h index 58700d14..bd5bba89 100644 --- a/server/spice.h +++ b/server/spice.h @@ -24,7 +24,7 @@ #include #include -#define SPICE_SERVER_VERSION 0x000c05 /* release 0.12.5 */ +#define SPICE_SERVER_VERSION 0x000c06 /* release 0.12.6 */ #ifdef SPICE_SERVER_INTERNAL #undef SPICE_GNUC_DEPRECATED @@ -402,11 +402,15 @@ void spice_server_set_record_rate(SpiceRecordInstance *sin, uint32_t frequen #define SPICE_INTERFACE_CHAR_DEVICE "char_device" #define SPICE_INTERFACE_CHAR_DEVICE_MAJOR 1 -#define SPICE_INTERFACE_CHAR_DEVICE_MINOR 2 +#define SPICE_INTERFACE_CHAR_DEVICE_MINOR 3 typedef struct SpiceCharDeviceInterface SpiceCharDeviceInterface; typedef struct SpiceCharDeviceInstance SpiceCharDeviceInstance; typedef struct SpiceCharDeviceState SpiceCharDeviceState; +typedef enum { + SPICE_CHAR_DEVICE_NOTIFY_WRITABLE = 1 << 0, +} spice_char_device_flags; + struct SpiceCharDeviceInterface { SpiceBaseInterface base; @@ -414,6 +418,7 @@ struct SpiceCharDeviceInterface { int (*write)(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len); int (*read)(SpiceCharDeviceInstance *sin, uint8_t *buf, int len); void (*event)(SpiceCharDeviceInstance *sin, uint8_t event); + spice_char_device_flags flags; }; struct SpiceCharDeviceInstance { -- cgit