Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx> --- server/red-parse-qxl.c | 11 +++++++---- server/red-parse-qxl.h | 3 ++- server/red-worker.c | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c index dfa362b47..919f928e6 100644 --- a/server/red-parse-qxl.c +++ b/server/red-parse-qxl.c @@ -1242,8 +1242,9 @@ static void red_put_drawable(RedDrawable *red) } } -bool red_get_update_cmd(RedMemSlotInfo *slots, int group_id, - RedUpdateCmd *red, QXLPHYSICAL addr) +bool red_get_update_cmd(QXLInstance *qxl_instance, RedMemSlotInfo *slots, + int group_id, RedUpdateCmd *red, + QXLPHYSICAL addr) { QXLUpdateCmd *qxl; int error; @@ -1252,10 +1253,10 @@ bool red_get_update_cmd(RedMemSlotInfo *slots, int group_id, if (error) { return false; } + red->qxl = qxl_instance; red->release_info_ext.info = &qxl->release_info; red->release_info_ext.group_id = group_id; - red_get_rect_ptr(&red->area, &qxl->area); red->update_id = qxl->update_id; red->surface_id = qxl->surface_id; @@ -1264,7 +1265,9 @@ bool red_get_update_cmd(RedMemSlotInfo *slots, int group_id, void red_put_update_cmd(RedUpdateCmd *red) { - /* nothing yet */ + if (red->qxl != NULL) { + red_qxl_release_resource(red->qxl, red->release_info_ext); + } } static bool red_get_message(QXLInstance *qxl_instance, RedMemSlotInfo *slots, int group_id, diff --git a/server/red-parse-qxl.h b/server/red-parse-qxl.h index fad144071..f9013161d 100644 --- a/server/red-parse-qxl.h +++ b/server/red-parse-qxl.h @@ -60,6 +60,7 @@ typedef struct RedDrawable { } RedDrawable; typedef struct RedUpdateCmd { + QXLInstance *qxl; QXLReleaseInfoExt release_info_ext; SpiceRect area; uint32_t update_id; @@ -119,7 +120,7 @@ RedDrawable *red_drawable_new(QXLInstance *qxl, RedMemSlotInfo *slots, RedDrawable *red_drawable_ref(RedDrawable *drawable); void red_drawable_unref(RedDrawable *red_drawable); -bool red_get_update_cmd(RedMemSlotInfo *slots, int group_id, +bool red_get_update_cmd(QXLInstance *qxl, RedMemSlotInfo *slots, int group_id, RedUpdateCmd *red, QXLPHYSICAL addr); void red_put_update_cmd(RedUpdateCmd *red); diff --git a/server/red-worker.c b/server/red-worker.c index b19763118..194f4f95c 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -222,7 +222,7 @@ static int red_process_display(RedWorker *worker, int *ring_is_empty) case QXL_CMD_UPDATE: { RedUpdateCmd update; - if (!red_get_update_cmd(&worker->mem_slots, ext_cmd.group_id, + if (!red_get_update_cmd(worker->qxl, &worker->mem_slots, ext_cmd.group_id, &update, ext_cmd.cmd.data)) { break; } @@ -232,7 +232,6 @@ static int red_process_display(RedWorker *worker, int *ring_is_empty) display_channel_draw(worker->display_channel, &update.area, update.surface_id); red_qxl_notify_update(worker->qxl, update.update_id); } - red_qxl_release_resource(worker->qxl, update.release_info_ext); red_put_update_cmd(&update); break; } -- 2.14.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel