[igt-dev] [PATCH i-g-t v3 2/3] tests/xe_pm : Add support to disable all crtc
Rodrigo Vivi
rodrigo.vivi at intel.com
Tue Jul 18 19:04:13 UTC 2023
On Tue, Jul 18, 2023 at 04:38:51PM +0530, Anshuman Gupta wrote:
> xe_pm d3 test requires to turn off all crtc in order to enter
> to d3 state therefore, adding the support to triggering
> "DPMS OFF" in setup_d3() and "DPMS ON" in cleanup_d3().
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> tests/xe/xe_pm.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/tests/xe/xe_pm.c b/tests/xe/xe_pm.c
> index 23b8246ed..11a4c3705 100644
> --- a/tests/xe/xe_pm.c
> +++ b/tests/xe/xe_pm.c
> @@ -18,6 +18,7 @@
>
> #include "igt.h"
> #include "lib/igt_device.h"
> +#include "lib/igt_kms.h"
> #include "lib/igt_pm.h"
> #include "lib/igt_syncobj.h"
> #include "lib/intel_reg.h"
> @@ -78,6 +79,8 @@ static void set_d3cold_allowed(struct pci_device *pci,
>
> static bool setup_d3(device_t device, enum igt_acpi_d_state state)
> {
> + igt_dpms_turn_off_display(device.fd_xe);
> +
> switch (state) {
> case IGT_ACPI_D3Cold:
> igt_require(igt_pm_acpi_d3cold_supported(device.pci_root));
> @@ -94,6 +97,11 @@ static bool setup_d3(device_t device, enum igt_acpi_d_state state)
> return false;
> }
>
> +static void cleanup_d3(device_t device)
> +{
> + igt_dpms_turn_on_display(device.fd_xe);
> +}
> +
> static bool in_d3(device_t device, enum igt_acpi_d_state state)
> {
> uint16_t val;
> @@ -412,6 +420,7 @@ igt_main
> xe_for_each_hw_engine(device.fd_xe, hwe)
> test_exec(device, hwe, 1, 2, s->state,
> NO_RPM);
> + cleanup_d3(device);
> }
> }
> }
> @@ -420,6 +429,7 @@ igt_main
> igt_subtest_f("%s-basic", d->name) {
> igt_assert(setup_d3(device, d->state));
> igt_assert(in_d3(device, d->state));
> + cleanup_d3(device);
> }
>
> igt_subtest_f("%s-basic-exec", d->name) {
> @@ -427,6 +437,7 @@ igt_main
> xe_for_each_hw_engine(device.fd_xe, hwe)
> test_exec(device, hwe, 1, 1,
> NO_SUSPEND, d->state);
> + cleanup_d3(device);
> }
>
> igt_subtest_f("%s-multiple-execs", d->name) {
> @@ -434,6 +445,7 @@ igt_main
> xe_for_each_hw_engine(device.fd_xe, hwe)
> test_exec(device, hwe, 16, 32,
> NO_SUSPEND, d->state);
> + cleanup_d3(device);
> }
> }
>
> --
> 2.25.1
>
More information about the igt-dev
mailing list