From: Riana Tauro <riana.tauro@intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <rodrigo.vivi@intel.com>, <janga.rahul.kumar@intel.com>,
<kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH i-g-t v2 2/3] tests/intel/xe_pm: Extend mocs-rpm test to support D3Cold
Date: Tue, 9 Jul 2024 11:20:51 +0530 [thread overview]
Message-ID: <2ced9f5f-9374-44eb-ab8e-2bfc32bd1430@intel.com> (raw)
In-Reply-To: <20240708145607.272869-3-badal.nilawar@intel.com>
On 7/8/2024 8:26 PM, Badal Nilawar wrote:
> Extend mocs rpm test to support D3Cold using existing d3 helpers.
support D3 states
>
> v2: Update documentation/description (Riana)
>
> Cc: janga.rahul.kumar@intel.com
Cc format is not correct
With the above comments fixed
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
> tests/intel/xe_pm.c | 60 +++++++++++++++++++++++++++------------------
> 1 file changed, 36 insertions(+), 24 deletions(-)
>
> diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
> index b30e94a2a..8b115e2f6 100644
> --- a/tests/intel/xe_pm.c
> +++ b/tests/intel/xe_pm.c
> @@ -610,28 +610,28 @@ static void test_mmap(device_t device, uint32_t placement, uint32_t flags,
> close(fw_handle);
> }
>
> -/**
> - * SUBTEST: mocs-rpm
> - * Description:
> - * Validate mocs register contents over suspend resume
> - *
> - * Functionality: mocs registers
> - * Run type: FULL
> - */
> /**
> * SUBTEST: %s-mocs
> - * Description: test checks for mocs state before and after %arg[1] state
> - * Functionality: pm - %arg[1]
> + * Description: Validate contents of mocs registers over suspend resume
> + * Functionality: pm_suspend
> *
> * arg[1]:
> *
> * @s2idle: s2idle
> * @s3: s3
> * @s4: s4
> + *
> + * @d3hot: d3hot
> + * @d3cold: d3cold
> */
> -static void test_mocs_suspend_resume(device_t device, int s_state)
> +static void test_mocs_suspend_resume(device_t device, enum igt_suspend_state s_state,
> + enum igt_acpi_d_state d_state)
> {
> int gt;
> + uint64_t active_time;
> + bool check_rpm = (d_state == IGT_ACPI_D3Hot ||
> + d_state == IGT_ACPI_D3Cold);
> +
>
> xe_for_each_gt(device.fd_xe, gt) {
> char path[256];
> @@ -639,24 +639,34 @@ static void test_mocs_suspend_resume(device_t device, int s_state)
> // Mocs debugfs contents before and after suspend-resume
> char mocs_content_pre[4096], mocs_contents_post[4096];
>
> + igt_debug("Running on GT%d\n", gt);
> +
> sprintf(path, "gt%d/mocs", gt);
> igt_assert(igt_debugfs_exists(device.fd_xe, path, O_RDONLY));
> igt_debugfs_dump(device.fd_xe, path);
> igt_debugfs_read(device.fd_xe, path, mocs_content_pre);
>
> - if (s_state == NO_SUSPEND) {
> + if (check_rpm) {
> + igt_assert(in_d3(device, d_state));
> + active_time = igt_pm_get_runtime_active_time(device.pci_xe);
> +
> fw_handle = igt_debugfs_open(device.fd_xe, "forcewake_all", O_RDONLY);
> igt_assert(fw_handle >= 0);
> - igt_assert(igt_get_runtime_pm_status() == IGT_RUNTIME_PM_STATUS_ACTIVE);
> + igt_assert(igt_pm_get_runtime_active_time(device.pci_xe) >
> + active_time);
>
> /* Make sure runtime pm goes back to suspended status after closing forcewake_all */
> close(fw_handle);
> - igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> + sleep(1);
> +
> + igt_assert(in_d3(device, d_state));
> } else {
> - enum igt_suspend_test test = s_state == SUSPEND_STATE_DISK ?
> - SUSPEND_TEST_DEVICES : SUSPEND_TEST_NONE;
> + if (s_state != NO_SUSPEND) {
> + enum igt_suspend_test test = s_state == SUSPEND_STATE_DISK ?
> + SUSPEND_TEST_DEVICES : SUSPEND_TEST_NONE;
>
> - igt_system_suspend_autoresume(s_state, test);
> + igt_system_suspend_autoresume(s_state, test);
> + }
> }
> igt_assert(igt_debugfs_exists(device.fd_xe, path, O_RDONLY));
> igt_debugfs_dump(device.fd_xe, path);
> @@ -766,7 +776,7 @@ igt_main
> }
>
> igt_subtest_f("%s-mocs", s->name)
> - test_mocs_suspend_resume(device, s->state);
> + test_mocs_suspend_resume(device, s->state, NO_RPM);
> }
>
> igt_fixture {
> @@ -825,6 +835,14 @@ igt_main
>
> igt_pm_set_autosuspend_delay(device.pci_xe, delay_ms);
> }
> +
> + igt_describe_f("Validate the contents of mocs registers over %s state", d->name);
> + igt_subtest_f("%s-mocs", d->name) {
> + igt_assert(setup_d3(device, d->state));
> + test_mocs_suspend_resume(device, NO_SUSPEND, d->state);
> + cleanup_d3(device);
> + }
> +
> }
>
> igt_describe("Validate whether card is limited to d3hot,"
> @@ -835,12 +853,6 @@ igt_main
> test_vram_d3cold_threshold(device, sysfs_fd);
> }
>
> - igt_subtest("mocs-rpm") {
> - dpms_on_off(device, DRM_MODE_DPMS_OFF);
> - test_mocs_suspend_resume(device, NO_SUSPEND);
> - dpms_on_off(device, DRM_MODE_DPMS_ON);
> - }
> -
> igt_fixture {
> close(sysfs_fd);
> igt_pm_set_d3cold_allowed(device.pci_slot_name, d3cold_allowed);
next prev parent reply other threads:[~2024-07-09 5:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 14:56 [PATCH i-g-t v2 0/3] Extend mocs-rpm test to support d3 cold Badal Nilawar
2024-07-08 14:56 ` [PATCH i-g-t v2 1/3] tests/intel/xe_pm: Install fw close exit handler before rpm tests Badal Nilawar
2024-07-09 5:56 ` Riana Tauro
2024-07-08 14:56 ` [PATCH i-g-t v2 2/3] tests/intel/xe_pm: Extend mocs-rpm test to support D3Cold Badal Nilawar
2024-07-09 5:50 ` Riana Tauro [this message]
2024-07-09 9:43 ` Kumar, Janga Rahul
2024-07-10 5:50 ` Kumar, Janga Rahul
2024-07-08 14:56 ` [PATCH i-g-t v2 3/3] HAX: Add s*/d3*-mocs tests to fast feedback list Badal Nilawar
2024-07-08 17:09 ` ✓ Fi.CI.BAT: success for Extend mocs-rpm test to support d3 cold Patchwork
2024-07-08 17:31 ` ✗ CI.xeBAT: failure " Patchwork
2024-07-08 21:57 ` ✓ CI.xeFULL: success " Patchwork
2024-07-09 10:55 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ced9f5f-9374-44eb-ab8e-2bfc32bd1430@intel.com \
--to=riana.tauro@intel.com \
--cc=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=janga.rahul.kumar@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox