linux-next: manual merge of the drm tree with the mm-unstable,origin tree

Mark Brown posted 1 patch an hour ago
XE_DISPLAY_DRIVER_FEATURES |
DRIVER_GEM |
linux-next: manual merge of the drm tree with the mm-unstable,origin tree
Posted by Mark Brown an hour ago
Hi all,

Today's linux-next merge of the drm tree got a conflict in:

  drivers/gpu/drm/xe/xe_device.c

between commits:

  130910bac905a ("drm/xe/pf: Disable display in admin only PF mode")
  ef526d122b62a ("drm/xe: Fix xe_device_probe() failure")

from the mm-unstable,origin tree and commits:

  21fcb222f0d1e ("drm: Remove DRIVER_GEM_GPUVA feature flag")
  3799dc5d77855 ("drm/xe/ras: Fix boot-time ras error processing")

from the drm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/gpu/drm/xe/xe_device.c
index 3e70f2d39df29,71ce153737abe..0000000000000
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@@ -61,6 -61,7 +61,7 @@@
  #include "xe_psmi.h"
  #include "xe_pxp.h"
  #include "xe_query.h"
+ #include "xe_ras.h"
  #include "xe_shrinker.h"
  #include "xe_soc_remapper.h"
  #include "xe_survivability_mode.h"
@@@ -281,7 -282,7 +282,7 @@@ static vm_fault_t barrier_fault(struct 
  	pgprot_t prot;
  	int idx;
  
 -	prot = vm_get_page_prot(vma->vm_flags);
 +	prot = vma_get_page_prot(vma);
  
  	if (drm_dev_enter(dev, &idx)) {
  		unsigned long pfn;
@@@ -330,7 -331,7 +331,7 @@@ static int xe_pci_barrier_mmap(struct f
  	if (vma->vm_end - vma->vm_start > SZ_4K)
  		return -EINVAL;
  
 -	if (is_cow_mapping(vma->vm_flags))
 +	if (vma_is_cow_mapping(vma))
  		return -EINVAL;
  
  	if (vma->vm_flags & (VM_READ | VM_EXEC))
@@@ -396,7 -397,7 +397,7 @@@ static const struct drm_driver regular_
  	    XE_DISPLAY_DRIVER_FEATURES |
  	    DRIVER_GEM |
  	    DRIVER_RENDER | DRIVER_SYNCOBJ |
- 	    DRIVER_SYNCOBJ_TIMELINE | DRIVER_GEM_GPUVA,
+ 	    DRIVER_SYNCOBJ_TIMELINE,
  	.open = xe_file_open,
  	.postclose = xe_file_close,
  
@@@ -426,7 -427,7 +427,7 @@@ static const struct drm_ioctl_desc xe_i
  
  static const struct drm_driver admin_only_driver = {
  	.driver_features =
- 	    DRIVER_GEM | DRIVER_RENDER | DRIVER_GEM_GPUVA,
+ 	    DRIVER_GEM | DRIVER_RENDER,
  	.open = xe_file_open,
  	.postclose = xe_file_close,
  	.ioctls = xe_ioctls_admin_only,
@@@ -736,9 -737,11 +737,11 @@@ static void vf_update_device_info(struc
  	xe->info.probe_display = 0;
  	xe->info.has_heci_cscfi = 0;
  	xe->info.has_heci_gscfi = 0;
+ 	xe->info.has_i2c = 0;
  	xe->info.has_late_bind = 0;
  	xe->info.skip_guc_pc = 1;
  	xe->info.skip_pcode = 1;
+ 	xe->info.has_drm_ras = false;
  }
  
  static int xe_device_vram_alloc(struct xe_device *xe)
@@@ -918,6 -921,27 +921,27 @@@ static void xe_device_wedged_fini(struc
  		xe_pm_runtime_put(xe);
  }
  
+ #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
+ static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
+ {
+ 	int err;
+ 
+ 	err = drmm_mutex_init(&xe->drm, &xe->page_size_alloc_ctrl.lock);
+ 	if (err)
+ 		return err;
+ 
+ 	xe->page_size_alloc_ctrl.mode = XE_PAGE_SIZE_ALLOC_CTRL_MODE_NONE;
+ 	xe->page_size_alloc_ctrl.cur_index = 0;
+ 
+ 	return 0;
+ }
+ #else
+ static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
+ {
+ 	return 0;
+ }
+ #endif
+ 
  int xe_device_probe(struct xe_device *xe)
  {
  	struct xe_tile *tile;
@@@ -947,6 -971,15 +971,15 @@@
  			return err;
  	}
  
+ 	/*
+ 	 * Wa_16029380221: The affected GT will always use non-coherent
+ 	 * access to page tables, so we must do uncached writes from the
+ 	 * CPU.
+ 	 */
+ 	for_each_gt(gt, xe, id)
+ 		if (XE_GT_WA(gt, 16029380221))
+ 			xe->info.has_cached_pt = false;
+ 
  	for_each_tile(tile, xe, id) {
  		err = xe_ggtt_init_early(tile->mem.ggtt);
  		if (err)
@@@ -987,6 -1020,16 +1020,16 @@@
  	if (err)
  		return err;
  
+ 	err = xe_soc_remapper_init(xe);
+ 	if (err)
+ 		return err;
+ 
+ 	err = xe_sysctrl_init(xe);
+ 	if (err)
+ 		return err;
+ 
+ 	xe_ras_init(xe);
+ 
  	/*
  	 * Now that GT is initialized (TTM in particular),
  	 * we can try to init display, and inherit the initial fb.
@@@ -1027,10 -1070,6 +1070,6 @@@
  
  	xe_nvm_init(xe);
  
- 	err = xe_soc_remapper_init(xe);
- 	if (err)
- 		return err;
- 
  	err = xe_heci_gsc_init(xe);
  	if (err)
  		return err;
@@@ -1055,6 -1094,10 +1094,10 @@@
  	if (err)
  		return err;
  
+ 	err = xe_debug_page_size_alloc_ctrl_init(xe);
+ 	if (err)
+ 		return err;
+ 
  	err = drm_dev_register(&xe->drm, 0);
  	if (err)
  		return err;
@@@ -1069,10 -1112,6 +1112,6 @@@
  	if (err)
  		goto err_unregister_display;
  
- 	err = xe_sysctrl_init(xe);
- 	if (err)
- 		goto err_unregister_display;
- 
  	err = xe_device_sysfs_init(xe);
  	if (err)
  		goto err_unregister_display;
@@@ -1102,6 -1141,13 +1141,13 @@@
  	if (err)
  		goto err_unregister_display;
  
+ 	/*
+ 	 * Process and log any errors detected by hardware. Possible results can
+ 	 * include declaring the device as wedged, which must be done only after
+ 	 * xe_device_wedged_fini() is registered.
+ 	 */
+ 	xe_ras_process_errors(xe);
+ 
  	err = devm_add_action_or_reset(xe->drm.dev, xe_device_sanitize, xe);
  	if (err)
  		goto err_unregister_display;
@@@ -1131,14 -1177,14 +1177,14 @@@ void xe_device_shutdown(struct xe_devic
  
  	drm_dbg(&xe->drm, "Shutting down device\n");
  
- 	xe_display_pm_shutdown(xe);
+ 	xe_display_shutdown(xe);
  
  	xe_irq_suspend(xe);
  
  	for_each_gt(gt, xe, id)
  		xe_gt_shutdown(gt);
  
- 	xe_display_pm_shutdown_late(xe);
+ 	xe_display_shutdown_late(xe);
  
  	if (!xe_driver_flr_disabled(xe)) {
  		/* BOOM! */