[Intel-gfx] [PATCH] drm/vgem: Pin our pages for dmabuf exports

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 22 13:34:54 UTC 2017


Quoting Chris Wilson (2017-06-22 14:30:08)
>  static void *vgem_prime_vmap(struct drm_gem_object *obj)
>  {
> +       struct drm_vgem_gem_object *bo = to_vgem_bo(obj);
>         long n_pages = obj->size >> PAGE_SHIFT;
>         struct page **pages;
>         void *addr;
>  
> -       pages = drm_gem_get_pages(obj);
> +       pages = vgem_pin_pages(bo);
>         if (IS_ERR(pages))
>                 return NULL;
>  
>         addr = vmap(pages, n_pages, 0, pgprot_writecombine(PAGE_KERNEL));
> -       drm_gem_put_pages(obj, pages, false, false);
> +
> +       vgem_unpin_pages(bo);

Ho hum, memory says vmap() itself doesn't pin the pages, so we need to
drop the pin on prime_vunamp.
-Chris


More information about the Intel-gfx mailing list