Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 817D710F983 for ; Fri, 29 Apr 2022 08:54:49 +0000 (UTC) From: Anshuman Gupta To: igt-dev@lists.freedesktop.org Date: Fri, 29 Apr 2022 14:24:22 +0530 Message-Id: <20220429085425.24568-6-anshuman.gupta@intel.com> In-Reply-To: <20220429085425.24568-1-anshuman.gupta@intel.com> References: <20220429085425.24568-1-anshuman.gupta@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v2 5/8] i915_pm_rpm: Add D3Cold basic subtest List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petri.latvala@intel.com, badal.nilawar@intel.com, rodrigo.vivi@intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Add support for D3Cold basic subtest. It setup and prepares the gfx PCI card for D3Cold and checks the ACPI D3Cold state. v2: - Removed IS_DGFX() condition. - Added igt_describe(). [Kamil] Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Rodrigo Vivi --- tests/i915/i915_pm_rpm.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c index d2bce5826..31f9712a8 100644 --- a/tests/i915/i915_pm_rpm.c +++ b/tests/i915/i915_pm_rpm.c @@ -1534,6 +1534,28 @@ __noreturn static void stay_subtest(void) sleep(600); } +static void d3cold_basic_subtest(void) +{ + struct pci_device *root; + bool result; + + root = igt_device_get_pci_root_port(drm_fd); + igt_require(igt_pm_acpi_d3cold_supported(root)); + igt_pm_setup_pci_card_runtime_pm(root); + disable_all_screens_and_wait(&ms_data); + + result = igt_wait(igt_pm_get_acpi_real_d_state(root) == IGT_ACPI_D3Cold, 10000, 500); + + if (!result) { + igt_info("D3Cold not achieved for root port %04x:%02x:%02x.%01x\n", + root->domain, root->bus, root->dev, root->func); + igt_pm_print_pci_card_runtime_status(); + } + + igt_assert(result); + igt_pm_restore_pci_card_runtime_pm(); +} + static void system_suspend_subtest(int state, int debug) { disable_all_screens_and_wait(&ms_data); @@ -2065,6 +2087,10 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_subtest("stay") stay_subtest(); + igt_describe("Validate gfx root port d3cold state"); + igt_subtest("d3cold-basic") + d3cold_basic_subtest(); + /* Essential things */ igt_subtest("drm-resources-equal") drm_resources_equal_subtest(); -- 2.26.2