Skip to content

Commit

Permalink
qxl: add ring prep code for s/r
Browse files Browse the repository at this point in the history
This prepare the ring code for s/r additions, the release ring will need
reinitialising.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Jul 5, 2013
1 parent c9fdda2 commit 1e20911
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/qxl/qxl_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/qxl/qxl_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1e20911

Please sign in to comment.