* [igt-dev] [PATCH i-g-t] tests/psr: Test the switching between all PSR version from debugfs @ 2019-02-01 2:01 José Roberto de Souza 2019-02-01 3:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork 2019-02-01 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork 0 siblings, 2 replies; 3+ messages in thread From: José Roberto de Souza @ 2019-02-01 2:01 UTC (permalink / raw) To: igt-dev; +Cc: Dhinakaran Pandiyan A bug was found in the code that handles the switching of PSR modes from debugfs, the fix was sent to kernel but lets add this test to avoid future regrestions. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> --- lib/igt_psr.c | 28 +++++++++++++++++++++++++ lib/igt_psr.h | 1 + tests/kms_psr.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) diff --git a/lib/igt_psr.c b/lib/igt_psr.c index d726fad5..0393639f 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -178,3 +178,31 @@ bool psr_sink_support(int debugfs_fd, enum psr_mode mode) */ return strstr(buf, "Sink support: yes [0x03]"); } + +/** + * Returns true if PSR is enabled(don't mean active) and set mode parameter + * with the PSR version that is enabled if not NULL. + */ +bool psr_enabled(int debugfs_fd, enum psr_mode *mode) +{ + char buf[PSR_STATUS_MAX_LEN]; + int ret; + + ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, + sizeof(buf)); + if (ret < 1) + return false; + + if (strstr(buf, "PSR mode: disabled")) + return false; + + if (!mode) + return true; + + if (strstr(buf, "PSR2 enabled")) + *mode = PSR_MODE_2; + else + *mode = PSR_MODE_1; + + return true; +} diff --git a/lib/igt_psr.h b/lib/igt_psr.h index 7e7017bf..8e88b065 100644 --- a/lib/igt_psr.h +++ b/lib/igt_psr.h @@ -40,5 +40,6 @@ bool psr_wait_update(int debugfs_fd, enum psr_mode mode); bool psr_enable(int debugfs_fd, enum psr_mode); bool psr_disable(int debugfs_fd); bool psr_sink_support(int debugfs_fd, enum psr_mode); +bool psr_enabled(int debugfs_fd, enum psr_mode *mode); #endif diff --git a/tests/kms_psr.c b/tests/kms_psr.c index 3e16a6bf..c7ecb1c1 100644 --- a/tests/kms_psr.c +++ b/tests/kms_psr.c @@ -454,6 +454,61 @@ int main(int argc, char *argv[]) display_init(&data); } + igt_subtest_f("debugfs") { + enum psr_mode mode; + + igt_require(!data.with_psr_disabled); + + data.test_plane_id = DRM_PLANE_TYPE_PRIMARY; + setup_test_plane(&data, data.test_plane_id); + + /* + * Testing all combinations: + * disabled -> PSR1 + * disabled -> PSR2 + * + * PSR1 -> disabled + * PSR1 -> PSR2 + * + * PSR2 -> disabled + * PSR2 -> PSR1 + * + * Not testing the default value in debugfs because the result + * of the default value will vary between kernel versions, + * gen version and enable_psr kernel parameter. + */ + psr_disable(data.debugfs_fd); + igt_assert(!psr_enabled(data.debugfs_fd, NULL)); + + psr_enable(data.debugfs_fd, PSR_MODE_1); + igt_assert(psr_enabled(data.debugfs_fd, &mode)); + igt_assert(mode == PSR_MODE_1); + + psr_disable(data.debugfs_fd); + igt_assert(!psr_enabled(data.debugfs_fd, NULL)); + + if (data.supports_psr2) { + psr_enable(data.debugfs_fd, PSR_MODE_2); + igt_assert(psr_enabled(data.debugfs_fd, &mode)); + igt_assert(mode == PSR_MODE_2); + + psr_disable(data.debugfs_fd); + igt_assert(!psr_enabled(data.debugfs_fd, NULL)); + + psr_enable(data.debugfs_fd, PSR_MODE_2); + igt_assert(psr_enabled(data.debugfs_fd, &mode)); + igt_assert(mode == PSR_MODE_2); + + psr_enable(data.debugfs_fd, PSR_MODE_1); + igt_assert(psr_enabled(data.debugfs_fd, &mode)); + igt_assert(mode == PSR_MODE_1); + + psr_enable(data.debugfs_fd, PSR_MODE_2); + igt_assert(psr_enabled(data.debugfs_fd, &mode)); + igt_assert(mode == PSR_MODE_2); + } + } + for (data.op_psr_mode = PSR_MODE_1; data.op_psr_mode <= PSR_MODE_2; data.op_psr_mode++) { -- 2.20.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for tests/psr: Test the switching between all PSR version from debugfs 2019-02-01 2:01 [igt-dev] [PATCH i-g-t] tests/psr: Test the switching between all PSR version from debugfs José Roberto de Souza @ 2019-02-01 3:01 ` Patchwork 2019-02-01 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork 1 sibling, 0 replies; 3+ messages in thread From: Patchwork @ 2019-02-01 3:01 UTC (permalink / raw) To: Souza, Jose; +Cc: igt-dev == Series Details == Series: tests/psr: Test the switching between all PSR version from debugfs URL : https://patchwork.freedesktop.org/series/56074/ State : success == Summary == CI Bug Log - changes from CI_DRM_5522 -> IGTPW_2330 ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/56074/revisions/1/mbox/ Known issues ------------ Here are the changes found in IGTPW_2330 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@i915_selftest@live_execlists: - fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] * igt@kms_busy@basic-flip-a: - fi-gdg-551: PASS -> FAIL [fdo#103182] +1 * igt@kms_chamelium@dp-hpd-fast: - fi-kbl-7500u: PASS -> DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105602] * igt@kms_frontbuffer_tracking@basic: - fi-byt-clapper: PASS -> FAIL [fdo#103167] * igt@kms_pipe_crc_basic@read-crc-pipe-b: - fi-byt-clapper: PASS -> FAIL [fdo#107362] * igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence: - fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362] #### Possible fixes #### * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence: - fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c: - fi-kbl-7567u: {SKIP} [fdo#109271] -> PASS +1 * igt@prime_vgem@basic-fence-flip: - fi-kbl-7500u: {SKIP} [fdo#109271] -> PASS +33 {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505 [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167 [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182 [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191 [fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558 [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927 [fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602 [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362 [fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278 Participating hosts (49 -> 41) ------------------------------ Missing (8): fi-kbl-soraka fi-hsw-4770r fi-ilk-m540 fi-bsw-cyan fi-ctg-p8600 fi-glk-j4005 fi-icl-y fi-skl-6700hq Build changes ------------- * IGT: IGT_4802 -> IGTPW_2330 CI_DRM_5522: 3f287cb6d4ae4689eb7c53e4c25f0fba3df16438 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2330: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2330/ IGT_4802: 4049adf01014af077df2174def4fadf7cecb066e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Testlist changes == +igt@kms_psr@debugfs == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2330/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 3+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for tests/psr: Test the switching between all PSR version from debugfs 2019-02-01 2:01 [igt-dev] [PATCH i-g-t] tests/psr: Test the switching between all PSR version from debugfs José Roberto de Souza 2019-02-01 3:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork @ 2019-02-01 6:30 ` Patchwork 1 sibling, 0 replies; 3+ messages in thread From: Patchwork @ 2019-02-01 6:30 UTC (permalink / raw) To: Souza, Jose; +Cc: igt-dev == Series Details == Series: tests/psr: Test the switching between all PSR version from debugfs URL : https://patchwork.freedesktop.org/series/56074/ State : success == Summary == CI Bug Log - changes from CI_DRM_5522_full -> IGTPW_2330_full ==================================================== Summary ------- **SUCCESS** No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/56074/revisions/1/mbox/ Known issues ------------ Here are the changes found in IGTPW_2330_full that come from known issues: ### IGT changes ### #### Issues hit #### * igt@kms_available_modes_crc@available_mode_test_crc: - shard-glk: PASS -> FAIL [fdo#106641] * igt@kms_busy@extended-modeset-hang-newfb-render-a: - shard-snb: NOTRUN -> DMESG-WARN [fdo#107956] * igt@kms_color@pipe-a-legacy-gamma: - shard-apl: PASS -> FAIL [fdo#104782] / [fdo#108145] * igt@kms_cursor_crc@cursor-256x256-sliding: - shard-glk: PASS -> FAIL [fdo#103232] +4 * igt@kms_cursor_crc@cursor-64x21-random: - shard-apl: PASS -> FAIL [fdo#103232] +6 * igt@kms_cursor_crc@cursor-64x64-suspend: - shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232] * igt@kms_cursor_legacy@cursorb-vs-flipb-legacy: - shard-hsw: PASS -> INCOMPLETE [fdo#103540] * igt@kms_plane@pixel-format-pipe-b-planes-source-clamping: - shard-glk: PASS -> FAIL [fdo#108948] * igt@kms_plane_multiple@atomic-pipe-a-tiling-y: - shard-apl: PASS -> FAIL [fdo#103166] +3 * igt@kms_plane_multiple@atomic-pipe-b-tiling-none: - shard-glk: PASS -> FAIL [fdo#103166] +4 #### Possible fixes #### * igt@gem_exec_blt@cold: - shard-glk: DMESG-WARN [fdo#105763] / [fdo#106538] -> PASS * igt@gem_exec_params@rel-constants-invalid-rel-gen5: - shard-snb: INCOMPLETE [fdo#105411] -> PASS * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c: - shard-glk: DMESG-WARN [fdo#107956] -> PASS * igt@kms_color@pipe-b-legacy-gamma: - shard-apl: FAIL [fdo#104782] -> PASS * igt@kms_cursor_crc@cursor-128x128-sliding: - shard-apl: FAIL [fdo#103232] -> PASS +1 * igt@kms_cursor_crc@cursor-64x21-onscreen: - shard-glk: FAIL [fdo#103232] -> PASS +1 * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max: - shard-glk: FAIL [fdo#108145] -> PASS +1 * igt@kms_plane_multiple@atomic-pipe-b-tiling-none: - shard-apl: FAIL [fdo#103166] -> PASS +3 * igt@kms_plane_multiple@atomic-pipe-c-tiling-yf: - shard-glk: FAIL [fdo#103166] -> PASS {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166 [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191 [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232 [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540 [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782 [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411 [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763 [fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538 [fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641 [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956 [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145 [fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948 [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278 Participating hosts (6 -> 4) ------------------------------ Missing (2): shard-skl shard-iclb Build changes ------------- * IGT: IGT_4802 -> IGTPW_2330 * Piglit: piglit_4509 -> None CI_DRM_5522: 3f287cb6d4ae4689eb7c53e4c25f0fba3df16438 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2330: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2330/ IGT_4802: 4049adf01014af077df2174def4fadf7cecb066e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2330/ _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-01 6:30 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-02-01 2:01 [igt-dev] [PATCH i-g-t] tests/psr: Test the switching between all PSR version from debugfs José Roberto de Souza 2019-02-01 3:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork 2019-02-01 6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox