From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qjzk4-0008Ez-7P for garchives@archives.gentoo.org; Thu, 21 Jul 2011 20:21:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2004121C072; Thu, 21 Jul 2011 20:19:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D4E6821C060 for ; Thu, 21 Jul 2011 20:19:47 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 37E2C1BC00A for ; Thu, 21 Jul 2011 20:19:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id DCB3880042 for ; Thu, 21 Jul 2011 20:19:45 +0000 (UTC) From: "Doug Goldstein" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Doug Goldstein" Message-ID: Subject: [gentoo-commits] proj/qemu-kvm:qemu-kvm-0.14.1-gentoo commit in: hw/, ui/ X-VCS-Repository: proj/qemu-kvm X-VCS-Files: hw/qxl.c ui/spice-display.c X-VCS-Directories: hw/ ui/ X-VCS-Committer: cardoe X-VCS-Committer-Name: Doug Goldstein X-VCS-Revision: f62e070d96d5631385bdaf4096411ae25bfd7481 Date: Thu, 21 Jul 2011 20:19:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: d3fafd4567fe323c3ff1e0fd9e3125d5 commit: f62e070d96d5631385bdaf4096411ae25bfd7481 Author: Alon Levy redhat com> AuthorDate: Wed Mar 16 14:46:22 2011 +0000 Commit: Doug Goldstein gentoo org> CommitDate: Thu Jul 21 20:15:38 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/qemu-kvm.git;= a=3Dcommit;h=3Df62e070d qxl/spice: remove qemu_mutex_{un,}lock_iothread around dispatcher with the previous patch making sure get_command no longer needs to lock, there is no reason to drop the qemu iothread mutex in qxl.c and in ui/spice-display.c The only location where the lock remains are the cursor related callbacks= , that path is currently broken. It is only triggered if running spice and = sdl, which is broken already before that. --- hw/qxl.c | 8 -------- ui/spice-display.c | 19 +++---------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 64580f1..cf3c938 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -670,10 +670,8 @@ static void qxl_hard_reset(PCIQXLDevice *d, int load= vm) dprint(d, 1, "%s: start%s\n", __FUNCTION__, loadvm ? " (loadvm)" : ""); =20 - qemu_mutex_unlock_iothread(); d->ssd.worker->reset_cursor(d->ssd.worker); d->ssd.worker->reset_image_cache(d->ssd.worker); - qemu_mutex_lock_iothread(); qxl_reset_surfaces(d); qxl_reset_memslots(d); =20 @@ -803,9 +801,7 @@ static void qxl_reset_surfaces(PCIQXLDevice *d) { dprint(d, 1, "%s:\n", __FUNCTION__); d->mode =3D QXL_MODE_UNDEFINED; - qemu_mutex_unlock_iothread(); d->ssd.worker->destroy_surfaces(d->ssd.worker); - qemu_mutex_lock_iothread(); memset(&d->guest_surfaces.cmds, 0, sizeof(d->guest_surfaces.cmds)); } =20 @@ -874,9 +870,7 @@ static void qxl_destroy_primary(PCIQXLDevice *d) dprint(d, 1, "%s\n", __FUNCTION__); =20 d->mode =3D QXL_MODE_UNDEFINED; - qemu_mutex_unlock_iothread(); d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0); - qemu_mutex_lock_iothread(); } =20 static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm) @@ -946,10 +940,8 @@ static void ioport_write(void *opaque, uint32_t addr= , uint32_t val) case QXL_IO_UPDATE_AREA: { QXLRect update =3D d->ram->update_area; - qemu_mutex_unlock_iothread(); d->ssd.worker->update_area(d->ssd.worker, d->ram->update_surface= , &update, NULL, 0, 0); - qemu_mutex_lock_iothread(); break; } case QXL_IO_NOTIFY_CMD: diff --git a/ui/spice-display.c b/ui/spice-display.c index bdd14b8..ecb22cc 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -62,13 +62,7 @@ void qemu_spice_rect_union(QXLRect *dest, const QXLRec= t *r) dest->right =3D MAX(dest->right, r->right); } =20 -/* - * Called from spice server thread context (via interface_get_command). - * - * We must aquire the global qemu mutex here to make sure the - * DisplayState (+DisplaySurface) we are accessing doesn't change - * underneath us. - */ +/* Called from io-thread context (via pipe_read) */ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd) { SimpleSpiceUpdate *update; @@ -78,9 +72,7 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpice= Display *ssd) uint8_t *src, *dst; int by, bw, bh; =20 - qemu_mutex_lock_iothread(); if (qemu_spice_rect_is_empty(&ssd->dirty)) { - qemu_mutex_unlock_iothread(); return NULL; }; =20 @@ -141,7 +133,6 @@ SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpi= ceDisplay *ssd) cmd->data =3D (intptr_t)drawable; =20 memset(&ssd->dirty, 0, sizeof(ssd->dirty)); - qemu_mutex_unlock_iothread(); return update; } =20 @@ -169,6 +160,7 @@ void qemu_spice_create_host_memslot(SimpleSpiceDispla= y *ssd) ssd->worker->add_memslot(ssd->worker, &memslot); } =20 +/* called from iothread (main) or a vcpu-thread */ void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd) { QXLDevSurfaceCreate surface; @@ -186,18 +178,14 @@ void qemu_spice_create_host_primary(SimpleSpiceDisp= lay *ssd) surface.mem =3D (intptr_t)ssd->buf; surface.group_id =3D MEMSLOT_GROUP_HOST; =20 - qemu_mutex_unlock_iothread(); ssd->worker->create_primary_surface(ssd->worker, 0, &surface); - qemu_mutex_lock_iothread(); } =20 void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd) { dprint(1, "%s:\n", __FUNCTION__); =20 - qemu_mutex_unlock_iothread(); ssd->worker->destroy_primary_surface(ssd->worker, 0); - qemu_mutex_lock_iothread(); } =20 void qemu_spice_vm_change_state_handler(void *opaque, int running, int r= eason) @@ -207,9 +195,7 @@ void qemu_spice_vm_change_state_handler(void *opaque,= int running, int reason) if (running) { ssd->worker->start(ssd->worker); } else { - qemu_mutex_unlock_iothread(); ssd->worker->stop(ssd->worker); - qemu_mutex_lock_iothread(); } ssd->running =3D running; } @@ -233,6 +219,7 @@ void qemu_spice_display_update(SimpleSpiceDisplay *ss= d, qemu_spice_rect_union(&ssd->dirty, &update_area); } =20 +/* called only from iothread (main) */ void qemu_spice_display_resize(SimpleSpiceDisplay *ssd) { dprint(1, "%s:\n", __FUNCTION__);