mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-02 23:54:33 +01:00
drm/virtio: Don't create a context with default param if context_init is supported
Xorg context creation fails for native contexts that use VIRTGPU_CONTEXT_INIT because context is already initialized implicitly when dumb buffer is created. Fix it by not creating default vrend context if context_init is supported. Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
1 parent
c85021f35a
commit
086b9f27f0
1 file changed
+5
-3
@@ -112,15 +112,17 @@ int virtio_gpu_gem_object_open(struct drm_gem_object *obj,
|
||||
/* the context might still be missing when the first ioctl is
|
||||
* DRM_IOCTL_MODE_CREATE_DUMB or DRM_IOCTL_PRIME_FD_TO_HANDLE
|
||||
*/
|
||||
virtio_gpu_create_context(obj->dev, file);
|
||||
if (!vgdev->has_context_init)
|
||||
virtio_gpu_create_context(obj->dev, file);
|
||||
|
||||
objs = virtio_gpu_array_alloc(1);
|
||||
if (!objs)
|
||||
return -ENOMEM;
|
||||
virtio_gpu_array_add_obj(objs, obj);
|
||||
|
||||
virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id,
|
||||
objs);
|
||||
if (vfpriv->ctx_id)
|
||||
virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, objs);
|
||||
|
||||
out_notify:
|
||||
virtio_gpu_notify(vgdev);
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user