server: Extract finish_fb_update() from on_client_update_fb_done()

tight-scheduling-fix
Andri Yngvason 2020-09-26 22:29:02 +00:00
parent add8d8e8db
commit 9e84000e0a
1 changed files with 12 additions and 7 deletions

View File

@ -1133,14 +1133,8 @@ static void do_client_update_fb(void* work)
}
}
static void on_client_update_fb_done(void* work)
static void finish_fb_update(struct nvnc_client* client, struct vec* frame)
{
struct fb_update_work* update = aml_get_userdata(work);
struct nvnc_client* client = update->client;
struct vec* frame = &update->frame;
nvnc_fb_unref(update->fb);
client_ref(client);
if (client->net_stream->state != STREAM_STATE_CLOSED) {
@ -1158,6 +1152,17 @@ static void on_client_update_fb_done(void* work)
client->n_pending_requests--;
DTRACE_PROBE1(neatvnc, update_fb_done, client);
}
static void on_client_update_fb_done(void* work)
{
struct fb_update_work* update = aml_get_userdata(work);
struct nvnc_client* client = update->client;
struct vec* frame = &update->frame;
nvnc_fb_unref(update->fb);
finish_fb_update(client, frame);
pixman_region_fini(&update->region);