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
61546154 F: Documentation/devicetree/bindings/display/
61556155 F: Documentation/devicetree/bindings/gpu/
61566156 F: Documentation/gpu/
6157−F: drivers/gpu/drm/
6158−F: drivers/gpu/vga/
6157+F: drivers/gpu/
61596158 F: include/drm/
61606159 F: include/linux/vga*
61616160 F: include/uapi/drm/
drivers/gpu/drm/Kconfig+2−3
@@ -117,9 +117,8 @@ config DRM_DEBUG_MODESET_LOCK · 116 unmodified lines
117117
118118 config DRM_FBDEV_EMULATION
119119 bool "Enable legacy fbdev support for your modesetting driver"
120− depends on DRM
121− depends on FB=y || FB=DRM
122− select DRM_KMS_HELPER
120+ depends on DRM_KMS_HELPER
121+ depends on FB=y || FB=DRM_KMS_HELPER
123122 select FB_CFB_FILLRECT
124123 select FB_CFB_COPYAREA
125124 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
6060 goto unlock;
6161 }
6262
63− ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
64− TTM_BO_VM_NUM_PREFAULT, 1);
65− drm_dev_exit(idx);
63+ ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
64+ TTM_BO_VM_NUM_PREFAULT);
65+
66+ drm_dev_exit(idx);
6667 } else {
6768 ret = ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
6869 }
drivers/gpu/drm/drm_modeset_lock.c+7−7
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 static DEFINE_WW_CLASS(crtc_ww_class);
8080
8181 #if IS_ENABLED(CONFIG_DRM_DEBUG_MODESET_LOCK)
82−static noinline depot_stack_handle_t __stack_depot_save(void)
82+static noinline depot_stack_handle_t __drm_stack_depot_save(void)
8383 {
8484 unsigned long entries[8];
8585 unsigned int n;
@@ -89,7 +89,7 @@ static noinline depot_stack_handle_t __stack_depot_save(void) · 3 unmodified lines
8989 return stack_depot_save(entries, n, GFP_NOWAIT | __GFP_NOWARN);
9090 }
9191
92−static void __stack_depot_print(depot_stack_handle_t stack_depot)
92+static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)
9393 {
9494 struct drm_printer p = drm_debug_printer("drm_modeset_lock");
9595 unsigned long *entries;
@@ -108,11 +108,11 @@ static void __stack_depot_print(depot_stack_handle_t stack_depot) · 12 unmodified lines
108108 kfree(buf);
109109 }
110110 #else /* CONFIG_DRM_DEBUG_MODESET_LOCK */
111−static depot_stack_handle_t __stack_depot_save(void)
111+static depot_stack_handle_t __drm_stack_depot_save(void)
112112 {
113113 return 0;
114114 }
115−static void __stack_depot_print(depot_stack_handle_t stack_depot)
115+static void __drm_stack_depot_print(depot_stack_handle_t stack_depot)
116116 {
117117 }
118118 #endif /* CONFIG_DRM_DEBUG_MODESET_LOCK */
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(drm_modeset_acquire_fini); · 147 unmodified lines
266266 void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *ctx)
267267 {
268268 if (WARN_ON(ctx->contended))
269− __stack_depot_print(ctx->stack_depot);
269+ __drm_stack_depot_print(ctx->stack_depot);
270270
271271 while (!list_empty(&ctx->locked)) {
272272 struct drm_modeset_lock *lock;
@@ -286,7 +286,7 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, · 13 unmodified lines
286286 int ret;
287287
288288 if (WARN_ON(ctx->contended))
289− __stack_depot_print(ctx->stack_depot);
289+ __drm_stack_depot_print(ctx->stack_depot);
290290
291291 if (ctx->trylock_only) {
292292 lockdep_assert_held(&ctx->ww_ctx);
@@ -317,7 +317,7 @@ static inline int modeset_lock(struct drm_modeset_lock *lock, · 24 unmodified lines
317317 ret = 0;
318318 } else if (ret == -EDEADLK) {
319319 ctx->contended = lock;
320− ctx->stack_depot = __stack_depot_save();
320+ ctx->stack_depot = __drm_stack_depot_save();
321321 }
322322
323323 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
8181 struct drm_plane_state *old_plane_state, *new_plane_state;
8282 bool plane_disabling = false;
8383 int i;
84− bool fence_cookie = dma_fence_begin_signalling();
8584
8685 drm_atomic_helper_commit_modeset_disables(dev, state);
8786
@@ -112,7 +111,6 @@ static void imx_drm_atomic_commit_tail(struct drm_atomic_state *state) · 24 unmodified lines
112111 }
113112
114113 drm_atomic_helper_commit_hw_done(state);
115− dma_fence_end_signalling(fence_cookie);
116114 }
117115
118116 static 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
5656
5757 nouveau_bo_del_io_reserve_lru(bo);
5858 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);
6060 nouveau_bo_add_io_reserve_lru(bo);
6161 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
6262 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
6161 goto unlock_resv;
6262
6363 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);
6565 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
6666 goto unlock_mclk;
6767
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
173173 }
174174 EXPORT_SYMBOL(ttm_bo_vm_reserve);
175175
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− */
190−static 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;
244−out_fallback:
245− count_vm_event(THP_FAULT_FALLBACK);
246− return VM_FAULT_FALLBACK;
247−}
248−#else
249−static 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−
259176 /**
260177 * ttm_bo_vm_fault_reserved - TTM fault helper
261178 * @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
263180 * @num_prefault: Maximum number of prefault pages. The caller may want to
264181 * specify this based on madvice settings and the size of the GPU object
265182 * backed by the memory.
266− * @fault_page_size: The size of the fault in pages.
267183 *
268184 * This function inserts one or more page table entries pointing to the
269185 * 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
277193 */
278194 vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
279195 pgprot_t prot,
280− pgoff_t num_prefault,
281− pgoff_t fault_page_size)
196+ pgoff_t num_prefault)
282197 {
283198 struct vm_area_struct *vma = vmf->vma;
284199 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
329244 prot = pgprot_decrypted(prot);
330245 }
331246
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−
337247 /*
338248 * Speculatively prefault a number of pages. Only error on
339249 * first page.
@@ -429,7 +339,7 @@ vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf) · 89 unmodified lines
429339
430340 prot = vma->vm_page_prot;
431341 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);
433343 drm_dev_exit(idx);
434344 } else {
435345 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
3030 int bval = (i + block * EDID_LENGTH) << 8;
3131 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
3232 0x02, (0x80 | (0x02 << 5)), bval,
33− 0xA1, read_buff, 2, HZ);
33+ 0xA1, read_buff, 2, 1000);
3434 if (ret < 1) {
3535 DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);
3636 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
163163 struct drm_file *drm_file = filp->private_data;
164164 struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
165165 struct drm_device *dev = drm_file->minor->dev;
166+ struct virtio_gpu_device *vgdev = dev->dev_private;
166167 struct drm_pending_event *e = NULL;
167168 __poll_t mask = 0;
168169
169− if (!vfpriv->ring_idx_mask)
170+ if (!vgdev->has_virgl_3d || !vfpriv || !vfpriv->ring_idx_mask)
170171 return drm_poll(filp, wait);
171172
172173 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
15501550 pgoff_t start, pgoff_t end);
15511551 vm_fault_t vmw_bo_vm_fault(struct vm_fault *vmf);
15521552 vm_fault_t vmw_bo_vm_mkwrite(struct vm_fault *vmf);
1553−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1554−vm_fault_t vmw_bo_vm_huge_fault(struct vm_fault *vmf,
1555− enum page_entry_size pe_size);
1556−#endif
15571553
15581554 /* Transparent hugepage support - vmwgfx_thp.c */
15591555 #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
477477 else
478478 prot = vm_get_page_prot(vma->vm_flags);
479479
480− ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault, 1);
480+ ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault);
481481 if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
482482 return ret;
483483
@@ -486,73 +486,3 @@ out_unlock: · 2 unmodified lines
486486
487487 return ret;
488488 }
489−
490−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
491−vm_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−
553−out_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
6161 .fault = vmw_bo_vm_fault,
6262 .open = ttm_bo_vm_open,
6363 .close = ttm_bo_vm_close,
64−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
65− .huge_fault = vmw_bo_vm_huge_fault,
66−#endif
6764 };
6865 struct drm_file *file_priv = filp->private_data;
6966 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
584584
585585 vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
586586 pgprot_t prot,
587− pgoff_t num_prefault,
588− pgoff_t fault_page_size);
587+ pgoff_t num_prefault);
589588
590589 vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf);
591590

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