summaryrefslogtreecommitdiffstats
path: root/server/display-channel.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2015-11-03 14:35:31 -0600
committerFrediano Ziglio <fziglio@redhat.com>2015-11-04 13:03:53 +0000
commit5f1bdb2166f60e3b4dfccf105022f9968e5e8414 (patch)
tree9a58df602e5b337dabe6cb9962ec698f00cfc8aa /server/display-channel.h
parent3cc2513d33c19875711c651a18eb5ae4bdb7fa96 (diff)
downloadspice-5f1bdb2166f60e3b4dfccf105022f9968e5e8414.tar.gz
spice-5f1bdb2166f60e3b4dfccf105022f9968e5e8414.tar.xz
spice-5f1bdb2166f60e3b4dfccf105022f9968e5e8414.zip
worker: Move some dpi code to display channel
This commit moves some DrawablePipeItem declarations to display-channel.h, though the function implementations remain in red_worker.c until they can be disentangled some more. Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'server/display-channel.h')
-rw-r--r--server/display-channel.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/server/display-channel.h b/server/display-channel.h
index c9ea2700..c4c55ff7 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -53,8 +53,10 @@
#include "spice_bitmap_utils.h"
#include "spice_image_cache.h"
#include "utils.h"
+#include "tree.h"
typedef struct DisplayChannel DisplayChannel;
+typedef struct DisplayChannelClient DisplayChannelClient;
typedef struct Drawable Drawable;
@@ -143,6 +145,40 @@ struct Stream {
uint32_t input_fps;
};
+typedef struct DependItem {
+ Drawable *drawable;
+ RingItem ring_item;
+} DependItem;
+
+struct Drawable {
+ uint8_t refs;
+ RingItem surface_list_link;
+ RingItem list_link;
+ DrawItem tree_item;
+ Ring pipes;
+ PipeItem *pipe_item_rest;
+ uint32_t size_pipe_item_rest;
+ RedDrawable *red_drawable;
+
+ Ring glz_ring;
+
+ red_time_t creation_time;
+ int frames_count;
+ int gradual_frames_count;
+ int last_gradual_frame;
+ Stream *stream;
+ Stream *sized_stream;
+ int streamable;
+ BitmapGradualType copy_bitmap_graduality;
+ uint32_t group_id;
+ DependItem depend_items[3];
+
+ int surface_id;
+ int surfaces_dest[3];
+
+ uint32_t process_commands_generation;
+};
+
#define STREAM_STATS
#ifdef STREAM_STATS
typedef struct StreamStats {
@@ -228,6 +264,30 @@ struct DisplayChannelClient {
uint64_t streams_max_bit_rate;
};
+#define DCC_TO_WORKER(dcc) \
+ (SPICE_CONTAINEROF((dcc)->common.base.channel, CommonChannel, base)->worker)
+#define DCC_TO_DC(dcc) SPICE_CONTAINEROF((dcc)->common.base.channel, \
+ DisplayChannel, common.base)
+#define RCC_TO_DCC(rcc) SPICE_CONTAINEROF((rcc), DisplayChannelClient, common.base)
+
+
+enum {
+ PIPE_ITEM_TYPE_DRAW = PIPE_ITEM_TYPE_COMMON_LAST,
+ PIPE_ITEM_TYPE_IMAGE,
+ PIPE_ITEM_TYPE_STREAM_CREATE,
+ PIPE_ITEM_TYPE_STREAM_CLIP,
+ PIPE_ITEM_TYPE_STREAM_DESTROY,
+ PIPE_ITEM_TYPE_UPGRADE,
+ PIPE_ITEM_TYPE_MIGRATE_DATA,
+ PIPE_ITEM_TYPE_PIXMAP_SYNC,
+ PIPE_ITEM_TYPE_PIXMAP_RESET,
+ PIPE_ITEM_TYPE_INVAL_PALETTE_CACHE,
+ PIPE_ITEM_TYPE_CREATE_SURFACE,
+ PIPE_ITEM_TYPE_DESTROY_SURFACE,
+ PIPE_ITEM_TYPE_MONITORS_CONFIG,
+ PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT,
+};
+
DisplayChannelClient* dcc_new (DisplayChannel *display,
RedClient *client,
RedsStream *stream,
@@ -237,6 +297,19 @@ DisplayChannelClient* dcc_new (DisplayCha
uint32_t *caps,
int num_caps);
+typedef struct DrawablePipeItem {
+ RingItem base; /* link for a list of pipe items held by Drawable */
+ PipeItem dpi_pipe_item; /* link for the client's pipe itself */
+ Drawable *drawable;
+ DisplayChannelClient *dcc;
+ uint8_t refs;
+} DrawablePipeItem;
+
+DrawablePipeItem* drawable_pipe_item_new (DisplayChannelClient *dcc,
+ Drawable *drawable);
+void drawable_pipe_item_unref (DrawablePipeItem *dpi);
+DrawablePipeItem* drawable_pipe_item_ref (DrawablePipeItem *dpi);
+
typedef struct MonitorsConfig {
int refs;
int count;