[Spice-commits] 2 commits - server/display-channel.c server/main-channel-client.c server/reds-private.h server/reds.c server/stat.h server/stream.c server/stream.h
Frediano Ziglio
fziglio at kemper.freedesktop.org
Tue Sep 27 13:25:59 UTC 2016
server/display-channel.c | 2 +-
server/main-channel-client.c | 3 ---
server/reds-private.h | 1 -
server/reds.c | 13 -------------
server/stat.h | 1 -
server/stream.c | 14 +++++++-------
server/stream.h | 2 +-
7 files changed, 9 insertions(+), 27 deletions(-)
New commits:
commit a874ebadff3545bf0804119ed28c7a97f04ddccf
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Sep 27 13:41:54 2016 +0100
Rename detach_stream to stream_detach_drawable and removed unused argument
This function deal only with Stream.
Also the name was misleading and was not clear if it detached the stream
from the DisplayChannel.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/server/display-channel.c b/server/display-channel.c
index 1547505..c704341 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1354,7 +1354,7 @@ void drawable_unref(Drawable *drawable)
spice_warn_if_fail(drawable->pipes == NULL);
if (drawable->stream) {
- detach_stream(display, drawable->stream);
+ stream_detach_drawable(drawable->stream);
}
region_destroy(&drawable->tree_item.base.rgn);
diff --git a/server/stream.c b/server/stream.c
index 9d878c8..b28c58b 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -320,7 +320,7 @@ static void attach_stream(DisplayChannel *display, Drawable *drawable, Stream *s
}
}
-void detach_stream(DisplayChannel *display, Stream *stream)
+void stream_detach_drawable(Stream *stream)
{
spice_assert(stream->current && stream->current->stream);
spice_assert(stream->current->stream == stream);
@@ -525,7 +525,7 @@ void stream_trace_update(DisplayChannel *display, Drawable *drawable)
if (stream->current) {
stream->current->streamable = FALSE; //prevent item trace
before_reattach_stream(display, stream, drawable);
- detach_stream(display, stream);
+ stream_detach_drawable(stream);
}
attach_stream(display, drawable, stream);
return;
@@ -566,7 +566,7 @@ void stream_maintenance(DisplayChannel *display,
stream, TRUE);
if (is_next_frame) {
before_reattach_stream(display, stream, candidate);
- detach_stream(display, stream);
+ stream_detach_drawable(stream);
prev->streamable = FALSE; //prevent item trace
attach_stream(display, candidate, stream);
}
@@ -834,7 +834,7 @@ static void red_upgrade_item_free(RedPipeItem *base)
/*
* after dcc_detach_stream_gracefully is called for all the display channel clients,
- * detach_stream should be called. See comment (1).
+ * stream_detach_drawable should be called. See comment (1).
*/
static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
Stream *stream,
@@ -910,7 +910,7 @@ static void detach_stream_gracefully(DisplayChannel *display, Stream *stream,
dcc_detach_stream_gracefully(dcc, stream, update_area_limit);
}
if (stream->current) {
- detach_stream(display, stream);
+ stream_detach_drawable(stream);
}
}
@@ -947,11 +947,11 @@ void stream_detach_behind(DisplayChannel *display, QRegion *region, Drawable *dr
}
}
if (detach && stream->current) {
- detach_stream(display, stream);
+ stream_detach_drawable(stream);
} else if (!is_connected) {
if (stream->current &&
region_intersects(&stream->current->tree_item.base.rgn, region)) {
- detach_stream(display, stream);
+ stream_detach_drawable(stream);
}
}
}
diff --git a/server/stream.h b/server/stream.h
index 053b23d..77223c8 100644
--- a/server/stream.h
+++ b/server/stream.h
@@ -154,6 +154,6 @@ void stream_agent_unref (DisplayChan
StreamAgent *agent);
void stream_agent_stop (StreamAgent *agent);
-void detach_stream(DisplayChannel *display, Stream *stream);
+void stream_detach_drawable(Stream *stream);
#endif /* STREAM_H */
commit ae01c6d4bc41069b5bc00ca909c91c5e80eee948
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Mon Sep 26 09:05:25 2016 +0100
Removed only written roundtrip_stat field
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
diff --git a/server/main-channel-client.c b/server/main-channel-client.c
index 693e832..2390784 100644
--- a/server/main-channel-client.c
+++ b/server/main-channel-client.c
@@ -393,9 +393,6 @@ void main_channel_client_handle_pong(MainChannelClient *mcc, SpiceMsgPing *ping,
* channel client monitors the connectivity using ping-pong messages
*/
red_channel_client_handle_message(rcc, size, SPICE_MSGC_PONG, ping);
-#ifdef RED_STATISTICS
- stat_update_value(red_channel_client_get_channel(rcc)->reds, roundtrip);
-#endif
return;
}
diff --git a/server/reds-private.h b/server/reds-private.h
index a044a57..36ef6c0 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -140,7 +140,6 @@ struct RedsState {
char *stat_shm_name;
SpiceStat *stat;
pthread_mutex_t stat_lock;
- RedsStatValue roundtrip_stat;
#endif
int allow_multiple_clients;
diff --git a/server/reds.c b/server/reds.c
index 5463700..8dff12d 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -451,19 +451,6 @@ void stat_remove_counter(RedsState *reds, uint64_t *counter)
{
reds_stat_remove(reds, (SpiceStatNode *)(counter - SPICE_OFFSETOF(SpiceStatNode, value)));
}
-
-void stat_update_value(RedsState *reds, uint32_t value)
-{
- RedsStatValue *stat_value = &reds->roundtrip_stat;
-
- stat_value->value = value;
- stat_value->min = (stat_value->count ? MIN(stat_value->min, value) : value);
- stat_value->max = MAX(stat_value->max, value);
- stat_value->average = (stat_value->average * stat_value->count + value) /
- (stat_value->count + 1);
- stat_value->count++;
-}
-
#endif
void reds_register_channel(RedsState *reds, RedChannel *channel)
diff --git a/server/stat.h b/server/stat.h
index f6f7a04..7bf90da 100644
--- a/server/stat.h
+++ b/server/stat.h
@@ -31,7 +31,6 @@ StatNodeRef stat_add_node(SpiceServer *reds, StatNodeRef parent, const char *nam
void stat_remove_node(SpiceServer *reds, StatNodeRef node);
uint64_t *stat_add_counter(SpiceServer *reds, StatNodeRef parent, const char *name, int visible);
void stat_remove_counter(SpiceServer *reds, uint64_t *counter);
-void stat_update_value(SpiceServer *reds, uint32_t value);
#define stat_inc_counter(reds, counter, value) { \
if (counter) { \
More information about the Spice-commits
mailing list