summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-06-25 16:13:29 +0300
committerAlon Levy <alevy@redhat.com>2012-06-27 17:36:03 +0300
commit2e6c21608f0fbead2dd057a05d951386223fc241 (patch)
treea9f72a4da66bacc2996b5f4f10300fab487a7d38
parentec5627d4dd634dd29cb920daa2760bb95ab281da (diff)
(for later) qxl_ring: add helpers (debugging/unused)
-rw-r--r--src/qxl.h4
-rw-r--r--src/qxl_ring.c20
2 files changed, 24 insertions, 0 deletions
diff --git a/src/qxl.h b/src/qxl.h
index 6599429..c0ec06c 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -322,6 +322,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;
+}