Skip to contentSkip to conversation

tests/i915/i915_pm_dc: Fix DC9 test

RFC PATCH In review Jigar Bhatt 3 participants 5 messages Jul 29, 2021 – Aug 5, 2021

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 tests/i915/i915_pm_dc: Fix DC9 test

1. Currently, check_dc9 is being called with reference (previous) counter being read after dpms_off call. At this time, already the counter is 0.
We need to read the counter before dpms_off is called so that it holds the previous value which had incremented while testing shallow states (DC5 or DC6).

2. Check for a condition dc counter to be reset along with system should in runtime suspend state :
currect_dc < prev_dc && i915 runtime status == SUSPENDED. If above condition pass, test is passed otherwise test is failed.

3. adding dc9_dpms_off()

---
 tests/i915/i915_pm_dc.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
tests/i915/i915_pm_dc.c +19 -6
index 9d0a15d81..a6fddb617 100644
@@ -358,6 +358,15 @@ static void dpms_off(data_t *data)
 			   (IGT_RUNTIME_PM_STATUS_SUSPENDED));
 }
 
+static void dc9_dpms_off(data_t *data)
+{
+	for (int i = 0; i < data->display.n_outputs; i++) {
+		kmstest_set_connector_dpms(data->drm_fd,
+					   data->display.outputs[i].config.connector,
+					   DRM_MODE_DPMS_OFF);
+	}
+}
+
 static void dpms_on(data_t *data)
 {
 	for (int i = 0; i < data->display.n_outputs; i++) {
@@ -400,8 +409,11 @@ static bool check_dc9(uint32_t debugfs_fd, int prev_dc, bool dc6_supported, int
 	 * so we rely on dc5/dc6 counter reset to check if display engine was in DC9.
 	 */
 	return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd, CHECK_DC6) <
-			prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) <
-			prev_dc, seconds, 100);
+			prev_dc &&
+			igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)
+			: read_dc_counter(debugfs_fd, CHECK_DC5) < prev_dc &&
+			igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
+			, seconds, 100);
 }
 
 static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported)
@@ -418,15 +430,16 @@ static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported)
 static void test_dc9_dpms(data_t *data)
 {
 	bool dc6_supported;
+	int prev_dc;
 
 	require_dc_counter(data->debugfs_fd, CHECK_DC5);
 	dc6_supported = support_dc6(data->debugfs_fd);
 	setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :
 			read_dc_counter(data->debugfs_fd, CHECK_DC5), dc6_supported);
-	dpms_off(data);
-	igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
-				read_dc_counter(data->debugfs_fd, CHECK_DC6) :
-				read_dc_counter(data->debugfs_fd, CHECK_DC5),
+	prev_dc = dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :
+		read_dc_counter(data->debugfs_fd, CHECK_DC5);
+	dc9_dpms_off(data);
+	igt_assert_f(check_dc9(data->debugfs_fd, prev_dc,
 				dc6_supported, 3000), "Not in DC9\n");
 	dpms_on(data);
 }
Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BUILD: failure for tests/i915/i915_pm_dc: Fix DC9 test

== Series Details ==

== Series Details ==

Series: tests/i915/i915_pm_dc: Fix DC9 test
URL : https://patchwork.freedesktop.org/series/93180/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
354638455597ac48ac433606b24b82a4d7b65d20 Revert "tests/kms_plane_alpha_blend: Skip coverage-vs-premult-vs-none for 6bpc panels"

[299/447] Linking target tests/gem_ringfill.
[300/447] Linking target tests/gem_render_copy.
[301/447] Linking target tests/gem_render_linear_blits.
[302/447] Linking target tests/gem_render_tiled_blits.
[303/447] Linking target tests/gem_request_retire.
[304/447] Linking target tests/gem_set_tiling_vs_blt.
[305/447] Linking target tests/gem_reset_stats.
[306/447] Linking target tests/gem_set_tiling_vs_pwrite.
[307/447] Linking target tests/gem_set_tiling_vs_gtt.
[308/447] Linking target tests/gem_shrink.
[309/447] Linking target tests/gem_softpin.
[310/447] Linking target tests/gem_spin_batch.
[311/447] Linking target tests/gem_sync.
[312/447] Linking target tests/gem_streaming_writes.
[313/447] Linking target tests/gem_tiled_fence_blits.
[314/447] Linking target tests/gem_tiled_partial_pwrite_pread.
[315/447] Linking target tests/gem_tiled_blits.
[316/447] Linking target tests/gem_tiled_pread_pwrite.
[317/447] Linking target tests/gem_tiled_pread_basic.
[318/447] Linking target tests/gem_tiled_swapping.
[319/447] Linking target tests/gem_tiled_wb.
[320/447] Linking target tests/gem_tiling_max_stride.
[321/447] Linking target tests/gem_unfence_active_buffers.
[322/447] Linking target tests/gem_tiled_wc.
[323/447] Linking target tests/gem_userptr_blits.
[324/447] Linking target tests/gem_unref_active_buffers.
[325/447] Linking target tests/gem_vm_create.
[326/447] Linking target tests/gem_watchdog.
[327/447] Linking target tests/gem_wait.
[328/447] Linking target tests/gem_workarounds.
[329/447] Linking target tests/i915_module_load.
[330/447] Compiling C object 'tests/tests@@i915_pm_dc@exe/i915_i915_pm_dc.c.o'.
FAILED: tests/tests@@i915_pm_dc@exe/i915_i915_pm_dc.c.o
ccache cc -Itests/tests@@i915_pm_dc@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/usr/include/x86_64-linux-gnu -I/usr/include/alsa -I/usr/include -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fcommon -pthread -MD -MQ 'tests/tests@@i915_pm_dc@exe/i915_i915_pm_dc.c.o' -MF 'tests/tests@@i915_pm_dc@exe/i915_i915_pm_dc.c.o.d' -o 'tests/tests@@i915_pm_dc@exe/i915_i915_pm_dc.c.o' -c ../tests/i915/i915_pm_dc.c In file included from ../lib/igt.h:30,

                 from ../tests/i915/i915_pm_dc.c:30:
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?
    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
   if (COND) {      \
       ^~~~
../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
   if (COND) {      \
       ^~~~

ninja: build stopped: subcommand failed.

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/i915_pm_dc: Fix DC9 test

In reply to Jigar Bhatt
== Series Details ==

== Series Details ==

Series: tests/i915/i915_pm_dc: Fix DC9 test
URL : https://patchwork.freedesktop.org/series/93180/
State : warning

== Summary ==

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/370254 for the overview.

build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308227):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?

      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565563:step_script
section_start:1627565563:cleanup_file_variables
Cleaning up file based variables
section_end:1627565564:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-debian-meson-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308230):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?

      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565557:step_script
section_start:1627565557:cleanup_file_variables
Cleaning up file based variables
section_end:1627565559:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308229):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?

      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565533:step_script
section_start:1627565533:cleanup_file_variables
Cleaning up file based variables
section_end:1627565535:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308231):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?

      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
      igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
     if (COND) {      \
         ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565583:step_script
section_start:1627565583:cleanup_file_variables
Cleaning up file based variables
section_end:1627565584:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308222):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?
415 | igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’

    266 |   if (COND) {      \
        |       ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
    415 |    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
    266 |   if (COND) {      \
        |       ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565392:step_script
section_start:1627565393:cleanup_file_variables
Cleaning up file based variables
section_end:1627565393:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308226):
FAILED: tests/59830eb@@i915_pm_dc@exe/i915_i915_pm_dc.c.o
clang -Itests/59830eb@@i915_pm_dc@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/usr/include/valgrind -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-missing-field-initializers -Wno-pointer-arith -Wno-address-of-packed-member -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -fcommon -pthread -MD -MQ 'tests/59830eb@@i915_pm_dc@exe/i915_i915_pm_dc.c.o' -MF 'tests/59830eb@@i915_pm_dc@exe/i915_i915_pm_dc.c.o.d' -o 'tests/59830eb@@i915_pm_dc@exe/i915_i915_pm_dc.c.o' -c ../tests/i915/i915_pm_dc.c ../tests/i915/i915_pm_dc.c:415:27: error: use of undeclared identifier 'IGT_RUNTIME_STATUS_PM_SUSPENDED'; did you mean 'IGT_RUNTIME_PM_STATUS_SUSPENDED'?

                          igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                 IGT_RUNTIME_PM_STATUS_SUSPENDED
  ../lib/igt_aux.h:266:7: note: expanded from macro 'igt_wait'
                  if (COND) {                                             \
                      ^
  ../lib/igt_pm.h:43:2: note: 'IGT_RUNTIME_PM_STATUS_SUSPENDED' declared here
          IGT_RUNTIME_PM_STATUS_SUSPENDED,
          ^

1 error generated.
ninja: build stopped: subcommand failed.
section_end:1627565464:step_script
section_start:1627565464:cleanup_file_variables
Cleaning up file based variables
section_end:1627565466:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308225):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?
415 | igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’

    266 |   if (COND) {      \
        |       ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
    415 |    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
    266 |   if (COND) {      \
        |       ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565461:step_script
section_start:1627565461:cleanup_file_variables
Cleaning up file based variables
section_end:1627565492:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308223):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?
415 | igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’

    266 |   if (COND) {      \
        |       ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
    415 |    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
    266 |   if (COND) {      \
        |       ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565519:step_script
section_start:1627565519:cleanup_file_variables
Cleaning up file based variables
section_end:1627565525:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/12308224):
../tests/i915/i915_pm_dc.c: In function ‘check_dc9’:
../tests/i915/i915_pm_dc.c:415:27: error: ‘IGT_RUNTIME_STATUS_PM_SUSPENDED’ undeclared (first use in this function); did you mean ‘IGT_RUNTIME_PM_STATUS_SUSPENDED’?
415 | igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’

    266 |   if (COND) {      \
        |       ^~~~
  ../tests/i915/i915_pm_dc.c:415:27: note: each undeclared identifier is reported only once for each function it appears in
    415 |    igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)
        |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../lib/igt_aux.h:266:7: note: in definition of macro ‘igt_wait’
    266 |   if (COND) {      \
        |       ^~~~

ninja: build stopped: subcommand failed.
section_end:1627565492:step_script
section_start:1627565492:cleanup_file_variables
Cleaning up file based variables
section_end:1627565493:cleanup_file_variables
ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/370254
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw
In reply to Jigar Bhatt
Quoted 11 lines

-----Original Message-----
From: Bhatt, Jigar <[email protected]>
Sent: Thursday, July 29, 2021 6:50 PM
To: [email protected]
Cc: Bhatt, Jigar <[email protected]>; Varide, Nischal <[email protected]>; Gupta, Anshuman <[email protected]>; Shankar, Uma <[email protected]>
Subject: [PATCH i-g-t RFC] tests/i915/i915_pm_dc: Fix DC9 test

Please use the standard patch header format.

Quoted 49 lines

1. Currently, check_dc9 is being called with reference
(previous) counter being read after dpms_off call.
At this time, already the counter is 0.
We need to read the counter before dpms_off is called so that it holds the previous value which had incremented while testing shallow states (DC5 or DC6).

2. Check for a condition dc counter to be reset along with system should in runtime suspend state :
currect_dc < prev_dc && i915 runtime status == SUSPENDED.
If above condition pass, test is passed otherwise test is failed.

3. adding dc9_dpms_off()

---
 tests/i915/i915_pm_dc.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
tests/i915/i915_pm_dc.c index renamed from tests/i915/i915_pm_dc.c +0 -0

9d0a15d81..a6fddb617 100644

tests/i915/i915_pm_dc.c +9 -0
@@ -358,6 +358,15 @@ static void dpms_off(data_t *data)
 			   (IGT_RUNTIME_PM_STATUS_SUSPENDED));
 }
 
+static void dc9_dpms_off(data_t *data)
+{
+	for (int i = 0; i < data->display.n_outputs; i++) {
+		kmstest_set_connector_dpms(data->drm_fd,
+					   data-
 >display.outputs[i].config.connector,
+					   DRM_MODE_DPMS_OFF);
+	}
+}
+
 static void dpms_on(data_t *data)
 {

for (int i = 0; i < data->display.n_outputs; i++) { @@ -400,8 +409,11 @@
static bool check_dc9(uint32_t debugfs_fd, int prev_dc, bool dc6_supported, int
* so we rely on dc5/dc6 counter reset to check if display engine was in
DC9.

tests/i915/i915_pm_dc.c +0 -0
 	 */
 	return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd,

CHECK_DC6) <

tests/i915/i915_pm_dc.c +2 -2
-			prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) <
-			prev_dc, seconds, 100);
+			prev_dc &&
+
Quoted 1 line

igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)

Don't use igt_wait_for_pm_status here , it waits for 10 seconds internally. We just need i915 runtime pm status and that should check against suspended. This will waste may CI cycles.
Br,
Anshuman

Quoted 35 lines
tests/i915/i915_pm_dc.c +1 -0
+			: read_dc_counter(debugfs_fd, CHECK_DC5) < prev_dc

&&
+
igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED)

tests/i915/i915_pm_dc.c +2 -0
+			, seconds, 100);
 }
 
 static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported)
@@ -418,15 +430,16 @@ static void setup_dc9_dpms(data_t *data, int
 prev_dc, bool dc6_supported)  static void test_dc9_dpms(data_t *data)  {
 	bool dc6_supported;
+	int prev_dc;
 
 	require_dc_counter(data->debugfs_fd, CHECK_DC5);
 	dc6_supported = support_dc6(data->debugfs_fd);
 	setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data-
Quoted 1 line

debugfs_fd, CHECK_DC6) :

read_dc_counter(data->debugfs_fd, CHECK_DC5),
dc6_supported);

tests/i915/i915_pm_dc.c +0 -3
-	dpms_off(data);
-	igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
-				read_dc_counter(data->debugfs_fd,

CHECK_DC6) :

tests/i915/i915_pm_dc.c +0 -1
-				read_dc_counter(data->debugfs_fd,

CHECK_DC5),

tests/i915/i915_pm_dc.c +1 -0
+	prev_dc = dc6_supported ? read_dc_counter(data->debugfs_fd,

CHECK_DC6) :

tests/i915/i915_pm_dc.c +3 -1
+		read_dc_counter(data->debugfs_fd, CHECK_DC5);
+	dc9_dpms_off(data);
+	igt_assert_f(check_dc9(data->debugfs_fd, prev_dc,
 				dc6_supported, 3000), "Not in DC9\n");
 	dpms_on(data);
 }
--

2.25.1

#4 lore raw

Hi Anshuman,

-----Original Message-----
From: Gupta, Anshuman <[email protected]>
Sent: Wednesday, August 4, 2021 11:21 AM
To: Bhatt, Jigar <[email protected]>; [email protected]
Cc: Varide, Nischal <[email protected]>; Shankar, Uma <[email protected]>
Subject: RE: [PATCH i-g-t RFC] tests/i915/i915_pm_dc: Fix DC9 test

Quoted 9 lines

-----Original Message-----
From: Bhatt, Jigar <[email protected]>
Sent: Thursday, July 29, 2021 6:50 PM
To: [email protected]
Cc: Bhatt, Jigar <[email protected]>; Varide, Nischal <[email protected]>; Gupta, Anshuman <[email protected]>; Shankar, Uma <[email protected]>
Subject: [PATCH i-g-t RFC] tests/i915/i915_pm_dc: Fix DC9 test

Please use the standard patch header format.

Quoted 48 lines

1. Currently, check_dc9 is being called with reference
(previous) counter being read after dpms_off call.
At this time, already the counter is 0.
We need to read the counter before dpms_off is called so that it holds the previous value which had incremented while testing shallow states (DC5 or DC6).

2. Check for a condition dc counter to be reset along with system should in runtime suspend state :
currect_dc < prev_dc && i915 runtime status == SUSPENDED. If above condition pass, test is passed otherwise test is failed.

3. adding dc9_dpms_off()

---
 tests/i915/i915_pm_dc.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
tests/i915/i915_pm_dc.c index renamed from tests/i915/i915_pm_dc.c +0 -0

9d0a15d81..a6fddb617 100644

tests/i915/i915_pm_dc.c +8 -0
@@ -358,6 +358,15 @@ static void dpms_off(data_t *data)
    (IGT_RUNTIME_PM_STATUS_SUSPENDED));
 }
 
+static void dc9_dpms_off(data_t *data) { for (int i = 0; i < 
+data->display.n_outputs; i++) { 
+kmstest_set_connector_dpms(data->drm_fd,
+   data-
 >display.outputs[i].config.connector,
+   DRM_MODE_DPMS_OFF);
+}
+}
+
 static void dpms_on(data_t *data)
 {
 for (int i = 0; i < data->display.n_outputs; i++) { @@ -400,8 +409,11 

@@ static bool check_dc9(uint32_t debugfs_fd, int prev_dc, bool dc6_supported, int
* so we rely on dc5/dc6 counter reset to check if display engine was
in DC9.
*/
return igt_wait(dc6_supported ? read_dc_counter(debugfs_fd,
CHECK_DC6) <
-prev_dc : read_dc_counter(debugfs_fd, CHECK_DC5) < -prev_dc, seconds, 100);

tests/i915/i915_pm_dc.c +2 -0
+prev_dc &&
+
Quoted 1 line

igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)

Don't use igt_wait_for_pm_status here , it waits for 10 seconds internally. We just need i915 runtime pm status and that should check against suspended. This will waste may CI cycles.
Br,
Anshuman

If we are not using this igt_wait_for_status then it will check status only one time and mostly it has active status. and after dpms_off it will take some time to be suspended that's why this igt_wait_for_status has max 10 sec wait loop if status == SUSPENDED then it will automatically getting out of waiting time(10 sec).

If we only depend on i915 runtime status after immediate DPMS_OFF then it will take some milliseconds for getting SUSPENDED.

Thanks and Regards,
Jigar Bhatt

Quoted 31 lines

+: read_dc_counter(debugfs_fd, CHECK_DC5) < prev_dc &&
+ igt_wait_for_pm_status(IGT_RUNTIME_STATUS_PM_SUSPENDED) +, seconds, 100);
}

static void setup_dc9_dpms(data_t *data, int prev_dc, bool
dc6_supported) @@ -418,15 +430,16 @@ static void setup_dc9_dpms(data_t *data, int prev_dc, bool dc6_supported) static void test_dc9_dpms(data_t *data) { bool dc6_supported;
+int prev_dc;

require_dc_counter(data->debugfs_fd, CHECK_DC5); dc6_supported =
support_dc6(data->debugfs_fd); setup_dc9_dpms(data, dc6_supported ? read_dc_counter(data-

Quoted 1 line

debugfs_fd, CHECK_DC6) :

read_dc_counter(data->debugfs_fd, CHECK_DC5), dc6_supported);
-dpms_off(data); -igt_assert_f(check_dc9(data->debugfs_fd, dc6_supported ?
-read_dc_counter(data->debugfs_fd,
CHECK_DC6) :
-read_dc_counter(data->debugfs_fd,
CHECK_DC5),
+prev_dc = dc6_supported ? read_dc_counter(data->debugfs_fd, CHECK_DC6) :

tests/i915/i915_pm_dc.c +2 -1
+read_dc_counter(data->debugfs_fd, CHECK_DC5); dc9_dpms_off(data); 
+igt_assert_f(check_dc9(data->debugfs_fd, prev_dc,
 dc6_supported, 3000), "Not in DC9\n");  dpms_on(data);  }
--

2.25.1