qxl: add ring prep code for s/r
authorDave Airlie <airlied@redhat.com>
Thu, 4 Jul 2013 04:58:45 +0000 (14:58 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 5 Jul 2013 00:44:17 +0000 (10:44 +1000)
This prepare the ring code for s/r additions, the release ring will need
reinitialising.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/qxl/qxl_cmd.c
drivers/gpu/drm/qxl/qxl_drv.h

index 92cf1afd60e55e04c1645679fef8e7c47913a38b..93c2f2cceb5165c25e80c6480c60c3e2e9e7fd62 100644 (file)
@@ -49,6 +49,11 @@ void qxl_ring_free(struct qxl_ring *ring)
        kfree(ring);
 }
 
+void qxl_ring_init_hdr(struct qxl_ring *ring)
+{
+       ring->ring->header.notify_on_prod = ring->n_elements;
+}
+
 struct qxl_ring *
 qxl_ring_create(struct qxl_ring_header *header,
                int element_size,
@@ -69,7 +74,7 @@ qxl_ring_create(struct qxl_ring_header *header,
        ring->prod_notify = prod_notify;
        ring->push_event = push_event;
        if (set_prod_notify)
-               header->notify_on_prod = ring->n_elements;
+               qxl_ring_init_hdr(ring);
        spin_lock_init(&ring->lock);
        return ring;
 }
@@ -87,7 +92,7 @@ static int qxl_check_header(struct qxl_ring *ring)
        return ret;
 }
 
-static int qxl_check_idle(struct qxl_ring *ring)
+int qxl_check_idle(struct qxl_ring *ring)
 {
        int ret;
        struct qxl_ring_header *header = &(ring->ring->header);
index 056330e5fecf547f6ac24887792d76590c039637..aec9f1f9c814d50b9fbc35191e3ce338278b5278 100644 (file)
@@ -340,6 +340,8 @@ struct qxl_ring *qxl_ring_create(struct qxl_ring_header *header,
                                 bool set_prod_notify,
                                 wait_queue_head_t *push_event);
 void qxl_ring_free(struct qxl_ring *ring);
+void qxl_ring_init_hdr(struct qxl_ring *ring);
+int qxl_check_idle(struct qxl_ring *ring);
 
 static inline void *
 qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical)