search for: vm_get_page_prot

Displaying 20 results from an estimated 24 matches for "vm_get_page_prot".

2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
..._gem_shmem_free_object(obj); } +static int virtio_gpu_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) +{ + pgprot_t prot; + int ret; + + ret = drm_gem_shmem_mmap(obj, vma); + if (ret < 0) + return ret; + + /* virtio-gpu needs normal caching, so clear writecombine */ + prot = vm_get_page_prot(vma->vm_flags); + prot = pgprot_decrypted(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs...
2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
..._gem_shmem_free_object(obj); } +static int virtio_gpu_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) +{ + pgprot_t prot; + int ret; + + ret = drm_gem_shmem_mmap(obj, vma); + if (ret < 0) + return ret; + + /* virtio-gpu needs normal caching, so clear writecombine */ + prot = vm_get_page_prot(vma->vm_flags); + prot = pgprot_decrypted(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs...
2020 Sep 09
1
[bug report] drm/nouveau: move io_reserve_lru handling into the driver v5
...vma->vm_private_data; 130 pgprot_t prot; 131 vm_fault_t ret; 132 133 ret = ttm_bo_vm_reserve(bo, vmf); 134 if (ret) 135 return ret; 136 137 nouveau_bo_del_io_reserve_lru(bo); 138 139 prot = vm_get_page_prot(vma->vm_flags); 140 ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1); 141 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) 142 return ret; ^^^^^^^^^^ Call dma_resv_unlock()...
2024 Jan 22
2
[PATCH] mm: Remove double faults once write a device pfn
...eau_gem.c > index 49c2bcbef129..7e1453762ec9 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_gem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c > @@ -56,7 +56,7 @@ static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf) > > nouveau_bo_del_io_reserve_lru(bo); > prot = vm_get_page_prot(vma->vm_flags); > - ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); > + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, true); > nouveau_bo_add_io_reserve_lru(bo); > if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY...
2024 Jan 24
1
[PATCH] mm: Remove double faults once write a device pfn
...gt;>>>> @@ -56,7 +56,7 @@ static vm_fault_t nouveau_ttm_fault(struct >> >>>>> vm_fault >> >>>>> *vmf) >> >>>>> >> >>>>> nouveau_bo_del_io_reserve_lru(bo); >> >>>>> prot = vm_get_page_prot(vma->vm_flags); >> >>>>> - ret = ttm_bo_vm_fault_reserved(vmf, prot, >> >>>> TTM_BO_VM_NUM_PREFAULT); >> >>>>> + ret = ttm_bo_vm_fault_reserved(vmf, prot, >> >>>> TTM_BO_VM_NUM_PREFAULT, >> >>>>&g...
2024 Jan 23
2
[PATCH] mm: Remove double faults once write a device pfn
...;> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c >>> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c >>> @@ -56,7 +56,7 @@ static vm_fault_t nouveau_ttm_fault(struct vm_fault >>> *vmf) >>> >>> nouveau_bo_del_io_reserve_lru(bo); >>> prot = vm_get_page_prot(vma->vm_flags); >>> - ret = ttm_bo_vm_fault_reserved(vmf, prot, >> TTM_BO_VM_NUM_PREFAULT); >>> + ret = ttm_bo_vm_fault_reserved(vmf, prot, >> TTM_BO_VM_NUM_PREFAULT, >>> +true); >>> nouveau_bo_add_io_reserve_lru(bo); >>> if...
2024 Jan 24
2
[PATCH] mm: Remove double faults once write a device pfn
...+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c >>>>> @@ -56,7 +56,7 @@ static vm_fault_t nouveau_ttm_fault(struct >>>>> vm_fault >>>>> *vmf) >>>>> >>>>> nouveau_bo_del_io_reserve_lru(bo); >>>>> prot = vm_get_page_prot(vma->vm_flags); >>>>> - ret = ttm_bo_vm_fault_reserved(vmf, prot, >>>> TTM_BO_VM_NUM_PREFAULT); >>>>> + ret = ttm_bo_vm_fault_reserved(vmf, prot, >>>> TTM_BO_VM_NUM_PREFAULT, >>>>> +true); >>>>> nouveau...
2019 Dec 10
0
[PATCH] drm/virtio: fix mmap page attributes
...io_gpu_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) > +{ > + pgprot_t prot; > + int ret; > + > + ret = drm_gem_shmem_mmap(obj, vma); > + if (ret < 0) > + return ret; > + > + /* virtio-gpu needs normal caching, so clear writecombine */ > + prot = vm_get_page_prot(vma->vm_flags); > + prot = pgprot_decrypted(prot); > + vma->vm_page_prot = prot; > + return 0; > +} There's similar code in udl, [1] which still uses writecombine for imported buffers. Virtio does not need this? Aside from this, do you think we could handle all special cases...
2019 Sep 17
0
[PATCH v2 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...uct file *filp, struct vm_area_struct *vma) return ret; } - /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/...
2019 Sep 19
0
[PATCH v3 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...uct file *filp, struct vm_area_struct *vma) return ret; } - /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/...
2019 Oct 16
0
[PATCH v4 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...uct file *filp, struct vm_area_struct *vma) return ret; } - /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/...
2020 Jan 24
1
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...ct vm_area_struct *vma = vmf->vma; > + struct ttm_buffer_object *bo = vma->vm_private_data; > + pgprot_t prot; > + vm_fault_t ret; > + > + ret = ttm_bo_vm_reserve(bo, vmf); > + if (ret) > + return ret; > + > + nouveau_bo_del_io_reserve_lru(bo); > + > + prot = vm_get_page_prot(vma->vm_flags); > + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); > + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) > + return ret; > + > + nouveau_bo_add_io_reserve_lru(bo); > + > + dma_resv_unlock(bo->base.res...
2020 Jan 28
1
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...ct ttm_buffer_object *bo = vma->vm_private_data; > + pgprot_t prot; > + vm_fault_t ret; > + > + ret = ttm_bo_vm_reserve(bo, vmf); > + if (ret) > + return ret; > + > + nouveau_bo_del_io_reserve_lru(bo); > + > + prot = vm_get_page_prot(vma->vm_flags); > + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); > + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) > + return ret; > + > + nouveau_bo_add_io_reserve_lru(bo); > + > +...
2020 Jan 24
4
TTM/Nouveau cleanups
Hi guys, I've already send this out in September last year, but only got a response from Daniel. Could you guys please test this and tell me what you think about it? Basically I'm trying to remove all driver specific features from TTM which don't need to be inside the framework. Thanks, Christian.
2020 Jan 24
0
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...ult_t nouveau_ttm_fault(struct vm_fault *vmf) +{ + struct vm_area_struct *vma = vmf->vma; + struct ttm_buffer_object *bo = vma->vm_private_data; + pgprot_t prot; + vm_fault_t ret; + + ret = ttm_bo_vm_reserve(bo, vmf); + if (ret) + return ret; + + nouveau_bo_del_io_reserve_lru(bo); + + prot = vm_get_page_prot(vma->vm_flags); + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) + return ret; + + nouveau_bo_add_io_reserve_lru(bo); + + dma_resv_unlock(bo->base.resv); + + return ret; +} + +static st...
2020 Aug 21
0
[PATCH 2/3] drm/nouveau: move io_reserve_lru handling into the driver v4
...ult_t nouveau_ttm_fault(struct vm_fault *vmf) +{ + struct vm_area_struct *vma = vmf->vma; + struct ttm_buffer_object *bo = vma->vm_private_data; + pgprot_t prot; + vm_fault_t ret; + + ret = ttm_bo_vm_reserve(bo, vmf); + if (ret) + return ret; + + nouveau_bo_del_io_reserve_lru(bo); + + prot = vm_get_page_prot(vma->vm_flags); + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1); + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) + return ret; + + nouveau_bo_add_io_reserve_lru(bo); + + dma_resv_unlock(bo->base.resv); + + return ret; +} + +static...
2019 Oct 09
0
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver
...f concurrent faults will all fail because they're all removed themselves from the lru, so can't see anyone else to throw out? Same problem really that ttm had (well still has I think for !amdgpu) with its other lru ... Or am I getting totally lost again here? -Daniel > + > + prot = vm_get_page_prot(vma->vm_flags); > + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); > + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) > + return ret; > + > + nouveau_bo_add_io_reserve_lru(bo); > + > + dma_resv_unlock(bo->base.res...
2010 Mar 10
34
[Patch RFC] nouveau accelerated on Xen pv-ops kernel
Hi, Following is a simple patch that is needed in nouveau to get accelerated X on a Xen dom0 pv_ops kernel. The kernel is jeremy's 2.6.31.6 as of 20100222. The whole gpu tree of nouveau (which is almost the mainline merge), was substituted into the kernel-tree. All components of X (mesa, Xorg-server-7.5, xf86-nouveau, libdrm) used of the same day. Patch: diff -Naur
2010 Mar 10
34
[Patch RFC] nouveau accelerated on Xen pv-ops kernel
Hi, Following is a simple patch that is needed in nouveau to get accelerated X on a Xen dom0 pv_ops kernel. The kernel is jeremy's 2.6.31.6 as of 20100222. The whole gpu tree of nouveau (which is almost the mainline merge), was substituted into the kernel-tree. All components of X (mesa, Xorg-server-7.5, xf86-nouveau, libdrm) used of the same day. Patch: diff -Naur
2019 Sep 30
3
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver
...ult_t nouveau_ttm_fault(struct vm_fault *vmf) +{ + struct vm_area_struct *vma = vmf->vma; + struct ttm_buffer_object *bo = vma->vm_private_data; + pgprot_t prot; + vm_fault_t ret; + + ret = ttm_bo_vm_reserve(bo, vmf); + if (ret) + return ret; + + nouveau_bo_del_io_reserve_lru(bo); + + prot = vm_get_page_prot(vma->vm_flags); + ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT); + if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) + return ret; + + nouveau_bo_add_io_reserve_lru(bo); + + dma_resv_unlock(bo->base.resv); + + return ret; +} + +static st...