drm/virtio: Don't create a context with default param if context_init is supported
Subsystems (4)
Dmitry Osipenko
maintainerPATCH 1/1 drm/virtio: Don't create a context with default param if context_init is supported
From: Pierre-Eric Pelloux-Prayer <[email protected]>
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.
--- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_gem.c +5 -3
@@ -127,15 +127,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 ;
Signature · 1 line
2.47.0
Quoted 10 lines · Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer <[email protected]>
Xorg context creation fails for native contexts that use
VIRTGPU_CONTEXT_INITbecause context is already initialized implicitly when dumb buffer is created. Fix it by not creating default vrend context ifcontext_initis supported.Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/gpu/drm/virtio/virtgpu_gem.c +5
-4@@ -127,15 +127,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 ; --2.47.0
Dmitry Osipenko
maintainerQuoted 7 lines · Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer <[email protected]>
Xorg context creation fails for native contexts that use
VIRTGPU_CONTEXT_INITbecause context is already initialized implicitly when dumb buffer is created. Fix it by not creating default vrend context ifcontext_initis supported.
Quoted 5 lines
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
I'll apply this patch tomorrow if nobody has more comments to add.
Signature · 2 lines
Best regards, Dmitry
Quoted 7 lines · Dmitry Osipenko
From: Pierre-Eric Pelloux-Prayer <[email protected]>
Xorg context creation fails for native contexts that use
VIRTGPU_CONTEXT_INITbecause context is already initialized implicitly when dumb buffer is created. Fix it by not creating default vrend context ifcontext_initis supported.
Quoted 5 lines
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Applied to misc-next
Signature · 2 lines
Best regards, Dmitry