mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-28 08:01:26 +00:00
dcc: move id from CommonChannelClient to DisplayChannelClient
Was not used by CursorChannelClient but only by DisplayChannelClient. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
1438b7ccf2
commit
0ebd3b0d04
@ -61,9 +61,9 @@ static int dcc_pixmap_cache_unlocked_hit(DisplayChannelClient *dcc, uint64_t id,
|
||||
if (item->id == id) {
|
||||
ring_remove(&item->lru_link);
|
||||
ring_add(&cache->lru, &item->lru_link);
|
||||
spice_assert(dcc->common.id < MAX_CACHE_CLIENTS);
|
||||
item->sync[dcc->common.id] = serial;
|
||||
cache->sync[dcc->common.id] = serial;
|
||||
spice_assert(dcc->id < MAX_CACHE_CLIENTS);
|
||||
item->sync[dcc->id] = serial;
|
||||
cache->sync[dcc->id] = serial;
|
||||
*lossy = item->lossy;
|
||||
break;
|
||||
}
|
||||
@ -1886,13 +1886,13 @@ static void dcc_pixmap_cache_reset(DisplayChannelClient *dcc, SpiceMsgWaitForCha
|
||||
pixmap_cache_clear(cache);
|
||||
|
||||
dcc->pixmap_cache_generation = ++cache->generation;
|
||||
cache->generation_initiator.client = dcc->common.id;
|
||||
cache->generation_initiator.client = dcc->id;
|
||||
cache->generation_initiator.message = serial;
|
||||
cache->sync[dcc->common.id] = serial;
|
||||
cache->sync[dcc->id] = serial;
|
||||
|
||||
wait_count = 0;
|
||||
for (i = 0; i < MAX_CACHE_CLIENTS; i++) {
|
||||
if (cache->sync[i] && i != dcc->common.id) {
|
||||
if (cache->sync[i] && i != dcc->id) {
|
||||
sync_data->wait_list[wait_count].channel_type = SPICE_CHANNEL_DISPLAY;
|
||||
sync_data->wait_list[wait_count].channel_id = i;
|
||||
sync_data->wait_list[wait_count++].message_serial = cache->sync[i];
|
||||
@ -2341,7 +2341,7 @@ static void begin_send_message(RedChannelClient *rcc)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_CACHE_CLIENTS; i++) {
|
||||
if (i != dcc->common.id && free_list->sync[i] != 0) {
|
||||
if (i != dcc->id && free_list->sync[i] != 0) {
|
||||
free_list->wait.header.wait_list[sync_count].channel_type = SPICE_CHANNEL_DISPLAY;
|
||||
free_list->wait.header.wait_list[sync_count].channel_id = i;
|
||||
free_list->wait.header.wait_list[sync_count++].message_serial = free_list->sync[i];
|
||||
|
||||
15
server/dcc.c
15
server/dcc.c
@ -373,6 +373,7 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
|
||||
client, stream, mig_target, TRUE,
|
||||
common_caps, num_common_caps,
|
||||
caps, num_caps);
|
||||
dcc->id = display->common.qxl->id;
|
||||
spice_return_val_if_fail(dcc, NULL);
|
||||
spice_info("New display (client %p) dcc %p stream %p", client, dcc, stream);
|
||||
|
||||
@ -424,8 +425,8 @@ static int display_channel_client_wait_for_init(DisplayChannelClient *dcc)
|
||||
if (dcc->pixmap_cache && dcc->glz_dict) {
|
||||
dcc->pixmap_cache_generation = dcc->pixmap_cache->generation;
|
||||
/* TODO: move common.id? if it's used for a per client structure.. */
|
||||
spice_info("creating encoder with id == %d", dcc->common.id);
|
||||
dcc->glz = glz_encoder_create(dcc->common.id, dcc->glz_dict->dict, &dcc->glz_data.usr);
|
||||
spice_info("creating encoder with id == %d", dcc->id);
|
||||
dcc->glz = glz_encoder_create(dcc->id, dcc->glz_dict->dict, &dcc->glz_data.usr);
|
||||
if (!dcc->glz) {
|
||||
spice_critical("create global lz failed");
|
||||
}
|
||||
@ -1280,7 +1281,7 @@ int dcc_pixmap_cache_unlocked_add(DisplayChannelClient *dcc, uint64_t id,
|
||||
NewCacheItem **now;
|
||||
|
||||
if (!(tail = (NewCacheItem *)ring_get_tail(&cache->lru)) ||
|
||||
tail->sync[dcc->common.id] == serial) {
|
||||
tail->sync[dcc->id] == serial) {
|
||||
cache->available += size;
|
||||
free(item);
|
||||
return FALSE;
|
||||
@ -1298,7 +1299,7 @@ int dcc_pixmap_cache_unlocked_add(DisplayChannelClient *dcc, uint64_t id,
|
||||
ring_remove(&tail->lru_link);
|
||||
cache->items--;
|
||||
cache->available += tail->size;
|
||||
cache->sync[dcc->common.id] = serial;
|
||||
cache->sync[dcc->id] = serial;
|
||||
dcc_push_release(dcc, SPICE_RES_TYPE_PIXMAP, tail->id, tail->sync);
|
||||
free(tail);
|
||||
}
|
||||
@ -1311,8 +1312,8 @@ int dcc_pixmap_cache_unlocked_add(DisplayChannelClient *dcc, uint64_t id,
|
||||
item->size = size;
|
||||
item->lossy = lossy;
|
||||
memset(item->sync, 0, sizeof(item->sync));
|
||||
item->sync[dcc->common.id] = serial;
|
||||
cache->sync[dcc->common.id] = serial;
|
||||
item->sync[dcc->id] = serial;
|
||||
cache->sync[dcc->id] = serial;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1526,7 +1527,7 @@ int dcc_handle_migrate_data(DisplayChannelClient *dcc, uint32_t size, void *mess
|
||||
|
||||
if (dcc_handle_migrate_glz_dictionary(dcc, migrate_data)) {
|
||||
dcc->glz =
|
||||
glz_encoder_create(dcc->common.id, dcc->glz_dict->dict, &dcc->glz_data.usr);
|
||||
glz_encoder_create(dcc->id, dcc->glz_dict->dict, &dcc->glz_data.usr);
|
||||
} else {
|
||||
spice_critical("restoring global lz dictionary failed");
|
||||
}
|
||||
|
||||
@ -56,6 +56,7 @@ typedef struct FreeList {
|
||||
|
||||
struct DisplayChannelClient {
|
||||
CommonChannelClient common;
|
||||
uint32_t id;
|
||||
SpiceImageCompression image_compression;
|
||||
spice_wan_compression_t jpeg_state;
|
||||
spice_wan_compression_t zlib_glz_state;
|
||||
|
||||
@ -457,7 +457,6 @@ CommonChannelClient *common_channel_new_client(CommonChannel *common,
|
||||
return NULL;
|
||||
}
|
||||
CommonChannelClient *common_cc = (CommonChannelClient*)rcc;
|
||||
common_cc->id = common->qxl->id;
|
||||
common->during_target_migrate = mig_target;
|
||||
|
||||
// TODO: move wide/narrow ack setting to red_channel.
|
||||
|
||||
@ -27,7 +27,6 @@ typedef struct RedWorker RedWorker;
|
||||
typedef struct CommonChannelClient {
|
||||
RedChannelClient base;
|
||||
|
||||
uint32_t id;
|
||||
int is_low_bandwidth;
|
||||
} CommonChannelClient;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user