[Intel-gfx] [PATCH 2/2] drm/i915: prefer dma_fence_might_wait in wait_migration

Daniel Vetter daniel at ffwll.ch
Tue Jul 6 09:14:39 UTC 2021


On Tue, Jul 06, 2021 at 10:05:59AM +0100, Matthew Auld wrote:
> dma_fence_might_wait is more interesting here, since it also teaches
> lockdep about the fence critical section and wait_migration dependency.
> 
> Suggested-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Ofc assuming nothing goes boom with lockdep :-)
-Daniel

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_wait.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_wait.c b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
> index f909aaa09d9c..190e221eaf81 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_wait.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
> @@ -305,7 +305,7 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
>  int i915_gem_object_wait_migration(struct drm_i915_gem_object *obj,
>  				   unsigned int flags)
>  {
> -	might_sleep();
> +	dma_fence_might_wait();
>  	/* NOP for now. */
>  	return 0;
>  }
> -- 
> 2.26.3
> 

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


More information about the Intel-gfx mailing list