Re: [PATCH] drm/vgem: Pin our pages for dmabuf exports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]