summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOhad Sharabi <osharabi@habana.ai>2023-09-28 16:56:21 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:41:21 -0500
commit5349bb76d62048e73f6e4a863b40a309c62dc47f (patch)
treee6454c5c7a7cca942e14269b1cedd54dcf73a8d1
parent1464f56b47d8db63ad95dad3fd8845ec412dc8d5 (diff)
drm/xe: do not register to PM if GuC is disabled
When working without GuC (i.e. working with execlists), the flow attempts to perform suspend operation which is failing due to a lack of support without GuC. If PM ops are not supported without GuC we may as well avoid PM registration rather than returning errors from various PM flows. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_gt.c4
-rw-r--r--drivers/gpu/drm/xe/xe_pm.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 1aa44d4f9ac1..68cd9a7ee087 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -641,10 +641,6 @@ int xe_gt_suspend(struct xe_gt *gt)
{
int err;
- /* For now suspend/resume is only allowed with GuC */
- if (!xe_device_uc_enabled(gt_to_xe(gt)))
- return -ENODEV;
-
xe_gt_sanitize(gt);
xe_device_mem_access_get(gt_to_xe(gt));
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 2c2745f86223..93a7658da324 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -156,6 +156,10 @@ void xe_pm_init(struct xe_device *xe)
{
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
+ /* For now suspend/resume is only allowed with GuC */
+ if (!xe_device_uc_enabled(xe))
+ return;
+
drmm_mutex_init(&xe->drm, &xe->d3cold.lock);
xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev);