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] [day] [month] [year] [list]
Message-ID: <CAF6AEGsUVDbqYOeDBXBOySfs+7ftVf5_86CiFGOLfY9fmQuEVQ@mail.gmail.com>
Date:   Fri, 22 Apr 2022 14:06:08 -0700
From:   Rob Clark <robdclark@...il.com>
To:     Chia-I Wu <olvaffe@...il.com>
Cc:     ML dri-devel <dri-devel@...ts.freedesktop.org>,
        Rob Clark <robdclark@...omium.org>,
        David Airlie <airlied@...ux.ie>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Gurchetan Singh <gurchetansingh@...omium.org>,
        Daniel Vetter <daniel@...ll.ch>,
        "open list:VIRTIO GPU DRIVER" 
        <virtualization@...ts.linux-foundation.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/virtio: Add execbuf flag to request no fence-event

On Tue, Apr 5, 2022 at 10:57 AM Chia-I Wu <olvaffe@...il.com> wrote:
>
> On Tue, Apr 5, 2022 at 10:38 AM Rob Clark <robdclark@...il.com> wrote:
> >
> > From: Rob Clark <robdclark@...omium.org>
> >
> > It would have been cleaner to have a flag to *request* the fence event.
> > But that ship has sailed.  So add a flag so that userspace which doesn't
> > care about the events can opt-out.
> >
> > Signed-off-by: Rob Clark <robdclark@...omium.org>
> Reviewed-by: Chia-I Wu <olvaffe@...il.com>
>
> Might want to wait for Gurchetan to chime in as he added the mechanism.

It turns out this patch is unnecessary.. I can simply not set
VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK instead

so self-nak for this patch ;-)

BR,
-R

> > ---
> >  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 8 +++++---
> >  include/uapi/drm/virtgpu_drm.h         | 2 ++
> >  2 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > index 3a8078f2ee27..09f1aa263f91 100644
> > --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > @@ -225,9 +225,11 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
> >                 goto out_unresv;
> >         }
> >
> > -       ret = virtio_gpu_fence_event_create(dev, file, out_fence, ring_idx);
> > -       if (ret)
> > -               goto out_unresv;
> > +       if (!(exbuf->flags & VIRTGPU_EXECBUF_NO_EVENT)) {
> > +               ret = virtio_gpu_fence_event_create(dev, file, out_fence, ring_idx);
> > +               if (ret)
> > +                       goto out_unresv;
> > +       }
> >
> >         if (out_fence_fd >= 0) {
> >                 sync_file = sync_file_create(&out_fence->f);
> > diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
> > index 0512fde5e697..d06cac3407cc 100644
> > --- a/include/uapi/drm/virtgpu_drm.h
> > +++ b/include/uapi/drm/virtgpu_drm.h
> > @@ -52,10 +52,12 @@ extern "C" {
> >  #define VIRTGPU_EXECBUF_FENCE_FD_IN    0x01
> >  #define VIRTGPU_EXECBUF_FENCE_FD_OUT   0x02
> >  #define VIRTGPU_EXECBUF_RING_IDX       0x04
> > +#define VIRTGPU_EXECBUF_NO_EVENT       0x08
> >  #define VIRTGPU_EXECBUF_FLAGS  (\
> >                 VIRTGPU_EXECBUF_FENCE_FD_IN |\
> >                 VIRTGPU_EXECBUF_FENCE_FD_OUT |\
> >                 VIRTGPU_EXECBUF_RING_IDX |\
> > +               VIRTGPU_EXECBUF_NO_EVENT |\
> >                 0)
> >
> >  struct drm_virtgpu_map {
> > --
> > 2.35.1
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ