[Spice-devel] [PATCH xf86-qxl 16/27] (for later) qxl_ring: add helpers (debugging/unused)

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jul 16 08:38:40 PDT 2012


From: Alon Levy <alevy at redhat.com>

---
 src/qxl.h      |    4 ++++
 src/qxl_ring.c |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/src/qxl.h b/src/qxl.h
index 44c9b47..c221a06 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -327,6 +327,10 @@ Bool              qxl_ring_pop         (struct qxl_ring        *ring,
 					void                   *element);
 void              qxl_ring_wait_idle   (struct qxl_ring        *ring);
 
+void              qxl_ring_request_notify (struct qxl_ring *ring);
+
+int               qxl_ring_prod        (struct qxl_ring        *ring);
+int               qxl_ring_cons        (struct qxl_ring        *ring);
 
 /*
  * Surface
diff --git a/src/qxl_ring.c b/src/qxl_ring.c
index fcbaaa7..2156113 100644
--- a/src/qxl_ring.c
+++ b/src/qxl_ring.c
@@ -132,3 +132,23 @@ qxl_ring_wait_idle (struct qxl_ring *ring)
 	mem_barrier();
     }
 }
+
+void
+qxl_ring_request_notify (struct qxl_ring *ring)
+{
+    ring->ring->header.notify_on_prod = ring->ring->header.prod + 1;
+    ErrorF("%s: requesting notify on prod %d\n", __func__,
+           ring->ring->header.notify_on_prod);
+}
+
+int
+qxl_ring_cons (struct qxl_ring *ring)
+{
+    return ring->ring->header.cons;
+}
+
+int
+qxl_ring_prod (struct qxl_ring *ring)
+{
+    return ring->ring->header.prod;
+}
-- 
1.7.10.4



More information about the Spice-devel mailing list