Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8cf44f0 authored by Chia-I Wu's avatar Chia-I Wu Committed by Lee Jones
Browse files

UPSTREAM: drm/virtio: fix a wait_event condition



outcnt may be greater than 1 since commit e1218b8c0cc1 ("drm/virtio:
Use vmalloc for command buffer allocations.").

Bug: 254441685
Fixes: e1218b8c0cc1 ("drm/virtio: Use vmalloc for command buffer allocations.")
Signed-off-by: default avatarChia-I Wu <olvaffe@gmail.com>
Cc: David Riley <davidriley@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200205181955.202485-2-olvaffe@gmail.com


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 58547d7d5c6f4c5d18a1719c87799d825741e64a)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I2ffff167b66589dfd5655a495c927d2ec92eaeb1
parent c6ffa588
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -377,7 +377,8 @@ static int virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
	 */
	if (vq->num_free < 2 + outcnt) {
		spin_unlock(&vgdev->ctrlq.qlock);
		wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= 3);
		wait_event(vgdev->ctrlq.ack_queue,
			   vq->num_free >= 2 + outcnt);
		goto again;
	}