diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2020-05-01 11:55:57 -0700 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-05-04 09:53:37 +0200 |
commit | c3e2850a9b68a62e7949633102d0351773846136 (patch) | |
tree | dae7a7ad11e08d8911cc183f9c02fb2ebcac00ee /drivers/gpu/drm/virtio/virtgpu_gem.c | |
parent | 6f49c2515e2258f08f2b905c9772dbf729610415 (diff) | |
download | linux-c3e2850a9b68a62e7949633102d0351773846136.tar.bz2 |
drm/virtio: create context before RESOURCE_CREATE_2D in 3D mode
If 3D is enabled, but userspace requests a dumb buffer, we will
call CTX_ATTACH_RESOURCE before actually creating the context.
Fixes: 72b48ae800da ("drm/virtio: enqueue virtio_gpu_create_context after the first 3D ioctl")
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20200501185557.740-1-gurchetansingh@chromium.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_gem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 0d6152c99a27..f0d5a8974677 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -39,6 +39,9 @@ int virtio_gpu_gem_create(struct drm_file *file, int ret; u32 handle; + if (vgdev->has_virgl_3d) + virtio_gpu_create_context(dev, file); + ret = virtio_gpu_object_create(vgdev, params, &obj, NULL); if (ret < 0) return ret; |