diff options
author | Dave Airlie <airlied@redhat.com> | 2013-07-04 00:58:45 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-07-04 20:44:17 -0400 |
commit | 1e209117dbe00d3d87db1c5266f177eaa60451c8 (patch) | |
tree | 4e7e856989cf2c2c0b17bd6717c9be68024e5cc2 | |
parent | c9fdda2a2b7a8875db3eebd89e428aa760afb897 (diff) |
qxl: add ring prep code for s/r
This prepare the ring code for s/r additions, the release ring will need
reinitialising.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_cmd.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_drv.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index 92cf1afd60e5..93c2f2cceb51 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c | |||
@@ -49,6 +49,11 @@ void qxl_ring_free(struct qxl_ring *ring) | |||
49 | kfree(ring); | 49 | kfree(ring); |
50 | } | 50 | } |
51 | 51 | ||
52 | void qxl_ring_init_hdr(struct qxl_ring *ring) | ||
53 | { | ||
54 | ring->ring->header.notify_on_prod = ring->n_elements; | ||
55 | } | ||
56 | |||
52 | struct qxl_ring * | 57 | struct qxl_ring * |
53 | qxl_ring_create(struct qxl_ring_header *header, | 58 | qxl_ring_create(struct qxl_ring_header *header, |
54 | int element_size, | 59 | int element_size, |
@@ -69,7 +74,7 @@ qxl_ring_create(struct qxl_ring_header *header, | |||
69 | ring->prod_notify = prod_notify; | 74 | ring->prod_notify = prod_notify; |
70 | ring->push_event = push_event; | 75 | ring->push_event = push_event; |
71 | if (set_prod_notify) | 76 | if (set_prod_notify) |
72 | header->notify_on_prod = ring->n_elements; | 77 | qxl_ring_init_hdr(ring); |
73 | spin_lock_init(&ring->lock); | 78 | spin_lock_init(&ring->lock); |
74 | return ring; | 79 | return ring; |
75 | } | 80 | } |
@@ -87,7 +92,7 @@ static int qxl_check_header(struct qxl_ring *ring) | |||
87 | return ret; | 92 | return ret; |
88 | } | 93 | } |
89 | 94 | ||
90 | static int qxl_check_idle(struct qxl_ring *ring) | 95 | int qxl_check_idle(struct qxl_ring *ring) |
91 | { | 96 | { |
92 | int ret; | 97 | int ret; |
93 | struct qxl_ring_header *header = &(ring->ring->header); | 98 | struct qxl_ring_header *header = &(ring->ring->header); |
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 056330e5fecf..aec9f1f9c814 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h | |||
@@ -340,6 +340,8 @@ struct qxl_ring *qxl_ring_create(struct qxl_ring_header *header, | |||
340 | bool set_prod_notify, | 340 | bool set_prod_notify, |
341 | wait_queue_head_t *push_event); | 341 | wait_queue_head_t *push_event); |
342 | void qxl_ring_free(struct qxl_ring *ring); | 342 | void qxl_ring_free(struct qxl_ring *ring); |
343 | void qxl_ring_init_hdr(struct qxl_ring *ring); | ||
344 | int qxl_check_idle(struct qxl_ring *ring); | ||
343 | 345 | ||
344 | static inline void * | 346 | static inline void * |
345 | qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical) | 347 | qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical) |