Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379520

Re: [RFC 3/8] drm/fence: allow fence waiting to be interrupted by userspace

From Daniel Vetter <daniel@ffwll.ch>
Newsgroups linux.kernel
Subject Re: [RFC 3/8] drm/fence: allow fence waiting to be interrupted by userspace
Date 2016-04-15 09:50 +0200
Message-ID <ro6FQ-7VI-13@gated-at.bofh.it> (permalink)
References <ro0K6-37f-3@gated-at.bofh.it> <ro0K6-37f-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 14, 2016 at 06:29:36PM -0700, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> If userspace is running an synchronously atomic commit and interrupts the
> atomic operation during fence_wait() it will hang until the timer expires,
> so here we change the wait to be interruptible so it stop immediately when
> userspace wants to quit.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 7bf678e..f85ef8c 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1007,7 +1007,7 @@ void drm_atomic_helper_wait_for_fences(struct drm_device *dev,
>  
>  		WARN_ON(!plane->state->fb);
>  
> -		fence_wait(plane->state->fence, false);
> +		fence_wait(plane->state->fence, true);

You need to propagate the error code when allowing the wait to be
interrupted - we can't proceed with the atomic update in that case, but
need to bail out. And userspace needs to restart the ioctl.

Also, needs a testcase I think.
-Daniel

>  		fence_put(plane->state->fence);
>  		plane->state->fence = NULL;
>  	}
> -- 
> 2.5.5
> 

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 0/8] drm: explicit fencing support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
  [RFC 1/8] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:10 +0200
      Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 13:50 +0200
        Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 20:30 +0200
          Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 21:30 +0200
      Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 20:30 +0200
        Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 21:30 +0200
  [RFC 3/8] drm/fence: allow fence waiting to be interrupted by userspace Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 3/8] drm/fence: allow fence waiting to be interrupted by  userspace Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 09:50 +0200
  [RFC 6/8] drm/fence: create DRM_MODE_ATOMIC_OUT_FENCE flag Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 6/8] drm/fence: create DRM_MODE_ATOMIC_OUT_FENCE flag Rob Clark <robdclark@gmail.com> - 2016-04-15 03:50 +0200
      Re: [RFC 6/8] drm/fence: create DRM_MODE_ATOMIC_OUT_FENCE flag Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 21:10 +0200
  [RFC 2/8] dma-buf/sync_file: add sync_file_fences_get() Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 2/8] dma-buf/sync_file: add sync_file_fences_get() Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:00 +0200
  [RFC 5/8] drm/fence: add fence to drm_pending_event Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 5/8] drm/fence: add fence to drm_pending_event Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
      Re: [RFC 5/8] drm/fence: add fence to drm_pending_event Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 21:00 +0200
        Re: [RFC 5/8] drm/fence: add fence to drm_pending_event Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 21:40 +0200
  [RFC 8/8] drm/fence: add out-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 8/8] drm/fence: add out-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
      Re: [RFC 8/8] drm/fence: add out-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 21:20 +0200
  [RFC 4/8] drm/fence: add in-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 4/8] drm/fence: add in-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:10 +0200
      Re: [RFC 4/8] drm/fence: add in-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 20:50 +0200
    Re: [RFC 4/8] drm/fence: add in-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
  [RFC 7/8] drm/fence: create per-crtc sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200

csiph-web