From: jsg Date: Thu, 24 Feb 2022 12:45:37 +0000 (+0000) Subject: drm/amd: Only run s3 or s0ix if system is configured properly X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=24943abfc62948902d27df9ca79ed1965caa5ee3;p=openbsd drm/amd: Only run s3 or s0ix if system is configured properly From Mario Limonciello 38108fd273acbc6248870a7a3e61714398af6f94 in linux 5.15.y/5.15.25 04ef860469fda6a646dc841190d05b31fae68e8c in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index 8511b6528dc..0914e142eb9 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -1503,6 +1503,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work) static int amdgpu_pmops_prepare(struct device *dev) { struct drm_device *drm_dev = dev_get_drvdata(dev); + struct amdgpu_device *adev = drm_to_adev(drm_dev); /* Return a positive number here so * DPM_FLAG_SMART_SUSPEND works properly @@ -1510,6 +1511,13 @@ static int amdgpu_pmops_prepare(struct device *dev) if (amdgpu_device_supports_boco(drm_dev)) return pm_runtime_suspended(dev); + /* if we will not support s3 or s2i for the device + * then skip suspend + */ + if (!amdgpu_acpi_is_s0ix_active(adev) && + !amdgpu_acpi_is_s3_active(adev)) + return 1; + return 0; }