lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGs2+gPtqOw=LMwVxNkzWgYc11u0VN3DnQOyQc2MPhsJig@mail.gmail.com>
Date: Tue, 5 Nov 2024 17:31:28 -0800
From: Rob Clark <robdclark@...il.com>
To: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Cc: David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>, 
	Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu <olvaffe@...il.com>, 
	Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>, dri-devel@...ts.freedesktop.org, 
	virtualization@...ts.linux-foundation.org, linux-kernel@...r.kernel.org, 
	kernel@...labora.com
Subject: Re: [PATCH v1] drm/virtio: Don't create a context with default param
 if context_init is supported

On Sun, Oct 20, 2024 at 3:49 PM Dmitry Osipenko
<dmitry.osipenko@...labora.com> wrote:
>
> From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>
>
> 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 <pierre-eric.pelloux-prayer@....com>
> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@...labora.com>

Reviewed-by: Rob Clark <robdclark@...il.com>

> ---
>  drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
> index 7db48d17ee3a..67f557e058b4 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_gem.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
> @@ -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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ