[Spice-devel] [PATCH 2/2] fixup! Add DisplayChannelPrivate struct
Frediano Ziglio
fziglio at redhat.com
Fri Sep 16 09:39:21 UTC 2016
Remove added FIXME introducing an helper function.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/display-channel.c | 12 ++++++++++++
server/display-channel.h | 2 ++
server/red-worker.c | 16 ++--------------
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/server/display-channel.c b/server/display-channel.c
index d193925..6682d77 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -2099,3 +2099,15 @@ void display_channel_reset_image_cache(DisplayChannel *self)
{
image_cache_reset(&self->priv->image_cache);
}
+
+void display_channel_debug_oom(DisplayChannel *display, const char *msg)
+{
+ RedChannel *channel = RED_CHANNEL(display);
+
+ spice_debug("%s #draw=%u, #glz_draw=%u current %u pipes %u",
+ msg,
+ display->priv->drawable_count,
+ display->priv->encoder_shared_data.glz_drawable_count,
+ display->priv->current_size,
+ red_channel_sum_pipes_size(channel));
+}
diff --git a/server/display-channel.h b/server/display-channel.h
index ce5d419..ab344fa 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -306,6 +306,8 @@ void set_monitors_config_to_primary(DisplayChannel *display);
gboolean display_channel_validate_surface(DisplayChannel *display, uint32_t surface_id);
void display_channel_reset_image_cache(DisplayChannel *self);
+void display_channel_debug_oom(DisplayChannel *display, const char *msg);
+
static inline int is_equal_path(SpicePath *path1, SpicePath *path2)
{
SpicePathSeg *seg1, *seg2;
diff --git a/server/red-worker.c b/server/red-worker.c
index 92ab59c..2cde7fd 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -773,13 +773,7 @@ static void handle_dev_oom(void *opaque, void *payload)
spice_return_if_fail(worker->running);
// streams? but without streams also leak
-#if FIXME
- spice_debug("OOM1 #draw=%u, #glz_draw=%u current %u pipes %u",
- display->drawable_count,
- display->encoder_shared_data.glz_drawable_count,
- display->current_size,
- red_channel_sum_pipes_size(display_red_channel));
-#endif
+ display_channel_debug_oom(display, "OOM1");
while (red_process_display(worker, &ring_is_empty)) {
red_channel_push(display_red_channel);
}
@@ -787,13 +781,7 @@ static void handle_dev_oom(void *opaque, void *payload)
display_channel_free_some(worker->display_channel);
red_qxl_flush_resources(worker->qxl);
}
-#if FIXME
- spice_debug("OOM2 #draw=%u, #glz_draw=%u current %u pipes %u",
- display->drawable_count,
- display->encoder_shared_data.glz_drawable_count,
- display->current_size,
- red_channel_sum_pipes_size(display_red_channel));
-#endif
+ display_channel_debug_oom(display, "OOM2");
red_qxl_clear_pending(worker->qxl->st, RED_DISPATCHER_PENDING_OOM);
}
--
2.7.4
More information about the Spice-devel
mailing list