History

Merge tag 'drm-misc-next-fixes-2021-11-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

Removed the TTM Huge Page functionnality to address a crash, a timeout fix for udl, CONFIG_FB dependency improvements, a fix for a circular locking depency in imx, a NULL pointer dereference fix for virtio, and a naming collision fix for drm/locking. Signed-off-by: Dave Airlie <airlied@redhat.com>

Dave Airlie committed 5 years ago

Commit f8ca7b72 parents 917a6f0 bcae3af14 files · +23 −193Browse files

Unified · Split

14 files
  1. MAINTAINERS +1 −2
  2. drivers/gpu/drm/Kconfig +2 −3
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +4 −3
  4. drivers/gpu/drm/drm_modeset_lock.c +7 −7
  5. drivers/gpu/drm/imx/imx-drm-core.c +0 −2
  6. drivers/gpu/drm/nouveau/nouveau_gem.c +1 −1
  7. drivers/gpu/drm/radeon/radeon_gem.c +1 −1
  8. drivers/gpu/drm/ttm/ttm_bo_vm.c +2 −92
  9. drivers/gpu/drm/udl/udl_connector.c +1 −1
  10. drivers/gpu/drm/virtio/virtgpu_drv.c +2 −1
  11. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 −4
  12. drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c +1 −71
  13. drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +0 −3
  14. include/drm/ttm/ttm_bo_api.h +1 −2
MAINTAINERS+1−2
@@ -6154,8 +6154,7 @@ T: git git://anongit.freedesktop.org/drm/drm · 6153 unmodified lines
6154F: Documentation/devicetree/bindings/display/6154F: Documentation/devicetree/bindings/display/
6155F: Documentation/devicetree/bindings/gpu/6155F: Documentation/devicetree/bindings/gpu/
6156F: Documentation/gpu/6156F: Documentation/gpu/
6157F: drivers/gpu/drm/6157F: drivers/gpu/
6158F: drivers/gpu/vga/
6159F: include/drm/6158F: include/drm/
6160F: include/linux/vga*6159F: include/linux/vga*
6161F: include/uapi/drm/6160F: include/uapi/drm/
drivers/gpu/drm/Kconfig+2−3
@@ -117,9 +117,8 @@ config DRM_DEBUG_MODESET_LOCK · 116 unmodified lines
117 117
118config DRM_FBDEV_EMULATION118config DRM_FBDEV_EMULATION
119 bool "Enable legacy fbdev support for your modesetting driver"119 bool "Enable legacy fbdev support for your modesetting driver"
120 depends on DRM120 depends on DRM_KMS_HELPER
121 depends on FB=y || FB=DRM121 depends on FB=y || FB=DRM_KMS_HELPER
122 select DRM_KMS_HELPER
123 select FB_CFB_FILLRECT122 select FB_CFB_FILLRECT
124 select FB_CFB_COPYAREA123 select FB_CFB_COPYAREA
125 select FB_CFB_IMAGEBLIT124 select FB_CFB_IMAGEBLIT
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+4−3
@@ -60,9 +60,10 @@ static vm_fault_t amdgpu_gem_fault(struct vm_fault *vmf) · 59 unmodified lines
60 goto unlock;60 goto unlock;
61 }61 }
62 62
63 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,63 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
64 TTM_BO_VM_NUM_PREFAULT, 1);64 TTM_BO_VM_NUM_PREFAULT);
65 drm_dev_exit(idx);65
66 drm_dev_exit(idx);
66 } else {67 } else {
67 ret = ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);68 ret = ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
68 }69 }
drivers/gpu/drm/drm_modeset_lock.c+7−7
@@ -79,7 +79,7 @@ · 78 unmodified lines
79static DEFINE_WW_CLASS(crtc_ww_class);79static DEFINE_WW_CLASS(crtc_ww_class);
80 80
81#if IS_ENABLED(CONFIG_DRM_DEBUG_MODESET_LOCK)81#if IS_ENABLED(CONFIG_DRM_DEBUG_MODESET_LOCK)
82static noinline depot_stack_handle_t __stack_depot_save(void)82static noinline depot_stack_handle_t __drm_stack_depot_save(void)
83{83{
84 unsigned long entries[8];84 unsigned long entries[8];
85 unsigned int n;85 unsigned int n;
@@ -89,7 +89,7 @@ static noinline depot_stack_handle_t __stack_depot_save(void) · 3 unmodified lines
89 return stack_depot_save(entries, n, GFP_NOWAIT | __GFP_NOWARN);89 return stack_depot_save(entries, n, GFP_NOWAIT | __GFP_NOWARN);
90}90}
91 91
92static void __stack_depot_print(depot_stack_handle_t stack_depot)92static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)
93{93{
94 struct drm_printer p = drm_debug_printer("drm_modeset_lock");94 struct drm_printer p = drm_debug_printer("drm_modeset_lock");
95 unsigned long *entries;95 unsigned long *entries;
@@ -108,11 +108,11 @@ static void __stack_depot_print(depot_stack_handle_t stack_depot) · 12 unmodified lines
108 kfree(buf);108 kfree(buf);
109}109}
110#else /* CONFIG_DRM_DEBUG_MODESET_LOCK */110#else /* CONFIG_DRM_DEBUG_MODESET_LOCK */
111static depot_stack_handle_t __stack_depot_save(void)111static depot_stack_handle_t __drm_stack_depot_save(void)
112{112{
113 return 0;113 return 0;
114}114}
115static void __stack_depot_print(depot_stack_handle_t stack_depot)115static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)
116{116{
117}117}
118#endif /* CONFIG_DRM_DEBUG_MODESET_LOCK */118#endif /* CONFIG_DRM_DEBUG_MODESET_LOCK */
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(drm_modeset_acquire_fini); · 147 unmodified lines
266void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *ctx)266void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *ctx)
267{267{
268 if (WARN_ON(ctx->contended))268 if (WARN_ON(ctx->contended))
269 __stack_depot_print(ctx->stack_depot);269 __drm_stack_depot_print(ctx->stack_depot);
270 270
271 while (!list_empty(&ctx->locked)) {271 while (!list_empty(&ctx->locked)) {
272 struct drm_modeset_lock *lock;272 struct drm_modeset_lock *lock;
@@ -286,7 +286,7 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, · 13 unmodified lines
286 int ret;286 int ret;
287 287
288 if (WARN_ON(ctx->contended))288 if (WARN_ON(ctx->contended))
289 __stack_depot_print(ctx->stack_depot);289 __drm_stack_depot_print(ctx->stack_depot);
290 290
291 if (ctx->trylock_only) {291 if (ctx->trylock_only) {
292 lockdep_assert_held(&ctx->ww_ctx);292 lockdep_assert_held(&ctx->ww_ctx);
@@ -317,7 +317,7 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, · 24 unmodified lines
317 ret = 0;317 ret = 0;
318 } else if (ret == -EDEADLK) {318 } else if (ret == -EDEADLK) {
319 ctx->contended = lock;319 ctx->contended = lock;
320 ctx->stack_depot = __stack_depot_save();320 ctx->stack_depot = __drm_stack_depot_save();
321 }321 }
322 322
323 return ret;323 return ret;
drivers/gpu/drm/imx/imx-drm-core.c+0−2
@@ -81,7 +81,6 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) · 80 unmodified lines
81 struct drm_plane_state *old_plane_state, *new_plane_state;81 struct drm_plane_state *old_plane_state, *new_plane_state;
82 bool plane_disabling = false;82 bool plane_disabling = false;
83 int i;83 int i;
84 bool fence_cookie = dma_fence_begin_signalling();
85 84
86 drm_atomic_helper_commit_modeset_disables(dev, state);85 drm_atomic_helper_commit_modeset_disables(dev, state);
87 86
@@ -112,7 +111,6 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) · 24 unmodified lines
112 }111 }
113 112
114 drm_atomic_helper_commit_hw_done(state);113 drm_atomic_helper_commit_hw_done(state);
115 dma_fence_end_signalling(fence_cookie);
116}114}
117 115
118static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {116static const struct drm_mode_config_helper_funcs imx_drm_mode_config_helpers = {
drivers/gpu/drm/nouveau/nouveau_gem.c+1−1
@@ -56,7 +56,7 @@ static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf) · 55 unmodified lines
56 56
57 nouveau_bo_del_io_reserve_lru(bo);57 nouveau_bo_del_io_reserve_lru(bo);
58 prot = vm_get_page_prot(vma->vm_flags);58 prot = vm_get_page_prot(vma->vm_flags);
59 ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1);59 ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT);
60 nouveau_bo_add_io_reserve_lru(bo);60 nouveau_bo_add_io_reserve_lru(bo);
61 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))61 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
62 return ret;62 return ret;
drivers/gpu/drm/radeon/radeon_gem.c+1−1
@@ -61,7 +61,7 @@ static vm_fault_t radeon_gem_fault(struct vm_fault *vmf) · 60 unmodified lines
61 goto unlock_resv;61 goto unlock_resv;
62 62
63 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,63 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
64 TTM_BO_VM_NUM_PREFAULT, 1);64 TTM_BO_VM_NUM_PREFAULT);
65 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))65 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
66 goto unlock_mclk;66 goto unlock_mclk;
67 67
drivers/gpu/drm/ttm/ttm_bo_vm.c+2−92
@@ -173,89 +173,6 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo, · 172 unmodified lines
173}173}
174EXPORT_SYMBOL(ttm_bo_vm_reserve);174EXPORT_SYMBOL(ttm_bo_vm_reserve);
175 175
176#ifdef CONFIG_TRANSPARENT_HUGEPAGE
177/**
178 * ttm_bo_vm_insert_huge - Insert a pfn for PUD or PMD faults
179 * @vmf: Fault data
180 * @bo: The buffer object
181 * @page_offset: Page offset from bo start
182 * @fault_page_size: The size of the fault in pages.
183 * @pgprot: The page protections.
184 * Does additional checking whether it's possible to insert a PUD or PMD
185 * pfn and performs the insertion.
186 *
187 * Return: VM_FAULT_NOPAGE on successful insertion, VM_FAULT_FALLBACK if
188 * a huge fault was not possible, or on insertion error.
189 */
190static vm_fault_t ttm_bo_vm_insert_huge(struct vm_fault *vmf,
191 struct ttm_buffer_object *bo,
192 pgoff_t page_offset,
193 pgoff_t fault_page_size,
194 pgprot_t pgprot)
195{
196 pgoff_t i;
197 vm_fault_t ret;
198 unsigned long pfn;
199 pfn_t pfnt;
200 struct ttm_tt *ttm = bo->ttm;
201 bool write = vmf->flags & FAULT_FLAG_WRITE;
202
203 /* Fault should not cross bo boundary. */
204 page_offset &= ~(fault_page_size - 1);
205 if (page_offset + fault_page_size > bo->resource->num_pages)
206 goto out_fallback;
207
208 if (bo->resource->bus.is_iomem)
209 pfn = ttm_bo_io_mem_pfn(bo, page_offset);
210 else
211 pfn = page_to_pfn(ttm->pages[page_offset]);
212
213 /* pfn must be fault_page_size aligned. */
214 if ((pfn & (fault_page_size - 1)) != 0)
215 goto out_fallback;
216
217 /* Check that memory is contiguous. */
218 if (!bo->resource->bus.is_iomem) {
219 for (i = 1; i < fault_page_size; ++i) {
220 if (page_to_pfn(ttm->pages[page_offset + i]) != pfn + i)
221 goto out_fallback;
222 }
223 } else if (bo->bdev->funcs->io_mem_pfn) {
224 for (i = 1; i < fault_page_size; ++i) {
225 if (ttm_bo_io_mem_pfn(bo, page_offset + i) != pfn + i)
226 goto out_fallback;
227 }
228 }
229
230 pfnt = __pfn_to_pfn_t(pfn, PFN_DEV);
231 if (fault_page_size == (HPAGE_PMD_SIZE >> PAGE_SHIFT))
232 ret = vmf_insert_pfn_pmd_prot(vmf, pfnt, pgprot, write);
233#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
234 else if (fault_page_size == (HPAGE_PUD_SIZE >> PAGE_SHIFT))
235 ret = vmf_insert_pfn_pud_prot(vmf, pfnt, pgprot, write);
236#endif
237 else
238 WARN_ON_ONCE(ret = VM_FAULT_FALLBACK);
239
240 if (ret != VM_FAULT_NOPAGE)
241 goto out_fallback;
242
243 return VM_FAULT_NOPAGE;
244out_fallback:
245 count_vm_event(THP_FAULT_FALLBACK);
246 return VM_FAULT_FALLBACK;
247}
248#else
249static vm_fault_t ttm_bo_vm_insert_huge(struct vm_fault *vmf,
250 struct ttm_buffer_object *bo,
251 pgoff_t page_offset,
252 pgoff_t fault_page_size,
253 pgprot_t pgprot)
254{
255 return VM_FAULT_FALLBACK;
256}
257#endif
258
259/**176/**
260 * ttm_bo_vm_fault_reserved - TTM fault helper177 * ttm_bo_vm_fault_reserved - TTM fault helper
261 * @vmf: The struct vm_fault given as argument to the fault callback178 * @vmf: The struct vm_fault given as argument to the fault callback
@@ -263,7 +180,6 @@ static vm_fault_t ttm_bo_vm_insert_huge(struct vm_fault *vmf, · 1 unmodified line
263 * @num_prefault: Maximum number of prefault pages. The caller may want to180 * @num_prefault: Maximum number of prefault pages. The caller may want to
264 * specify this based on madvice settings and the size of the GPU object181 * specify this based on madvice settings and the size of the GPU object
265 * backed by the memory.182 * backed by the memory.
266 * @fault_page_size: The size of the fault in pages.
267 *183 *
268 * This function inserts one or more page table entries pointing to the184 * This function inserts one or more page table entries pointing to the
269 * memory backing the buffer object, and then returns a return code185 * memory backing the buffer object, and then returns a return code
@@ -277,8 +193,7 @@ static vm_fault_t ttm_bo_vm_insert_huge(struct vm_fault *vmf, · 7 unmodified lines
277 */193 */
278vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,194vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
279 pgprot_t prot,195 pgprot_t prot,
280 pgoff_t num_prefault,196 pgoff_t num_prefault)
281 pgoff_t fault_page_size)
282{197{
283 struct vm_area_struct *vma = vmf->vma;198 struct vm_area_struct *vma = vmf->vma;
284 struct ttm_buffer_object *bo = vma->vm_private_data;199 struct ttm_buffer_object *bo = vma->vm_private_data;
@@ -329,11 +244,6 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf, · 44 unmodified lines
329 prot = pgprot_decrypted(prot);244 prot = pgprot_decrypted(prot);
330 }245 }
331 246
332 /* We don't prefault on huge faults. Yet. */
333 if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && fault_page_size != 1)
334 return ttm_bo_vm_insert_huge(vmf, bo, page_offset,
335 fault_page_size, prot);
336
337 /*247 /*
338 * Speculatively prefault a number of pages. Only error on248 * Speculatively prefault a number of pages. Only error on
339 * first page.249 * first page.
@@ -429,7 +339,7 @@ vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf) · 89 unmodified lines
429 339
430 prot = vma->vm_page_prot;340 prot = vma->vm_page_prot;
431 if (drm_dev_enter(ddev, &idx)) {341 if (drm_dev_enter(ddev, &idx)) {
432 ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT, 1);342 ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT);
433 drm_dev_exit(idx);343 drm_dev_exit(idx);
434 } else {344 } else {
435 ret = ttm_bo_vm_dummy_page(vmf, prot);345 ret = ttm_bo_vm_dummy_page(vmf, prot);
drivers/gpu/drm/udl/udl_connector.c+1−1
@@ -30,7 +30,7 @@ static int udl_get_edid_block(void *data, u8 *buf, unsigned int block, · 29 unmodified lines
30 int bval = (i + block * EDID_LENGTH) << 8;30 int bval = (i + block * EDID_LENGTH) << 8;
31 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),31 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
32 0x02, (0x80 | (0x02 << 5)), bval,32 0x02, (0x80 | (0x02 << 5)), bval,
33 0xA1, read_buff, 2, HZ);33 0xA1, read_buff, 2, 1000);
34 if (ret < 1) {34 if (ret < 1) {
35 DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);35 DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);
36 kfree(read_buff);36 kfree(read_buff);
drivers/gpu/drm/virtio/virtgpu_drv.c+2−1
@@ -163,10 +163,11 @@ static __poll_t virtio_gpu_poll(struct file *filp, · 162 unmodified lines
163 struct drm_file *drm_file = filp->private_data;163 struct drm_file *drm_file = filp->private_data;
164 struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;164 struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
165 struct drm_device *dev = drm_file->minor->dev;165 struct drm_device *dev = drm_file->minor->dev;
166 struct virtio_gpu_device *vgdev = dev->dev_private;
166 struct drm_pending_event *e = NULL;167 struct drm_pending_event *e = NULL;
167 __poll_t mask = 0;168 __poll_t mask = 0;
168 169
169 if (!vfpriv->ring_idx_mask)170 if (!vgdev->has_virgl_3d || !vfpriv || !vfpriv->ring_idx_mask)
170 return drm_poll(filp, wait);171 return drm_poll(filp, wait);
171 172
172 poll_wait(filp, &drm_file->event_wait, wait);173 poll_wait(filp, &drm_file->event_wait, wait);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+0−4
@@ -1550,10 +1550,6 @@ void vmw_bo_dirty_unmap(struct vmw_buffer_object *vbo, · 1549 unmodified lines
1550 pgoff_t start, pgoff_t end);1550 pgoff_t start, pgoff_t end);
1551vm_fault_t vmw_bo_vm_fault(struct vm_fault *vmf);1551vm_fault_t vmw_bo_vm_fault(struct vm_fault *vmf);
1552vm_fault_t vmw_bo_vm_mkwrite(struct vm_fault *vmf);1552vm_fault_t vmw_bo_vm_mkwrite(struct vm_fault *vmf);
1553#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1554vm_fault_t vmw_bo_vm_huge_fault(struct vm_fault *vmf,
1555 enum page_entry_size pe_size);
1556#endif
1557 1553
1558/* Transparent hugepage support - vmwgfx_thp.c */1554/* Transparent hugepage support - vmwgfx_thp.c */
1559#ifdef CONFIG_TRANSPARENT_HUGEPAGE1555#ifdef CONFIG_TRANSPARENT_HUGEPAGE
drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c+1−71
@@ -477,7 +477,7 @@ vm_fault_t vmw_bo_vm_fault(struct vm_fault *vmf) · 476 unmodified lines
477 else477 else
478 prot = vm_get_page_prot(vma->vm_flags);478 prot = vm_get_page_prot(vma->vm_flags);
479 479
480 ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault, 1);480 ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault);
481 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))481 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
482 return ret;482 return ret;
483 483
@@ -486,73 +486,3 @@ out_unlock: · 2 unmodified lines
486 486
487 return ret;487 return ret;
488}488}
489
490#ifdef CONFIG_TRANSPARENT_HUGEPAGE
491vm_fault_t vmw_bo_vm_huge_fault(struct vm_fault *vmf,
492 enum page_entry_size pe_size)
493{
494 struct vm_area_struct *vma = vmf->vma;
495 struct ttm_buffer_object *bo = (struct ttm_buffer_object *)
496 vma->vm_private_data;
497 struct vmw_buffer_object *vbo =
498 container_of(bo, struct vmw_buffer_object, base);
499 pgprot_t prot;
500 vm_fault_t ret;
501 pgoff_t fault_page_size;
502 bool write = vmf->flags & FAULT_FLAG_WRITE;
503
504 switch (pe_size) {
505 case PE_SIZE_PMD:
506 fault_page_size = HPAGE_PMD_SIZE >> PAGE_SHIFT;
507 break;
508#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
509 case PE_SIZE_PUD:
510 fault_page_size = HPAGE_PUD_SIZE >> PAGE_SHIFT;
511 break;
512#endif
513 default:
514 WARN_ON_ONCE(1);
515 return VM_FAULT_FALLBACK;
516 }
517
518 /* Always do write dirty-tracking and COW on PTE level. */
519 if (write && (READ_ONCE(vbo->dirty) || is_cow_mapping(vma->vm_flags)))
520 return VM_FAULT_FALLBACK;
521
522 ret = ttm_bo_vm_reserve(bo, vmf);
523 if (ret)
524 return ret;
525
526 if (vbo->dirty) {
527 pgoff_t allowed_prefault;
528 unsigned long page_offset;
529
530 page_offset = vmf->pgoff -
531 drm_vma_node_start(&bo->base.vma_node);
532 if (page_offset >= bo->resource->num_pages ||
533 vmw_resources_clean(vbo, page_offset,
534 page_offset + PAGE_SIZE,
535 &allowed_prefault)) {
536 ret = VM_FAULT_SIGBUS;
537 goto out_unlock;
538 }
539
540 /*
541 * Write protect, so we get a new fault on write, and can
542 * split.
543 */
544 prot = vm_get_page_prot(vma->vm_flags & ~VM_SHARED);
545 } else {
546 prot = vm_get_page_prot(vma->vm_flags);
547 }
548
549 ret = ttm_bo_vm_fault_reserved(vmf, prot, 1, fault_page_size);
550 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
551 return ret;
552
553out_unlock:
554 dma_resv_unlock(bo->base.resv);
555
556 return ret;
557}
558#endif
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c+0−3
@@ -61,9 +61,6 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma) · 60 unmodified lines
61 .fault = vmw_bo_vm_fault,61 .fault = vmw_bo_vm_fault,
62 .open = ttm_bo_vm_open,62 .open = ttm_bo_vm_open,
63 .close = ttm_bo_vm_close,63 .close = ttm_bo_vm_close,
64#ifdef CONFIG_TRANSPARENT_HUGEPAGE
65 .huge_fault = vmw_bo_vm_huge_fault,
66#endif
67 };64 };
68 struct drm_file *file_priv = filp->private_data;65 struct drm_file *file_priv = filp->private_data;
69 struct vmw_private *dev_priv = vmw_priv(file_priv->minor->dev);66 struct vmw_private *dev_priv = vmw_priv(file_priv->minor->dev);
include/drm/ttm/ttm_bo_api.h+1−2
@@ -584,8 +584,7 @@ vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo, · 583 unmodified lines
584 584
585vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,585vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
586 pgprot_t prot,586 pgprot_t prot,
587 pgoff_t num_prefault,587 pgoff_t num_prefault);
588 pgoff_t fault_page_size);
589 588
590vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf);589vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf);
591 590

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t