Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/virtio: add real fence context and seqno

virtio fences were created with no fence context, which would make then
clash with an allocated fence context.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Message-id: 1472660813-28219-2-git-send-email-gustavo@padovan.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

authored by

Gustavo Padovan and committed by
Gerd Hoffmann
30b9c96c 5c32c3dd

+3 -1
+1
drivers/gpu/drm/virtio/virtgpu_drv.h
··· 75 75 struct virtio_gpu_fence_driver { 76 76 atomic64_t last_seq; 77 77 uint64_t sync_seq; 78 + uint64_t context; 78 79 struct list_head fences; 79 80 spinlock_t lock; 80 81 };
+1 -1
drivers/gpu/drm/virtio/virtgpu_fence.c
··· 89 89 (*fence)->drv = drv; 90 90 (*fence)->seq = ++drv->sync_seq; 91 91 fence_init(&(*fence)->f, &virtio_fence_ops, &drv->lock, 92 - 0, (*fence)->seq); 92 + drv->context, (*fence)->seq); 93 93 fence_get(&(*fence)->f); 94 94 list_add_tail(&(*fence)->node, &drv->fences); 95 95 spin_unlock_irqrestore(&drv->lock, irq_flags);
+1
drivers/gpu/drm/virtio/virtgpu_kms.c
··· 159 159 virtio_gpu_init_vq(&vgdev->ctrlq, virtio_gpu_dequeue_ctrl_func); 160 160 virtio_gpu_init_vq(&vgdev->cursorq, virtio_gpu_dequeue_cursor_func); 161 161 162 + vgdev->fence_drv.context = fence_context_alloc(1); 162 163 spin_lock_init(&vgdev->fence_drv.lock); 163 164 INIT_LIST_HEAD(&vgdev->fence_drv.fences); 164 165 INIT_LIST_HEAD(&vgdev->cap_cache);