Merge remote-tracking branch 'spice/spice.v76' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* spice/spice.v76:
  qxl: replace pipe signaling with bottom half

Message-id: 1383656322-24150-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
This commit is contained in:
Anthony Liguori 2013-11-05 08:39:49 -08:00
commit 29f8f3835f
2 changed files with 4 additions and 32 deletions

View File

@ -1701,15 +1701,9 @@ static const MemoryRegionOps qxl_io_ops = {
}, },
}; };
static void pipe_read(void *opaque) static void qxl_update_irq_bh(void *opaque)
{ {
PCIQXLDevice *d = opaque; PCIQXLDevice *d = opaque;
char dummy;
int len;
do {
len = read(d->pipe[0], &dummy, sizeof(dummy));
} while (len == sizeof(dummy));
qxl_update_irq(d); qxl_update_irq(d);
} }
@ -1730,28 +1724,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
if ((old_pending & le_events) == le_events) { if ((old_pending & le_events) == le_events) {
return; return;
} }
if (qemu_thread_is_self(&d->main)) { qemu_bh_schedule(d->update_irq);
qxl_update_irq(d);
} else {
if (write(d->pipe[1], d, 1) != 1) {
dprint(d, 1, "%s: write to pipe failed\n", __func__);
}
}
}
static void init_pipe_signaling(PCIQXLDevice *d)
{
if (pipe(d->pipe) < 0) {
fprintf(stderr, "%s:%s: qxl pipe creation failed\n",
__FILE__, __func__);
exit(1);
}
fcntl(d->pipe[0], F_SETFL, O_NONBLOCK);
fcntl(d->pipe[1], F_SETFL, O_NONBLOCK);
fcntl(d->pipe[0], F_SETOWN, getpid());
qemu_thread_get_self(&d->main);
qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d);
} }
/* graphics console */ /* graphics console */
@ -2044,7 +2017,7 @@ static int qxl_init_common(PCIQXLDevice *qxl)
} }
qemu_add_vm_change_state_handler(qxl_vm_change_state_handler, qxl); qemu_add_vm_change_state_handler(qxl_vm_change_state_handler, qxl);
init_pipe_signaling(qxl); qxl->update_irq = qemu_bh_new(qxl_update_irq_bh, qxl);
qxl_reset_state(qxl); qxl_reset_state(qxl);
qxl->update_area_bh = qemu_bh_new(qxl_render_update_area_bh, qxl); qxl->update_area_bh = qemu_bh_new(qxl_render_update_area_bh, qxl);

View File

@ -81,8 +81,7 @@ typedef struct PCIQXLDevice {
QemuMutex track_lock; QemuMutex track_lock;
/* thread signaling */ /* thread signaling */
QemuThread main; QEMUBH *update_irq;
int pipe[2];
/* ram pci bar */ /* ram pci bar */
QXLRam *ram; QXLRam *ram;