mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-01 04:45:37 +00:00
Move image_compression field from RedWorker to DisplayChannel
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
163b3c39b6
commit
ee5cdb7e2f
@ -87,6 +87,7 @@ struct DisplayChannelPrivate
|
||||
MonitorsConfig *monitors_config;
|
||||
|
||||
uint32_t renderer;
|
||||
SpiceImageCompression image_compression;
|
||||
int enable_jpeg;
|
||||
int enable_zlib_glz_wrap;
|
||||
|
||||
|
||||
@ -2273,6 +2273,7 @@ display_channel_init(DisplayChannel *self)
|
||||
/* must be manually allocated here since g_type_class_add_private() only
|
||||
* supports structs smaller than 64k */
|
||||
self->priv = g_new0(DisplayChannelPrivate, 1);
|
||||
self->priv->image_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
|
||||
self->priv->pub = self;
|
||||
|
||||
image_encoder_shared_init(&self->priv->encoder_shared_data);
|
||||
@ -2611,10 +2612,9 @@ display_channel_connect(RedChannel *channel, RedClient *client,
|
||||
|
||||
spice_debug("connect new client");
|
||||
|
||||
// FIXME not sure how safe is reading directly from reds
|
||||
SpiceServer *reds = red_channel_get_server(channel);
|
||||
dcc = dcc_new(display, client, stream, migration, caps,
|
||||
spice_server_get_image_compression(reds), reds_get_jpeg_state(reds),
|
||||
display->priv->image_compression, reds_get_jpeg_state(reds),
|
||||
reds_get_zlib_glz_state(reds));
|
||||
if (!dcc) {
|
||||
return;
|
||||
@ -2656,3 +2656,9 @@ static void display_channel_migrate(RedChannelClient *rcc)
|
||||
DisplayChannel *display = DISPLAY_CHANNEL(red_channel_client_get_channel(rcc));
|
||||
red_migrate_display(display, rcc);
|
||||
}
|
||||
|
||||
void display_channel_set_image_compression(DisplayChannel *display,
|
||||
SpiceImageCompression image_compression)
|
||||
{
|
||||
display->priv->image_compression = image_compression;
|
||||
}
|
||||
|
||||
@ -159,6 +159,8 @@ void display_channel_reset_image_cache(DisplayChannel *self);
|
||||
void display_channel_debug_oom(DisplayChannel *display, const char *msg);
|
||||
|
||||
void display_channel_update_qxl_running(DisplayChannel *display, bool running);
|
||||
void display_channel_set_image_compression(DisplayChannel *display,
|
||||
SpiceImageCompression image_compression);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@ -76,8 +76,6 @@ struct RedWorker {
|
||||
|
||||
RedMemSlotInfo mem_slots;
|
||||
|
||||
SpiceImageCompression image_compression;
|
||||
|
||||
uint32_t process_display_generation;
|
||||
RedStatNode stat;
|
||||
RedStatCounter wakeup_counter;
|
||||
@ -684,7 +682,7 @@ static void handle_dev_set_compression(void *opaque, void *payload)
|
||||
RedWorker *worker = opaque;
|
||||
SpiceImageCompression image_compression = msg->image_compression;
|
||||
|
||||
worker->image_compression = image_compression;
|
||||
display_channel_set_image_compression(worker->display_channel, image_compression);
|
||||
|
||||
display_channel_compress_stats_print(worker->display_channel);
|
||||
display_channel_compress_stats_reset(worker->display_channel);
|
||||
@ -1078,7 +1076,6 @@ RedWorker* red_worker_new(QXLInstance *qxl)
|
||||
dispatcher_register_universal_handler(dispatcher, worker_dispatcher_record);
|
||||
}
|
||||
|
||||
worker->image_compression = spice_server_get_image_compression(reds);
|
||||
worker->driver_cap_monitors_config = 0;
|
||||
char worker_str[SPICE_STAT_NODE_NAME_MAX];
|
||||
snprintf(worker_str, sizeof(worker_str), "display[%d]", worker->qxl->id & 0xff);
|
||||
@ -1120,6 +1117,8 @@ RedWorker* red_worker_new(QXLInstance *qxl)
|
||||
init_info.n_surfaces);
|
||||
channel = RED_CHANNEL(worker->display_channel);
|
||||
red_channel_init_stat_node(channel, &worker->stat, "display_channel");
|
||||
display_channel_set_image_compression(worker->display_channel,
|
||||
spice_server_get_image_compression(reds));
|
||||
|
||||
return worker;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user