Hi all, Today's linux-next merge of the drm tree got conflicts in: drivers/gpu/drm/xe/xe_pci.c drivers/gpu/drm/xe/xe_pm.c between commit: ??? from the drm-fixes tree and commit: ??? 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 --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 12ff5c9025478..3bd68ed9daa81 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -417,16 +417,17 @@ static const struct xe_device_desc bmg_desc = { .dma_mask_size = 46, .has_display = true, .has_fan_control = true, + .has_fixed_vram_channels = true, .has_flat_ccs = 1, .has_mbx_power_limits = true, .has_mbx_thermal_info = true, .has_gsc_nvm = 1, .has_heci_cscfi = 1, .has_i2c = true, - .has_late_bind = true, .has_pre_prod_wa = 1, .has_soc_remapper_telem = true, .has_sriov = true, + .late_bind_mask = BIT(XE_LB_FW_FAN_CONTROL), .max_gt_per_tile = 2, MULTI_LRC_MASK, .needs_scratch = true, @@ -487,6 +488,8 @@ static const struct xe_device_desc cri_desc = { .has_sriov = true, .has_sysctrl = true, .has_temp_sentinel = true, + .late_bind_mask = BIT(XE_LB_FW_FAN_CONTROL) | + BIT(XE_LB_FW_OCODE), .max_gt_per_tile = 2, MULTI_LRC_MASK, .require_force_probe = true, @@ -722,8 +725,9 @@ static int handle_gmdid(struct xe_device *xe, *graphics_ip = find_graphics_ip(ver); if (!*graphics_ip) { - drm_err(&xe->drm, "Hardware reports unknown graphics version %u.%02u\n", - ver / 100, ver % 100); + xe_log_err(xe, REGS, -EINVAL, + "Hardware reports unknown graphics version %u.%02u\n", + ver / 100, ver % 100); } ret = read_gmdid(xe, GMDID_MEDIA, &ver, media_revid); @@ -736,8 +740,9 @@ static int handle_gmdid(struct xe_device *xe, *media_ip = find_media_ip(ver); if (!*media_ip) { - drm_err(&xe->drm, "Hardware reports unknown media version %u.%02u\n", - ver / 100, ver % 100); + xe_log_err(xe, REGS, -EINVAL, + "Hardware reports unknown media version %u.%02u\n", + ver / 100, ver % 100); } return 0; @@ -798,6 +803,7 @@ static int xe_info_init_early(struct xe_device *xe, xe->info.has_device_uid = desc->has_device_uid; xe->info.has_drm_ras = desc->has_drm_ras; xe->info.has_fan_control = desc->has_fan_control; + xe->info.has_fixed_vram_channels = desc->has_fixed_vram_channels; /* runtime fusing may force flat_ccs to disabled later */ xe->info.has_flat_ccs = desc->has_flat_ccs; xe->info.has_mbx_power_limits = desc->has_mbx_power_limits; @@ -806,7 +812,6 @@ static int xe_info_init_early(struct xe_device *xe, xe->info.has_heci_gscfi = desc->has_heci_gscfi; xe->info.has_heci_cscfi = desc->has_heci_cscfi; xe->info.has_i2c = desc->has_i2c; - xe->info.has_late_bind = desc->has_late_bind; xe->info.has_llc = desc->has_llc; xe->info.has_mert = desc->has_mert; xe->info.has_page_reclaim_hw_assist = desc->has_page_reclaim_hw_assist; @@ -819,11 +824,13 @@ static int xe_info_init_early(struct xe_device *xe, desc->has_sriov; xe->info.has_sysctrl = desc->has_sysctrl; xe->info.has_temp_sentinel = desc->has_temp_sentinel; + xe->info.require_force_probe = desc->require_force_probe; xe->info.skip_guc_pc = desc->skip_guc_pc; xe->info.skip_pcode = desc->skip_pcode; xe->info.needs_scratch = desc->needs_scratch; xe->info.needs_shared_vf_gt_wq = desc->needs_shared_vf_gt_wq; xe->info.multi_lrc_mask = desc->multi_lrc_mask; + xe->info.late_bind_mask = desc->late_bind_mask; xe->info.probe_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) && xe_modparam.probe_display && @@ -1328,7 +1335,7 @@ static void d3cold_toggle(struct pci_dev *pdev, enum toggle_d3cold toggle) } } -static int xe_pci_suspend(struct device *dev) +static int __xe_pci_suspend(struct device *dev, bool hibernate) { struct pci_dev *pdev = to_pci_dev(dev); struct xe_device *xe = pdev_to_xe_device(pdev); @@ -1337,7 +1344,7 @@ static int xe_pci_suspend(struct device *dev) if (xe_survivability_mode_is_boot_enabled(xe)) return -EBUSY; - err = xe_pm_suspend(xe); + err = xe_pm_suspend(xe, hibernate); if (err) return err; @@ -1355,6 +1362,16 @@ static int xe_pci_suspend(struct device *dev) return 0; } +static int xe_pci_suspend(struct device *dev) +{ + return __xe_pci_suspend(dev, false); +} + +static int xe_pci_freeze(struct device *dev) +{ + return __xe_pci_suspend(dev, true); +} + static int xe_pci_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); @@ -1484,7 +1501,12 @@ static int xe_pci_runtime_idle(struct device *dev) } static const struct dev_pm_ops xe_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(xe_pci_suspend, xe_pci_resume) + .suspend = pm_sleep_ptr(xe_pci_suspend), + .resume = pm_sleep_ptr(xe_pci_resume), + .freeze = pm_sleep_ptr(xe_pci_freeze), + .thaw = pm_sleep_ptr(xe_pci_resume), + .poweroff = pm_sleep_ptr(xe_pci_suspend), + .restore = pm_sleep_ptr(xe_pci_resume), SET_RUNTIME_PM_OPS(xe_pci_runtime_suspend, xe_pci_runtime_resume, xe_pci_runtime_idle) }; #endif diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index d95f0d128ed49..e73192b03074a 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -166,13 +166,19 @@ static void xe_rpm_lockmap_release(const struct xe_device *xe) &xe_pm_runtime_d3cold_map); } +static bool xe_pm_needs_bo_evict(struct xe_device *xe, bool hibernate) +{ + return IS_DGFX(xe) || hibernate; +} + /** - * xe_pm_suspend - Helper for System suspend, i.e. S0->S3 / S0->S2idle + * xe_pm_suspend - Helper for System suspend, i.e. S0->S3 / S0->S2idle / S0->S4 * @xe: xe device instance + * @hibernate: true if preparing for S4 hibernation, false for < S4 suspend * * Return: 0 on success */ -int xe_pm_suspend(struct xe_device *xe) +int xe_pm_suspend(struct xe_device *xe, bool hibernate) { struct xe_gt *gt; u8 id; @@ -186,17 +192,19 @@ int xe_pm_suspend(struct xe_device *xe) if (err) goto err; - xe_late_bind_wait_for_worker_completion(&xe->late_bind); + xe_late_bind_pm_suspend(&xe->late_bind); for_each_gt(gt, xe, id) xe_gt_suspend_prepare(gt); xe_display_pm_suspend(xe); - /* FIXME: Super racey... */ - err = xe_bo_evict_all(xe); - if (err) - goto err_display; + if (xe_pm_needs_bo_evict(xe, hibernate)) { + /* FIXME: Super racey... */ + err = xe_bo_evict_all(xe); + if (err) + goto err_display; + } for_each_gt(gt, xe, id) { err = xe_gt_suspend(gt); @@ -249,7 +257,7 @@ int xe_pm_resume(struct xe_device *xe) xe_wa_apply_tile_workarounds(tile); for_each_gt(gt, xe, id) - xe_gt_idle_disable_c6(gt); + xe_gt_resume_early(gt); xe_display_pm_resume_early(xe); @@ -290,7 +298,7 @@ int xe_pm_resume(struct xe_device *xe) if (IS_VF_CCS_READY(xe)) xe_sriov_vf_ccs_register_context(xe); - xe_late_bind_fw_load(&xe->late_bind); + xe_late_bind_pm_resume(&xe->late_bind); drm_dbg(&xe->drm, "Device resumed\n"); xe_pm_block_end_signalling(); @@ -461,6 +469,9 @@ static int xe_pm_notifier_callback(struct notifier_block *nb, struct xe_validation_ctx ctx; reinit_completion(&xe->pm_block); + if (!xe_pm_needs_bo_evict(xe, action == PM_HIBERNATION_PREPARE)) + break; + xe_pm_block_begin_signalling(); xe_pm_runtime_get(xe); (void)xe_validation_ctx_init(&ctx, &xe->val, NULL, @@ -485,6 +496,9 @@ static int xe_pm_notifier_callback(struct notifier_block *nb, case PM_POST_SUSPEND: complete_all(&xe->pm_block); xe_pm_wake_rebind_workers(xe); + if (!xe_pm_needs_bo_evict(xe, action == PM_POST_HIBERNATION)) + break; + xe_bo_notifier_unprepare_all_pinned(xe); xe_pm_runtime_put(xe); break; @@ -707,7 +721,7 @@ int xe_pm_runtime_resume(struct xe_device *xe) xe_wa_apply_tile_workarounds(tile); for_each_gt(gt, xe, id) - xe_gt_idle_disable_c6(gt); + xe_gt_resume_early(gt); xe_display_pm_resume_early(xe); @@ -755,7 +769,7 @@ int xe_pm_runtime_resume(struct xe_device *xe) xe_sriov_vf_ccs_register_context(xe); if (xe->d3cold.allowed) - xe_late_bind_fw_load(&xe->late_bind); + xe_late_bind_pm_resume(&xe->late_bind); out: xe_rpm_lockmap_release(xe);