From: Alexander Larsson <al...@redhat.com> The driver may be waiting on the ring, so we need to always flush the ring on interface_flush_resources, independent of d->num_free_res.
Additionally, the num_free_res check is changed to >= to make sure we don't stall if it passes QXL_FREE_BUNCH_SIZE. --- hw/qxl.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 63a96e8..51286d4 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -384,15 +384,17 @@ static int interface_req_cmd_notification(QXLInstance *sin) } /* called from spice server thread context only */ -static inline void qxl_push_free_res(PCIQXLDevice *d) +static inline void qxl_push_free_res(PCIQXLDevice *d, + bool flush) { QXLReleaseRing *ring = &d->ram->release_ring; uint64_t *item; #define QXL_FREE_BUNCH_SIZE 10 - if (SPICE_RING_IS_EMPTY(ring) || (d->num_free_res == QXL_FREE_BUNCH_SIZE && - ring->prod - ring->cons + 1 != ring->num_items)) { + if (SPICE_RING_IS_EMPTY(ring) || + ((flush || d->num_free_res >= QXL_FREE_BUNCH_SIZE) && + ring->prod - ring->cons + 1 != ring->num_items)) { int notify; SPICE_RING_PUSH(ring, notify); @@ -443,7 +445,7 @@ static void interface_release_resource(QXLInstance *sin, } qxl->last_release = ext.info; qxl->num_free_res++; - qxl_push_free_res(qxl); + qxl_push_free_res(qxl, false); } /* called from spice server thread context only */ @@ -518,7 +520,7 @@ static int interface_flush_resources(QXLInstance *sin) ret = qxl->num_free_res; if (ret) { - qxl_push_free_res(qxl); + qxl_push_free_res(qxl, true); } return ret; } -- 1.7.0.1 _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel