summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pm.c')
-rw-r--r--drivers/gpu/drm/xe/xe_pm.c47
1 files changed, 36 insertions, 11 deletions
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 766922530265..01185f10a883 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -8,6 +8,7 @@
#include <linux/fault-inject.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
+#include <linux/dmi.h>
#include <drm/drm_managed.h>
#include <drm/ttm/ttm_placement.h>
@@ -260,10 +261,19 @@ int xe_pm_resume(struct xe_device *xe)
xe_irq_resume(xe);
- for_each_gt(gt, xe, id)
- xe_gt_resume(gt);
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_resume(gt);
+ if (err)
+ break;
+ }
+ /*
+ * Try to bring up display before bailing from GT resume failure,
+ * so we don't leave the user clueless with a blank screen.
+ */
xe_display_pm_resume(xe);
+ if (err)
+ goto err;
err = xe_bo_restore_late(xe);
if (err)
@@ -357,9 +367,15 @@ ALLOW_ERROR_INJECTION(xe_pm_init_early, ERRNO); /* See xe_pci_probe() */
static u32 vram_threshold_value(struct xe_device *xe)
{
- /* FIXME: D3Cold temporarily disabled by default on BMG */
- if (xe->info.platform == XE_BATTLEMAGE)
- return 0;
+ if (xe->info.platform == XE_BATTLEMAGE) {
+ const char *product_name;
+
+ product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
+ if (product_name && strstr(product_name, "NUC13RNG")) {
+ drm_warn(&xe->drm, "BMG + D3Cold not supported on this platform\n");
+ return 0;
+ }
+ }
return DEFAULT_VRAM_THRESHOLD;
}
@@ -591,7 +607,7 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
}
for_each_gt(gt, xe, id) {
- err = xe_gt_suspend(gt);
+ err = xe->d3cold.allowed ? xe_gt_suspend(gt) : xe_gt_runtime_suspend(gt);
if (err)
goto out_resume;
}
@@ -633,10 +649,10 @@ int xe_pm_runtime_resume(struct xe_device *xe)
xe_rpm_lockmap_acquire(xe);
- for_each_gt(gt, xe, id)
- xe_gt_idle_disable_c6(gt);
-
if (xe->d3cold.allowed) {
+ for_each_gt(gt, xe, id)
+ xe_gt_idle_disable_c6(gt);
+
err = xe_pcode_ready(xe, true);
if (err)
goto out;
@@ -656,10 +672,19 @@ int xe_pm_runtime_resume(struct xe_device *xe)
xe_irq_resume(xe);
- for_each_gt(gt, xe, id)
- xe_gt_resume(gt);
+ for_each_gt(gt, xe, id) {
+ err = xe->d3cold.allowed ? xe_gt_resume(gt) : xe_gt_runtime_resume(gt);
+ if (err)
+ break;
+ }
+ /*
+ * Try to bring up display before bailing from GT resume failure,
+ * so we don't leave the user clueless with a blank screen.
+ */
xe_display_pm_runtime_resume(xe);
+ if (err)
+ goto out;
if (xe->d3cold.allowed) {
err = xe_bo_restore_late(xe);