[PATCH] drm/i915: Add VM_DONTEXPAND to exported buffers

Krzysztof Karas krzysztof.karas at intel.com
Thu Jan 9 11:22:00 UTC 2025


Hi Jacek,

On 2025-01-08 at 11:53:46 +0100, Jacek Lawrynowicz wrote:
> drm_gem_mmap_obj() expects VM_DONTEXPAND flag to be set after mmap
> callback is executed. Set this flag at the end of i915_gem_dmabuf_mmap()
> to prevent WARN on mmap in buffers imported from i915 e.g.,
...
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
> @@ -110,6 +110,7 @@ static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *
>  	if (ret)
>  		return ret;
>  
> +	vm_flags_set(vma, VM_DONTEXPAND);
>  	vma_set_file(vma, obj->base.filp);
>  
>  	return 0;
> 
Is this an existing issue somewhere (on GitLab for example)? The fix
looks good, I'm just curious how you noticed this problem and if the
patch should have "Fixes/Closes" labels added.

Krzysztof


More information about the Intel-gfx mailing list