[Spice-commits] 2 commits - server/display-channel.c server/display-channel.h server/red_worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Mon Nov 16 04:46:17 PST 2015
server/display-channel.c | 15 +++++++++++++++
server/display-channel.h | 2 ++
server/red_worker.c | 38 +++++++++++---------------------------
3 files changed, 28 insertions(+), 27 deletions(-)
New commits:
commit 1e8b2fe324b7d5afacc2652cffe22eab65f7b2c6
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Fri Nov 13 10:29:12 2015 -0600
worker: Rename current_clear() to current_remove_all()
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/red_worker.c b/server/red_worker.c
index 3d067c8..f8df837 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1050,7 +1050,7 @@ static inline void current_remove(RedWorker *worker, TreeItem *item)
}
}
-static void red_current_clear(RedWorker *worker, int surface_id)
+static void current_remove_all(RedWorker *worker, int surface_id)
{
RingItem *ring_item;
@@ -2844,10 +2844,10 @@ static inline void red_process_surface(RedWorker *worker, RedSurfaceCmd *surface
}
set_surface_release_info(&red_surface->destroy, surface->release_info, group_id);
red_handle_depends_on_target_surface(worker, surface_id);
- /* note that red_handle_depends_on_target_surface must be called before red_current_clear.
+ /* note that red_handle_depends_on_target_surface must be called before current_remove_all.
otherwise "current" will hold items that other drawables may depend on, and then
- red_current_clear will remove them from the pipe. */
- red_current_clear(worker, surface_id);
+ current_remove_all will remove them from the pipe. */
+ current_remove_all(worker, surface_id);
red_clear_surface_drawables_from_pipes(worker, surface_id, FALSE);
red_surface_unref(worker, surface_id);
break;
@@ -3393,7 +3393,7 @@ static void red_current_flush(RedWorker *worker, int surface_id)
while (!ring_is_empty(&worker->surfaces[surface_id].current_list)) {
free_one_drawable(worker, FALSE);
}
- red_current_clear(worker, surface_id);
+ current_remove_all(worker, surface_id);
}
// adding the pipe item after pos. If pos == NULL, adding to head.
@@ -8819,10 +8819,10 @@ static inline void destroy_surface_wait(RedWorker *worker, int surface_id)
}
red_handle_depends_on_target_surface(worker, surface_id);
- /* note that red_handle_depends_on_target_surface must be called before red_current_clear.
+ /* note that red_handle_depends_on_target_surface must be called before current_remove_all.
otherwise "current" will hold items that other drawables may depend on, and then
- red_current_clear will remove them from the pipe. */
- red_current_clear(worker, surface_id);
+ current_remove_all will remove them from the pipe. */
+ current_remove_all(worker, surface_id);
red_clear_surface_drawables_from_pipes(worker, surface_id, TRUE);
}
commit e49072492a9f08d2aa07e103fc8f77a8bb13a64f
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Fri Nov 13 10:29:11 2015 -0600
Move dcc_push_stream_agent_clip() to display channel
rename to dcc_add_stream_agent_clip()
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/display-channel.c b/server/display-channel.c
index 51302bd..63d56b4 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -141,6 +141,21 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
return dcc;
}
+void dcc_add_stream_agent_clip(DisplayChannelClient* dcc, StreamAgent *agent)
+{
+ StreamClipItem *item = stream_clip_item_new(dcc, agent);
+ int n_rects;
+
+ item->clip_type = SPICE_CLIP_TYPE_RECTS;
+
+ n_rects = pixman_region32_n_rects(&agent->clip);
+ item->rects = spice_malloc_n_m(n_rects, sizeof(SpiceRect), sizeof(SpiceClipRects));
+ item->rects->num_rects = n_rects;
+ region_ret_rects(&agent->clip, item->rects->rects, n_rects);
+
+ red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), (PipeItem *)item);
+}
+
MonitorsConfig* monitors_config_ref(MonitorsConfig *monitors_config)
{
monitors_config->refs++;
diff --git a/server/display-channel.h b/server/display-channel.h
index a9ae40a..d33f72c 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -246,6 +246,8 @@ DisplayChannelClient* dcc_new (DisplayCha
void dcc_push_monitors_config (DisplayChannelClient *dcc);
void dcc_push_destroy_surface (DisplayChannelClient *dcc,
uint32_t surface_id);
+void dcc_add_stream_agent_clip (DisplayChannelClient* dcc,
+ StreamAgent *agent);
typedef struct DrawablePipeItem {
RingItem base; /* link for a list of pipe items held by Drawable */
diff --git a/server/red_worker.c b/server/red_worker.c
index 165e4c0..3d067c8 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -393,22 +393,6 @@ static void display_stream_clip_unref(DisplayChannel *display, StreamClipItem *i
free(item);
}
-static void dcc_push_stream_agent_clip(DisplayChannelClient* dcc, StreamAgent *agent)
-{
- StreamClipItem *item = stream_clip_item_new(dcc, agent);
- int n_rects;
-
- item->clip_type = SPICE_CLIP_TYPE_RECTS;
-
- n_rects = pixman_region32_n_rects(&agent->clip);
- item->rects = spice_malloc_n_m(n_rects, sizeof(SpiceRect), sizeof(SpiceClipRects));
- item->rects->num_rects = n_rects;
- region_ret_rects(&agent->clip, item->rects->rects, n_rects);
-
- red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), (PipeItem *)item);
-}
-
-
void attach_stream(DisplayChannel *display, Drawable *drawable, Stream *stream)
{
DisplayChannelClient *dcc;
@@ -445,7 +429,7 @@ void attach_stream(DisplayChannel *display, Drawable *drawable, Stream *stream)
if (!region_is_equal(&clip_in_draw_dest, &drawable->tree_item.base.rgn)) {
region_remove(&agent->clip, &drawable->red_drawable->bbox);
region_or(&agent->clip, &drawable->tree_item.base.rgn);
- dcc_push_stream_agent_clip(dcc, agent);
+ dcc_add_stream_agent_clip(dcc, agent);
}
#ifdef STREAM_STATS
agent->stats.num_input_frames++;
@@ -1388,7 +1372,7 @@ static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
/* stopping the client from playing older frames at once*/
region_clear(&agent->clip);
- dcc_push_stream_agent_clip(dcc, agent);
+ dcc_add_stream_agent_clip(dcc, agent);
if (region_is_empty(&agent->vis_region)) {
spice_debug("stream %d: vis region empty", stream_id);
@@ -1537,7 +1521,7 @@ static void streams_update_visible_region(DisplayChannel *display, Drawable *dra
if (region_intersects(&agent->vis_region, &drawable->tree_item.base.rgn)) {
region_exclude(&agent->vis_region, &drawable->tree_item.base.rgn);
region_exclude(&agent->clip, &drawable->tree_item.base.rgn);
- dcc_push_stream_agent_clip(dcc, agent);
+ dcc_add_stream_agent_clip(dcc, agent);
}
}
}
More information about the Spice-commits
mailing list