mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 16:48:06 +00:00
qxl: Release QXL resources in red_put_update_cmd
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
5840ba2a89
commit
74663be7fc
@ -1268,8 +1268,9 @@ void red_drawable_unref(RedDrawable *red_drawable)
|
||||
g_free(red_drawable);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@ -1277,10 +1278,10 @@ bool red_get_update_cmd(RedMemSlotInfo *slots, int group_id,
|
||||
if (qxl == NULL) {
|
||||
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;
|
||||
@ -1289,7 +1290,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,
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -215,7 +215,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;
|
||||
}
|
||||
@ -225,7 +225,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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user