Displaying 12 results from an estimated 12 matches for "elemcnt".
2020 Feb 06
2
[PATCH] drm/virtio: fix ring free check
...struct virtqueue *vq = vgdev->ctrlq.vq;
bool notify = false;
- int ret;
+ bool indirect;
+ int vqcnt, ret;
again:
spin_lock(&vgdev->ctrlq.qlock);
@@ -341,9 +342,11 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
return;
}
- if (vq->num_free < elemcnt) {
+ indirect = virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC);
+ vqcnt = indirect ? 1 : elemcnt;
+ if (vq->num_free < vqcnt) {
spin_unlock(&vgdev->ctrlq.qlock);
- wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= elemcnt);
+ wait_event(vgdev->ctrlq.a...
2020 Feb 06
2
[PATCH] drm/virtio: fix ring free check
...struct virtqueue *vq = vgdev->ctrlq.vq;
bool notify = false;
- int ret;
+ bool indirect;
+ int vqcnt, ret;
again:
spin_lock(&vgdev->ctrlq.qlock);
@@ -341,9 +342,11 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
return;
}
- if (vq->num_free < elemcnt) {
+ indirect = virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC);
+ vqcnt = indirect ? 1 : elemcnt;
+ if (vq->num_free < vqcnt) {
spin_unlock(&vgdev->ctrlq.qlock);
- wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= elemcnt);
+ wait_event(vgdev->ctrlq.a...
2020 Sep 08
0
[PATCH 2/3] drm/virtio: return virtio_gpu_queue errors
...vq.c
@@ -320,13 +320,13 @@ static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size, int *sg_ents)
return sgt;
}
-static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
- struct virtio_gpu_vbuffer *vbuf,
- struct virtio_gpu_fence *fence,
- int elemcnt,
- struct scatterlist **sgs,
- int outcnt,
- int incnt)
+static int virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
+ struct virtio_gpu_vbuffer *vbuf,
+ struct virtio_gpu_fence *fence,
+ int elemcnt,
+ struct scatterlist **sgs,
+...
2020 Feb 06
0
[PATCH] drm/virtio: fix ring free check
...bool indirect;
> + int vqcnt, ret;
>
> again:
> spin_lock(&vgdev->ctrlq.qlock);
> @@ -341,9 +342,11 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
> return;
> }
>
> - if (vq->num_free < elemcnt) {
> + indirect = virtio_has_feature(vgdev->vdev, VIRTIO_RING_F_INDIRECT_DESC);
> + vqcnt = indirect ? 1 : elemcnt;
Is the feature dynamic and require the lock held? If not, the result
can be cached and the fixup can happen before grabbing the lock
if (vgdev->has_indirec...
2020 Feb 11
2
[PATCH v4] drm/virtio: add drm_driver.release callback.
...tqueue *vq = vgdev->ctrlq.vq;
bool notify = false;
- int ret;
+ int ret, idx;
+
+ if (!drm_dev_enter(vgdev->ddev, &idx)) {
+ if (fence && vbuf->objs)
+ virtio_gpu_array_unlock_resv(vbuf->objs);
+ free_vbuf(vgdev, vbuf);
+ return;
+ }
if (vgdev->has_indirect)
elemcnt = 1;
@@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
again:
spin_lock(&vgdev->ctrlq.qlock);
- if (!vgdev->vqs_ready) {
- spin_unlock(&vgdev->ctrlq.qlock);
-
- if (fence && vbuf->objs)
- virtio_gpu_array_unlock_resv(vbu...
2020 Feb 11
2
[PATCH v4] drm/virtio: add drm_driver.release callback.
...tqueue *vq = vgdev->ctrlq.vq;
bool notify = false;
- int ret;
+ int ret, idx;
+
+ if (!drm_dev_enter(vgdev->ddev, &idx)) {
+ if (fence && vbuf->objs)
+ virtio_gpu_array_unlock_resv(vbuf->objs);
+ free_vbuf(vgdev, vbuf);
+ return;
+ }
if (vgdev->has_indirect)
elemcnt = 1;
@@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
again:
spin_lock(&vgdev->ctrlq.qlock);
- if (!vgdev->vqs_ready) {
- spin_unlock(&vgdev->ctrlq.qlock);
-
- if (fence && vbuf->objs)
- virtio_gpu_array_unlock_resv(vbu...
2020 Feb 11
0
[PATCH v3] drm/virtio: add drm_driver.release callback.
...tqueue *vq = vgdev->ctrlq.vq;
bool notify = false;
- int ret;
+ int ret, idx;
+
+ if (!drm_dev_enter(vgdev->ddev, &idx)) {
+ if (fence && vbuf->objs)
+ virtio_gpu_array_unlock_resv(vbuf->objs);
+ free_vbuf(vgdev, vbuf);
+ return;
+ }
if (vgdev->has_indirect)
elemcnt = 1;
@@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
again:
spin_lock(&vgdev->ctrlq.qlock);
- if (!vgdev->vqs_ready) {
- spin_unlock(&vgdev->ctrlq.qlock);
-
- if (fence && vbuf->objs)
- virtio_gpu_array_unlock_resv(vbu...
2020 Feb 11
0
[PATCH v4] drm/virtio: add drm_driver.release callback.
...- int ret;
> + int ret, idx;
> +
> + if (!drm_dev_enter(vgdev->ddev, &idx)) {
> + if (fence && vbuf->objs)
> + virtio_gpu_array_unlock_resv(vbuf->objs);
> + free_vbuf(vgdev, vbuf);
> + return;
> + }
>
> if (vgdev->has_indirect)
> elemcnt = 1;
> @@ -338,14 +345,6 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
> again:
> spin_lock(&vgdev->ctrlq.qlock);
>
> - if (!vgdev->vqs_ready) {
> - spin_unlock(&vgdev->ctrlq.qlock);
> -
> - if (fence && vbuf->ob...
2020 Feb 14
0
[PATCH v4 2/6] drm/virtio: notify before waiting
...rtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index 6cc259cfa517..653efb26bcd9 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -346,6 +346,7 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
if (vq->num_free < elemcnt) {
spin_unlock(&vgdev->ctrlq.qlock);
+ virtio_gpu_notify(vgdev);
wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= elemcnt);
goto again;
}
--
2.18.2
2020 Feb 07
1
[PATCH v2] drm/virtio: fix ring free check
...io/virtgpu_vq.c
index 41e475fbd67b..cc02fc4bab2a 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -330,6 +330,9 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
bool notify = false;
int ret;
+ if (vgdev->has_indirect)
+ elemcnt = 1;
+
again:
spin_lock(&vgdev->ctrlq.qlock);
--
2.18.1
2020 Feb 07
1
[PATCH] drm/virtio: add drm_driver.release callback.
...rm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -330,6 +330,11 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
bool notify = false;
int ret;
+ if (!vgdev->vqs_ready) {
+ free_vbuf(vgdev, vbuf);
+ return;
+ }
+
if (vgdev->has_indirect)
elemcnt = 1;
@@ -462,8 +467,10 @@ static void virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev,
int ret;
int outcnt;
- if (!vgdev->vqs_ready)
+ if (!vgdev->vqs_ready) {
+ free_vbuf(vgdev, vbuf);
return;
+ }
sg_init_one(&ccmd, vbuf->buf, vbuf->size);
sgs[0] = &cc...
2020 Feb 10
1
[PATCH v2] drm/virtio: add drm_driver.release callback.
...rm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -330,6 +330,11 @@ static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
bool notify = false;
int ret;
+ if (!vgdev->vqs_ready) {
+ free_vbuf(vgdev, vbuf);
+ return;
+ }
+
if (vgdev->has_indirect)
elemcnt = 1;
@@ -462,8 +467,10 @@ static void virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev,
int ret;
int outcnt;
- if (!vgdev->vqs_ready)
+ if (!vgdev->vqs_ready) {
+ free_vbuf(vgdev, vbuf);
return;
+ }
sg_init_one(&ccmd, vbuf->buf, vbuf->size);
sgs[0] = &cc...