[Intel-gfx] [PATCH 3/4] drm/i915: Pass ww ctx to pin_map, v2.

Matthew Auld matthew.william.auld at gmail.com
Thu Apr 29 14:55:46 UTC 2021


On Thu, 29 Apr 2021 at 11:10, Maarten Lankhorst
<maarten.lankhorst at linux.intel.com> wrote:
>
> This will allow us to explicitly pass the ww to pin_pages,
> when it starts taking it.
>
> This allows us to finally kill off the explicit passing of ww
> by retrieving it from the obj.
>
> Changes since v1:
> - Rename 'ret' to ptr, fix error handling of return ptr.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>

<snip>

> --- a/drivers/gpu/drm/i915/gt/intel_gtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
> @@ -65,7 +65,7 @@ int map_pt_dma_locked(struct i915_address_space *vm, struct drm_i915_gem_object
>         void *vaddr;
>
>         type = i915_coherent_map_type(vm->i915, obj, true);
> -       vaddr = i915_gem_object_pin_map(obj, type);
> +       vaddr = i915_gem_object_pin_map(obj, NULL, type);

Don't we need to pass the ww here? For all our page-tables this is
both our allocate and map for the backing page(lmem or smem), so at
least for the locked variant here would it not make sense to pass the
ww from the vma_pin() etc, in case we need to evict stuff?

>         if (IS_ERR(vaddr))
>                 return PTR_ERR(vaddr);
>


More information about the Intel-gfx mailing list