diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
| commit | a57cb1c1d7974c62a5c80f7869e35b492ace12cd (patch) | |
| tree | 5a42ee9a668f171143464bc86013954c1bbe94ad /drivers/gpu/drm/drm_vm.c | |
| parent | cf1b3341afab9d3ad02a76b3a619ea027dcf4e28 (diff) | |
| parent | e1e14ab8411df344a17687821f8f78f0a1e73cbb (diff) | |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
- a few misc things
- kexec updates
- DMA-mapping updates to better support networking DMA operations
- IPC updates
- various MM changes to improve DAX fault handling
- lots of radix-tree changes, mainly to the test suite. All leading up
to reimplementing the IDA/IDR code to be a wrapper layer over the
radix-tree. However the final trigger-pulling patch is held off for
4.11.
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
radix tree test suite: delete unused rcupdate.c
radix tree test suite: add new tag check
radix-tree: ensure counts are initialised
radix tree test suite: cache recently freed objects
radix tree test suite: add some more functionality
idr: reduce the number of bits per level from 8 to 6
rxrpc: abstract away knowledge of IDR internals
tpm: use idr_find(), not idr_find_slowpath()
idr: add ida_is_empty
radix tree test suite: check multiorder iteration
radix-tree: fix replacement for multiorder entries
radix-tree: add radix_tree_split_preload()
radix-tree: add radix_tree_split
radix-tree: add radix_tree_join
radix-tree: delete radix_tree_range_tag_if_tagged()
radix-tree: delete radix_tree_locate_item()
radix-tree: improve multiorder iterators
btrfs: fix race in btrfs_free_dummy_fs_info()
radix-tree: improve dump output
radix-tree: make radix_tree_find_next_bit more useful
...
Diffstat (limited to 'drivers/gpu/drm/drm_vm.c')
| -rw-r--r-- | drivers/gpu/drm/drm_vm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index caa4e4ca616d..bd311c77c254 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c | |||
| @@ -124,8 +124,7 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 124 | * Using vm_pgoff as a selector forces us to use this unusual | 124 | * Using vm_pgoff as a selector forces us to use this unusual |
| 125 | * addressing scheme. | 125 | * addressing scheme. |
| 126 | */ | 126 | */ |
| 127 | resource_size_t offset = (unsigned long)vmf->virtual_address - | 127 | resource_size_t offset = vmf->address - vma->vm_start; |
| 128 | vma->vm_start; | ||
| 129 | resource_size_t baddr = map->offset + offset; | 128 | resource_size_t baddr = map->offset + offset; |
| 130 | struct drm_agp_mem *agpmem; | 129 | struct drm_agp_mem *agpmem; |
| 131 | struct page *page; | 130 | struct page *page; |
| @@ -195,7 +194,7 @@ static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 195 | if (!map) | 194 | if (!map) |
| 196 | return VM_FAULT_SIGBUS; /* Nothing allocated */ | 195 | return VM_FAULT_SIGBUS; /* Nothing allocated */ |
| 197 | 196 | ||
| 198 | offset = (unsigned long)vmf->virtual_address - vma->vm_start; | 197 | offset = vmf->address - vma->vm_start; |
| 199 | i = (unsigned long)map->handle + offset; | 198 | i = (unsigned long)map->handle + offset; |
| 200 | page = vmalloc_to_page((void *)i); | 199 | page = vmalloc_to_page((void *)i); |
| 201 | if (!page) | 200 | if (!page) |
| @@ -301,7 +300,8 @@ static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 301 | if (!dma->pagelist) | 300 | if (!dma->pagelist) |
| 302 | return VM_FAULT_SIGBUS; /* Nothing allocated */ | 301 | return VM_FAULT_SIGBUS; /* Nothing allocated */ |
| 303 | 302 | ||
| 304 | offset = (unsigned long)vmf->virtual_address - vma->vm_start; /* vm_[pg]off[set] should be 0 */ | 303 | offset = vmf->address - vma->vm_start; |
| 304 | /* vm_[pg]off[set] should be 0 */ | ||
| 305 | page_nr = offset >> PAGE_SHIFT; /* page_nr could just be vmf->pgoff */ | 305 | page_nr = offset >> PAGE_SHIFT; /* page_nr could just be vmf->pgoff */ |
| 306 | page = virt_to_page((void *)dma->pagelist[page_nr]); | 306 | page = virt_to_page((void *)dma->pagelist[page_nr]); |
| 307 | 307 | ||
| @@ -337,7 +337,7 @@ static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 337 | if (!entry->pagelist) | 337 | if (!entry->pagelist) |
| 338 | return VM_FAULT_SIGBUS; /* Nothing allocated */ | 338 | return VM_FAULT_SIGBUS; /* Nothing allocated */ |
| 339 | 339 | ||
| 340 | offset = (unsigned long)vmf->virtual_address - vma->vm_start; | 340 | offset = vmf->address - vma->vm_start; |
| 341 | map_offset = map->offset - (unsigned long)dev->sg->virtual; | 341 | map_offset = map->offset - (unsigned long)dev->sg->virtual; |
| 342 | page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT); | 342 | page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT); |
| 343 | page = entry->pagelist[page_offset]; | 343 | page = entry->pagelist[page_offset]; |
