From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: <janga.rahul.kumar@intel.com>, <igt-dev@lists.freedesktop.org>,
<ramadevi.gandi@intel.com>
Cc: <matthew.d.roper@intel.com>
Subject: Re: [PATCH i-g-t v2 2/2] tests/intel/xe_pm: Add mocs suspend resume test
Date: Thu, 2 May 2024 14:32:19 +0530 [thread overview]
Message-ID: <123e3fcc-8c00-48c7-814a-3de36e4e520b@intel.com> (raw)
In-Reply-To: <20240424200856.1194881-3-janga.rahul.kumar@intel.com>
On 25-04-2024 01:38, janga.rahul.kumar@intel.com wrote:
> From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
>
> Add test to check mocs values are retained over suspend/resume.
>
> v2: Extend test to check S3/S4 suspend states. (Matt Roper)
>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> ---
> tests/intel/xe_pm.c | 56 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
> index 51442537b..baec50d7f 100644
> --- a/tests/intel/xe_pm.c
> +++ b/tests/intel/xe_pm.c
> @@ -251,6 +251,11 @@ static void close_fw_handle(int sig)
> * Description: suspend/autoresume on %arg[1] state and exec after RPM
> * Functionality: pm - %arg[1]
> *
> + * SUBTEST: %s-mocs
> + * Description: test checks for mocs state before and after %arg[1] state
> + * Functionality: pm - %arg[1]
> + * GPU requirements: D3 feature should be supported
> + *
> * arg[1]:
> *
> * @s2idle: s2idle
> @@ -609,6 +614,49 @@ static void test_mmap(device_t device, uint32_t placement, uint32_t flags)
> close(fw_handle);
> }
>
> +/**
> + * SUBTEST: mocs_suspend_resume
> + * Description:
> + * Validate mocs register contents over suspend resume
> + *
> + * Functionality: mocs
> + * Run type: FULL
> + */
> +static void test_mocs_suspend_resume(device_t device, bool runtime_sr, enum igt_suspend_state state)
> +{
> + int gt;
> +
> + xe_for_each_gt(device.fd_xe, gt) {
> + char path[256];
> +
> + // Mocs debugfs contents before and after suspend-resume
> + char mocs_content_pre[4096], mocs_contents_post[4096];
> +
> + 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);
> +
> + 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);
The code in above 3 lines is required for rpm use case only, so better
to move it inside if statement below.
> +
> + if (runtime_sr) {
> + /* Runtime suspend */
> + close(fw_handle);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> + } else {
> + igt_system_suspend_autoresume(state, SUSPEND_TEST_NONE);
> + }
> +
> + 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_contents_post);
> +
> + igt_assert(strcmp(mocs_content_pre, mocs_contents_post) == 0);
> + }
> +}
> +
> igt_main
> {
> struct drm_xe_engine_class_instance *hwe;
> @@ -703,6 +751,10 @@ igt_main
> cleanup_d3(device);
> }
> }
> +
> + igt_subtest_f("%s-mocs", s->name) {
No need of braces for single statement.
> + test_mocs_suspend_resume(device, 0, s->state);
> + }
> }
>
> for (const struct d_state *d = d_states; d->name; d++) {
> @@ -767,6 +819,10 @@ igt_main
> dpms_on_off(device, DRM_MODE_DPMS_ON);
> igt_pm_set_autosuspend_delay(device.pci_xe, delay_ms);
> }
> +
> + igt_subtest("mocs_suspend_resume")
> + test_mocs_suspend_resume(device, 1, 0);
> +
Remove extra blank line.
Regards,
Badal
> }
>
> igt_fixture {
next prev parent reply other threads:[~2024-05-02 9:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 20:08 [PATCH i-g-t v2 0/2] Add mocs tests janga.rahul.kumar
2024-04-24 20:08 ` [PATCH i-g-t 1/2] tests/intel/xe_debugfs: Extend gt test to check mocs entry janga.rahul.kumar
2024-05-02 9:16 ` Nilawar, Badal
2024-04-24 20:08 ` [PATCH i-g-t v2 2/2] tests/intel/xe_pm: Add mocs suspend resume test janga.rahul.kumar
2024-05-02 9:02 ` Nilawar, Badal [this message]
2024-04-24 20:49 ` ✗ CI.xeBAT: failure for Add mocs tests (rev2) Patchwork
2024-04-24 20:51 ` ✗ Fi.CI.BAT: " Patchwork
2024-04-25 12:59 ` ✗ CI.xeFULL: " Patchwork
2024-04-30 12:51 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-30 17:47 ` ✗ 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=123e3fcc-8c00-48c7-814a-3de36e4e520b@intel.com \
--to=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=janga.rahul.kumar@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=ramadevi.gandi@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