[PATCH v3 11/12] drm/virtio: implement context init: add virtio_gpu_fence_event

Daniel Vetter daniel at ffwll.ch
Tue Nov 16 15:43:01 UTC 2021


On Mon, Nov 15, 2021 at 07:26:14PM +0000, Kasireddy, Vivek wrote:
> Hi Daniel, Greg,
> 
> If it is the same or a similar crash reported here:
> https://lists.freedesktop.org/archives/dri-devel/2021-November/330018.html
> and here: https://lists.freedesktop.org/archives/dri-devel/2021-November/330212.html
> then the fix is already merged:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d89c0c8322ecdc9a2ec84b959b6f766be082da76

Yeah but that still leaves the problem of why exaxtly virtgpu is
reinventing drm_poll here?

Can you please replace it with drm_poll like all other drivers, including
the ones that have private events?

Thanks, Daniel

> 
> Thanks,
> Vivek
> 
> > On Sat, Nov 13, 2021 at 03:51:48PM +0100, Greg KH wrote:
> > > On Tue, Sep 21, 2021 at 04:20:23PM -0700, Gurchetan Singh wrote:
> > > > Similar to DRM_VMW_EVENT_FENCE_SIGNALED.  Sends a pollable event
> > > > to the DRM file descriptor when a fence on a specific ring is
> > > > signaled.
> > > >
> > > > One difference is the event is not exposed via the UAPI -- this is
> > > > because host responses are on a shared memory buffer of type
> > > > BLOB_MEM_GUEST [this is the common way to receive responses with
> > > > virtgpu].  As such, there is no context specific read(..)
> > > > implementation either -- just a poll(..) implementation.
> > > >
> > > > Signed-off-by: Gurchetan Singh <gurchetansingh at chromium.org>
> > > > Acked-by: Nicholas Verne <nverne at chromium.org>
> > > > ---
> > > >  drivers/gpu/drm/virtio/virtgpu_drv.c   | 43 +++++++++++++++++++++++++-
> > > >  drivers/gpu/drm/virtio/virtgpu_drv.h   |  7 +++++
> > > >  drivers/gpu/drm/virtio/virtgpu_fence.c | 10 ++++++
> > > >  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 34 ++++++++++++++++++++
> > > >  4 files changed, 93 insertions(+), 1 deletion(-)
> > >
> > > This commit seems to cause a crash in a virtual drm gpu driver for
> > > Android.  I have reverted this, and the next commit in the series from
> > > Linus's tree and all is good again.
> > >
> > > Any ideas?
> > 
> > Well no, but also this patch looks very questionable of hand-rolling
> > drm_poll. Yes you can do driver private events like
> > DRM_VMW_EVENT_FENCE_SIGNALED, that's fine. But you really should not need
> > to hand-roll the poll callback. vmwgfx (which generally is a very old
> > driver which has lots of custom stuff, so not a great example) doesn't do
> > that either.
> > 
> > So that part should go no matter what I think.
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list