From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: badal.nilawar@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 1/2] tests/xe_pm : Add support to disable all crtc
Date: Wed, 28 Jun 2023 16:56:20 +0530 [thread overview]
Message-ID: <20230628112621.4084988-2-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20230628112621.4084988-1-anshuman.gupta@intel.com>
xe_pm d3 test requires to disable all crtc in order to enter
to d3 state therefore, adding the support to disable all crtc.
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
tests/xe/xe_pm.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/xe/xe_pm.c b/tests/xe/xe_pm.c
index 23b8246ed..c71fce892 100644
--- a/tests/xe/xe_pm.c
+++ b/tests/xe/xe_pm.c
@@ -34,6 +34,7 @@ typedef struct {
int fd_xe;
struct pci_device *pci_xe;
struct pci_device *pci_root;
+ igt_display_t display;
} device_t;
/* runtime_usage is only available if kernel build CONFIG_PM_ADVANCED_DEBUG */
@@ -150,6 +151,23 @@ static bool out_of_d3(device_t device, enum igt_acpi_d_state state)
return true;
}
+static void disable_all_crtc(device_t *device)
+{
+ if (!drmModeGetResources(device->fd_xe))
+ return;
+
+ igt_display_require(&device->display, device->fd_xe);
+ igt_modeset_disable_all_outputs(&device->display);
+}
+
+static void display_fini(device_t *device)
+{
+ if (!drmModeGetResources(device->fd_xe))
+ return;
+
+ igt_display_fini(&device->display);
+}
+
/**
* SUBTEST: %s-basic
* Description: set GPU state to %arg[1] and test suspend/autoresume
@@ -378,6 +396,7 @@ igt_main
get_d3cold_allowed(device.pci_xe, d3cold_allowed);
igt_assert(igt_setup_runtime_pm(device.fd_xe));
+ disable_all_crtc(&device);
}
for (const struct s_state *s = s_states; s->name; s++) {
@@ -438,6 +457,7 @@ igt_main
}
igt_fixture {
+ display_fini(&device);
set_d3cold_allowed(device.pci_xe, d3cold_allowed);
igt_restore_runtime_pm();
xe_device_put(device.fd_xe);
--
2.25.1
next prev parent reply other threads:[~2023-06-28 11:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 11:26 [igt-dev] [PATCH i-g-t v2 0/2] vram d3cold threshold test Anshuman Gupta
2023-06-28 11:26 ` Anshuman Gupta [this message]
2023-06-28 11:26 ` [igt-dev] [PATCH i-g-t v2 2/2] test/xe_pm: Add vram_d3cold_threshold subtest Anshuman Gupta
2023-07-05 9:19 ` Riana Tauro
2023-06-28 13:58 ` [igt-dev] ✗ Fi.CI.BUILD: failure for vram d3cold threshold test (rev2) 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=20230628112621.4084988-2-anshuman.gupta@intel.com \
--to=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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