mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
spice: use bottom half instead of refresh timer for cursor updates
Calling directly doesn't work due to the qxl-render code running in spice server thread context. Meanwhile bottom half scheduling is thread-safe though, so we can use that to kick a cursor update in main i/o thread context. Cc: Marc-André Lureau <marcandre.lureau@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
dfa9c2a0f4
commit
0b2824e5e4
4 changed files with 15 additions and 7 deletions
|
@ -438,7 +438,7 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
|
|||
ssd->notify++;
|
||||
}
|
||||
|
||||
void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd)
|
||||
static void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd)
|
||||
{
|
||||
if (ssd->cursor) {
|
||||
assert(ssd->dcl.con);
|
||||
|
@ -454,6 +454,15 @@ void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd)
|
|||
}
|
||||
}
|
||||
|
||||
void qemu_spice_cursor_refresh_bh(void *opaque)
|
||||
{
|
||||
SimpleSpiceDisplay *ssd = opaque;
|
||||
|
||||
qemu_mutex_lock(&ssd->lock);
|
||||
qemu_spice_cursor_refresh_unlocked(ssd);
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
}
|
||||
|
||||
void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
|
||||
{
|
||||
dprint(3, "%s/%d:\n", __func__, ssd->qxl.id);
|
||||
|
@ -464,7 +473,6 @@ void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
|
|||
qemu_spice_create_update(ssd);
|
||||
ssd->notify++;
|
||||
}
|
||||
qemu_spice_cursor_refresh_unlocked(ssd);
|
||||
qemu_mutex_unlock(&ssd->lock);
|
||||
|
||||
if (ssd->notify) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue