drm/virtio: track whether or not a context has been initiated

Use an boolean variable to track whether a context has been
initiated.

v5: Fix possible race and sleep via mutex (olv)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200225000800.2966-3-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gurchetan Singh
2020-02-24 16:07:59 -08:00
committed by Gerd Hoffmann
parent 40cadedd20
commit d2a983b220
3 changed files with 13 additions and 0 deletions

View File

@@ -209,6 +209,8 @@ struct virtio_gpu_device {
struct virtio_gpu_fpriv {
uint32_t ctx_id;
bool context_created;
struct mutex context_lock;
};
/* virtio_ioctl.c */