We're now always sending the number monitors that we received from all the display channels' monitors_configs, so this check no longer makes sense. Signed-off-by: Lukáš Hrázký <lhrazky@xxxxxxxxxx> --- src/channel-main.c | 22 +--------------------- src/spice-session-priv.h | 3 +-- src/spice-session.c | 13 +------------ 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/src/channel-main.c b/src/channel-main.c index 085990c..040f4a8 100644 --- a/src/channel-main.c +++ b/src/channel-main.c @@ -1489,8 +1489,6 @@ static gboolean timer_set_display(gpointer data) { SpiceMainChannel *channel = data; SpiceMainChannelPrivate *c = channel->priv; - SpiceSession *session; - gint i; c->timer_id = 0; if (!c->agent_connected) @@ -1501,24 +1499,6 @@ static gboolean timer_set_display(gpointer data) return FALSE; } - session = spice_channel_get_session(SPICE_CHANNEL(channel)); - GArray *monitor_configs = spice_session_get_monitor_configs(session); - - if (!spice_main_channel_agent_test_capability(channel, VD_AGENT_CAP_SPARSE_MONITORS_CONFIG)) { - /* ensure we have an explicit monitor configuration at least for - number of display channels */ - - guint n_display_channels = spice_session_get_n_display_channels(session); - if (n_display_channels < monitor_configs->len) { - SPICE_DEBUG("Not sending monitors config, missing monitors"); - return FALSE; - } - for (i = 0; i < n_display_channels; i++) - if (g_array_index(monitor_configs, SpiceMonitorConfig, i).display_state == DISPLAY_UNDEFINED) { - SPICE_DEBUG("Not sending monitors config, missing monitors"); - return FALSE; - } - } spice_main_channel_send_monitor_config(channel); return FALSE; @@ -1672,7 +1652,7 @@ static void main_handle_init(SpiceChannel *channel, SpiceMsgIn *in) init->current_mouse_mode); spice_session_set_mm_time(session, init->multi_media_time); - spice_session_set_caches_hints(session, init->ram_hint, init->display_channels_hint); + spice_session_set_caches_hints(session, init->ram_hint); c->agent_tokens = init->agent_tokens; if (init->agent_connected) diff --git a/src/spice-session-priv.h b/src/spice-session-priv.h index 77cb8c6..4eb6fce 100644 --- a/src/spice-session-priv.h +++ b/src/spice-session-priv.h @@ -71,8 +71,7 @@ const gchar* spice_session_get_ca_file(SpiceSession *session); void spice_session_get_ca(SpiceSession *session, guint8 **ca, guint *size); void spice_session_set_caches_hints(SpiceSession *session, - uint32_t pci_ram_size, - uint32_t n_display_channels); + uint32_t pci_ram_size); void spice_session_get_caches(SpiceSession *session, display_cache **images, SpiceGlzDecoderWindow **glz_window); diff --git a/src/spice-session.c b/src/spice-session.c index 29a4c69..cea8fdf 100644 --- a/src/spice-session.c +++ b/src/spice-session.c @@ -118,7 +118,6 @@ struct _SpiceSessionPrivate { int images_cache_size; int glz_window_size; uint32_t pci_ram_size; - uint32_t n_display_channels; guint8 uuid[16]; gchar *name; SpiceImageCompression preferred_compression; @@ -2532,15 +2531,13 @@ void spice_session_get_caches(SpiceSession *session, G_GNUC_INTERNAL void spice_session_set_caches_hints(SpiceSession *session, - uint32_t pci_ram_size, - uint32_t n_display_channels) + uint32_t pci_ram_size) { g_return_if_fail(SPICE_IS_SESSION(session)); SpiceSessionPrivate *s = session->priv; s->pci_ram_size = pci_ram_size; - s->n_display_channels = n_display_channels; /* TODO: when setting cache and window size, we should consider the client's * available memory and the number of display channels */ @@ -2554,14 +2551,6 @@ void spice_session_set_caches_hints(SpiceSession *session, } } -G_GNUC_INTERNAL -guint spice_session_get_n_display_channels(SpiceSession *session) -{ - g_return_val_if_fail(session != NULL, 0); - - return session->priv->n_display_channels; -} - G_GNUC_INTERNAL void spice_session_set_uuid(SpiceSession *session, guint8 uuid[16]) { -- 2.18.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel