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: <CACvgo52oG3uMPj2ASqPWvBYS7mUwm=nzKwMYSs8xZWq_OAL_2w@mail.gmail.com>
Date:   Wed, 31 Oct 2018 09:39:31 +0000
From:   Emil Velikov <emil.l.velikov@...il.com>
To:     Robert Foss <robert.foss@...labora.com>
Cc:     David Airlie <airlied@...ux.ie>, Gerd Hoffmann <kraxel@...hat.com>,
        ML dri-devel <dri-devel@...ts.freedesktop.org>,
        "open list:VIRTIO GPU DRIVER" 
        <virtualization@...ts.linux-foundation.org>,
        "Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
        Rob Herring <robh@...nel.org>,
        Gustavo Padovan <gustavo.padovan@...labora.com>,
        Emil Velikov <emil.velikov@...labora.com>
Subject: Re: [PATCH 4/5] drm/virtio: add out-fences support for explicit synchronization

Hi Rob,

On Thu, 25 Oct 2018 at 19:38, Robert Foss <robert.foss@...labora.com> wrote:
>
> From: Gustavo Padovan <gustavo.padovan@...labora.com>
>
> On the out-fence side we get fence returned by the submitted draw call
> and attach it to a sync_file and send the sync_file fd to userspace. On
> error -1 is returned to userspace.
>
Can we have both an IN and OUT fence at the same time? Either way, please
mention that in the commit message.

> Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.com>
> Signed-off-by: Robert Foss <robert.foss@...labora.com>
> Suggested-by: Rob Herring <robh@...nel.org>
> ---
>  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 50 +++++++++++++++++++-------
>  1 file changed, 38 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> index 0368195966aa..32e714a1c753 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> @@ -106,7 +106,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
>         struct virtio_gpu_device *vgdev = dev->dev_private;
>         struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
>         struct drm_gem_object *gobj;
> -       struct virtio_gpu_fence *fence;
> +       struct virtio_gpu_fence *out_fence;
>         struct virtio_gpu_object *qobj;
>         int ret;
>         uint32_t *bo_handles = NULL;
> @@ -116,7 +116,9 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
>         int i;
>         struct ww_acquire_ctx ticket;
>         struct dma_fence *in_fence = NULL;
> +       struct sync_file *sync_file;
>         int in_fence_fd = exbuf->fence_fd;
> +       int out_fence_fd = -1;
>         void *buf;
>
>         exbuf->fence_fd = -1;
> @@ -143,6 +145,14 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
>                 }
>         }
>
> +       if (exbuf->flags & VIRTGPU_EXECBUF_FENCE_FD_OUT) {
> +               out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
> +               if (out_fence_fd < 0) {
> +                       ret = out_fence_fd;
> +                       goto out_in_fence;
> +               }
> +       }
> +
If the answer to the above is "no" we want a check around here.

With that the patch is
Reviewed-by: Emil Velikov <emil.velikov@...labora.com>

-Emil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ