* [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled.
@ 2018-07-13 23:29 Dhinakaran Pandiyan
2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 2/4] tests/psr: Prepare for moving PSR state checking functions into lib Dhinakaran Pandiyan
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Dhinakaran Pandiyan @ 2018-07-13 23:29 UTC (permalink / raw)
To: igt-dev; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi
The original use for this was to validate sink CRC without PSR, now that
that the support for sink CRC was removed, this command line option is
pointless.
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
tests/kms_psr.c | 37 +++----------------------------------
1 file changed, 3 insertions(+), 34 deletions(-)
diff --git a/tests/kms_psr.c b/tests/kms_psr.c
index 4eca51da..aace884c 100644
--- a/tests/kms_psr.c
+++ b/tests/kms_psr.c
@@ -69,7 +69,6 @@ typedef struct {
int mod_stride;
drmModeModeInfo *mode;
igt_output_t *output;
- bool with_psr_disabled;
} data_t;
static void create_cursor_fb(data_t *data)
@@ -193,8 +192,7 @@ static bool sink_support(data_t *data)
igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
- return data->with_psr_disabled ||
- strstr(buf, "Sink_Support: yes\n");
+ return strstr(buf, "Sink_Support: yes\n");
}
static bool psr_active(data_t *data, bool check_active)
@@ -211,9 +209,6 @@ static bool psr_active(data_t *data, bool check_active)
static bool wait_psr_entry(data_t *data)
{
- if (data->with_psr_disabled)
- return true;
-
return igt_wait((psr_active(data, true)), 500, 1);
}
@@ -387,34 +382,11 @@ static void dpms_off_on(data_t *data)
DRM_MODE_DPMS_ON);
}
-static int opt_handler(int opt, int opt_index, void *_data)
-{
- data_t *data = _data;
-
- switch (opt) {
- case 'n':
- data->with_psr_disabled = true;
- break;
- default:
- igt_assert(0);
- }
-
- return 0;
-}
-
-int main(int argc, char *argv[])
+igt_main
{
- const char *help_str =
- " --no-psr\tRun test without PSR.";
- static struct option long_options[] = {
- {"no-psr", 0, 0, 'n'},
- { 0, 0, 0, 0 }
- };
data_t data = {};
enum operations op;
- igt_subtest_init_parse_opts(&argc, argv, "", long_options,
- help_str, opt_handler, &data);
igt_skip_on_simulation();
igt_fixture {
@@ -423,8 +395,7 @@ int main(int argc, char *argv[])
kmstest_set_vt_graphics_mode();
data.devid = intel_get_drm_devid(data.drm_fd);
- igt_set_module_param_int("enable_psr", data.with_psr_disabled ?
- 0 : 1);
+ igt_set_module_param_int("enable_psr", 1);
igt_require_f(sink_support(&data),
"Sink does not support PSR\n");
@@ -503,6 +474,4 @@ int main(int argc, char *argv[])
drm_intel_bufmgr_destroy(data.bufmgr);
display_fini(&data);
}
-
- igt_exit();
}
--
2.17.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 8+ messages in thread* [igt-dev] [PATCH i-g-t 2/4] tests/psr: Prepare for moving PSR state checking functions into lib 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan @ 2018-07-13 23:29 ` Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 3/4] tests/psr: Move PSR state test functions to lib Dhinakaran Pandiyan ` (4 subsequent siblings) 5 siblings, 0 replies; 8+ messages in thread From: Dhinakaran Pandiyan @ 2018-07-13 23:29 UTC (permalink / raw) To: igt-dev; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi Change the function arguments to not rely on test specific data as the following patches change kms_frontbuffer_tracking to reuse PSR functions. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- tests/kms_psr.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/kms_psr.c b/tests/kms_psr.c index aace884c..ded8346a 100644 --- a/tests/kms_psr.c +++ b/tests/kms_psr.c @@ -195,21 +195,21 @@ static bool sink_support(data_t *data) return strstr(buf, "Sink_Support: yes\n"); } -static bool psr_active(data_t *data, bool check_active) +static bool psr_active(int fd, bool check_active) { bool active; char buf[512]; - igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf); + igt_debugfs_read(fd, "i915_edp_psr_status", buf); active = strstr(buf, "HW Enabled & Active bit: yes\n") && (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); return check_active ? active : !active; } -static bool wait_psr_entry(data_t *data) +static bool wait_psr_entry(int fd) { - return igt_wait((psr_active(data, true)), 500, 1); + return igt_wait((psr_active(fd, true)), 500, 1); } static inline void manual(const char *expected) @@ -237,7 +237,7 @@ static void run_test(data_t *data) manual("screen GREEN"); /* Confirm screen stays Green after PSR got active */ - igt_assert(wait_psr_entry(data)); + igt_assert(wait_psr_entry(data->drm_fd)); manual("screen GREEN"); /* Setting a secondary fb/plane */ @@ -250,7 +250,7 @@ static void run_test(data_t *data) else manual("GREEN background with WHITE box"); - igt_assert(wait_psr_entry(data)); + igt_assert(wait_psr_entry(data->drm_fd)); switch (data->op) { case PAGE_FLIP: /* Only in use when testing primary plane */ @@ -298,7 +298,7 @@ static void run_test(data_t *data) expected = "screen GREEN"; break; } - igt_assert(psr_active(data, false)); + igt_assert(psr_active(data->drm_fd, false)); manual(expected); } @@ -408,13 +408,13 @@ igt_main igt_subtest("basic") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); test_cleanup(&data); } igt_subtest("no_drrs") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); igt_assert(drrs_disabled(&data)); test_cleanup(&data); } @@ -423,7 +423,7 @@ igt_main igt_subtest_f("primary_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -433,7 +433,7 @@ igt_main igt_subtest_f("sprite_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_OVERLAY); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -443,7 +443,7 @@ igt_main igt_subtest_f("cursor_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -452,7 +452,7 @@ igt_main igt_subtest_f("dpms") { data.op = RENDER; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); dpms_off_on(&data); run_test(&data); test_cleanup(&data); @@ -461,10 +461,10 @@ igt_main igt_subtest_f("suspend") { data.op = PLANE_ONOFF; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); - igt_assert(wait_psr_entry(&data)); + igt_assert(wait_psr_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } -- 2.17.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH i-g-t 3/4] tests/psr: Move PSR state test functions to lib 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 2/4] tests/psr: Prepare for moving PSR state checking functions into lib Dhinakaran Pandiyan @ 2018-07-13 23:29 ` Dhinakaran Pandiyan 2018-07-14 5:58 ` [igt-dev] [PATCH i-g-t v2 " Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 4/4] tests/frontbuffer_tracking: Use the library functions to test PSR Dhinakaran Pandiyan ` (3 subsequent siblings) 5 siblings, 1 reply; 8+ messages in thread From: Dhinakaran Pandiyan @ 2018-07-13 23:29 UTC (permalink / raw) To: igt-dev; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. Also, rename wait_psr_entry to psr_wait_entry. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- lib/Makefile.sources | 2 ++ lib/igt_psr.c | 40 ++++++++++++++++++++++++++++++++++++++++ lib/igt_psr.h | 34 ++++++++++++++++++++++++++++++++++ tests/kms_psr.c | 38 +++++++++++--------------------------- 4 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 lib/igt_psr.c create mode 100644 lib/igt_psr.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 042c1d3b..14356c94 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -103,6 +103,8 @@ lib_source_list = \ igt_kmod.h \ igt_syncobj.c \ igt_syncobj.h \ + igt_psr.c \ + igt_psr.h \ $(NULL) .PHONY: version.h.tmp diff --git a/lib/igt_psr.c b/lib/igt_psr.c new file mode 100644 index 00000000..c979b0b5 --- /dev/null +++ b/lib/igt_psr.c @@ -0,0 +1,40 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "igt_psr.h" + +bool psr_active(int fd, bool check_active) +{ + bool active; + char buf[512]; + + igt_debugfs_read(fd, "i915_edp_psr_status", buf); + active = strstr(buf, "HW Enabled & Active bit: yes\n") && + (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); + return check_active ? active : !active; +} + +bool psr_wait_entry(int fd) +{ + return igt_wait(psr_active(fd, true), 500, 1); +} diff --git a/lib/igt_psr.h b/lib/igt_psr.h new file mode 100644 index 00000000..980f85e0 --- /dev/null +++ b/lib/igt_psr.h @@ -0,0 +1,34 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef IGT_PSR_H +#define IGT_PSR_H + +#include "igt_debugfs.h" +#include "igt_core.h" +#include "igt_aux.h" + +bool psr_wait_entry(int fd); +bool psr_active(int fd, bool check_active); + +#endif diff --git a/tests/kms_psr.c b/tests/kms_psr.c index ded8346a..1ed1f232 100644 --- a/tests/kms_psr.c +++ b/tests/kms_psr.c @@ -24,6 +24,7 @@ #include "igt.h" #include "igt_sysfs.h" +#include "igt_psr.h" #include <errno.h> #include <stdbool.h> #include <stdio.h> @@ -195,23 +196,6 @@ static bool sink_support(data_t *data) return strstr(buf, "Sink_Support: yes\n"); } -static bool psr_active(int fd, bool check_active) -{ - bool active; - char buf[512]; - - igt_debugfs_read(fd, "i915_edp_psr_status", buf); - - active = strstr(buf, "HW Enabled & Active bit: yes\n") && - (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); - return check_active ? active : !active; -} - -static bool wait_psr_entry(int fd) -{ - return igt_wait((psr_active(fd, true)), 500, 1); -} - static inline void manual(const char *expected) { igt_debug_manual_check("all", expected); @@ -237,7 +221,7 @@ static void run_test(data_t *data) manual("screen GREEN"); /* Confirm screen stays Green after PSR got active */ - igt_assert(wait_psr_entry(data->drm_fd)); + igt_assert(psr_wait_entry(data->drm_fd)); manual("screen GREEN"); /* Setting a secondary fb/plane */ @@ -250,7 +234,7 @@ static void run_test(data_t *data) else manual("GREEN background with WHITE box"); - igt_assert(wait_psr_entry(data->drm_fd)); + igt_assert(psr_wait_entry(data->drm_fd)); switch (data->op) { case PAGE_FLIP: /* Only in use when testing primary plane */ @@ -408,13 +392,13 @@ igt_main igt_subtest("basic") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); test_cleanup(&data); } igt_subtest("no_drrs") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); igt_assert(drrs_disabled(&data)); test_cleanup(&data); } @@ -423,7 +407,7 @@ igt_main igt_subtest_f("primary_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -433,7 +417,7 @@ igt_main igt_subtest_f("sprite_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_OVERLAY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -443,7 +427,7 @@ igt_main igt_subtest_f("cursor_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -452,7 +436,7 @@ igt_main igt_subtest_f("dpms") { data.op = RENDER; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); dpms_off_on(&data); run_test(&data); test_cleanup(&data); @@ -461,10 +445,10 @@ igt_main igt_subtest_f("suspend") { data.op = PLANE_ONOFF; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } -- 2.17.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH i-g-t v2 3/4] tests/psr: Move PSR state test functions to lib 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 3/4] tests/psr: Move PSR state test functions to lib Dhinakaran Pandiyan @ 2018-07-14 5:58 ` Dhinakaran Pandiyan 0 siblings, 0 replies; 8+ messages in thread From: Dhinakaran Pandiyan @ 2018-07-14 5:58 UTC (permalink / raw) To: igt-dev; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. Also, rename wait_psr_entry to psr_wait_entry. v2: Include the new file in meson.build Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- lib/Makefile.sources | 2 ++ lib/igt_psr.c | 40 ++++++++++++++++++++++++++++++++++++++++ lib/igt_psr.h | 34 ++++++++++++++++++++++++++++++++++ lib/meson.build | 1 + tests/kms_psr.c | 38 +++++++++++--------------------------- 5 files changed, 88 insertions(+), 27 deletions(-) create mode 100644 lib/igt_psr.c create mode 100644 lib/igt_psr.h diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 042c1d3b..14356c94 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -103,6 +103,8 @@ lib_source_list = \ igt_kmod.h \ igt_syncobj.c \ igt_syncobj.h \ + igt_psr.c \ + igt_psr.h \ $(NULL) .PHONY: version.h.tmp diff --git a/lib/igt_psr.c b/lib/igt_psr.c new file mode 100644 index 00000000..c979b0b5 --- /dev/null +++ b/lib/igt_psr.c @@ -0,0 +1,40 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "igt_psr.h" + +bool psr_active(int fd, bool check_active) +{ + bool active; + char buf[512]; + + igt_debugfs_read(fd, "i915_edp_psr_status", buf); + active = strstr(buf, "HW Enabled & Active bit: yes\n") && + (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); + return check_active ? active : !active; +} + +bool psr_wait_entry(int fd) +{ + return igt_wait(psr_active(fd, true), 500, 1); +} diff --git a/lib/igt_psr.h b/lib/igt_psr.h new file mode 100644 index 00000000..980f85e0 --- /dev/null +++ b/lib/igt_psr.h @@ -0,0 +1,34 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef IGT_PSR_H +#define IGT_PSR_H + +#include "igt_debugfs.h" +#include "igt_core.h" +#include "igt_aux.h" + +bool psr_wait_entry(int fd); +bool psr_active(int fd, bool check_active); + +#endif diff --git a/lib/meson.build b/lib/meson.build index 939167f9..74a5f61e 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -48,6 +48,7 @@ lib_sources = [ 'uwildmat/uwildmat.c', 'igt_kmod.c', 'igt_vc4.c', + 'igt_psr.c', ] lib_deps = [ diff --git a/tests/kms_psr.c b/tests/kms_psr.c index ded8346a..1ed1f232 100644 --- a/tests/kms_psr.c +++ b/tests/kms_psr.c @@ -24,6 +24,7 @@ #include "igt.h" #include "igt_sysfs.h" +#include "igt_psr.h" #include <errno.h> #include <stdbool.h> #include <stdio.h> @@ -195,23 +196,6 @@ static bool sink_support(data_t *data) return strstr(buf, "Sink_Support: yes\n"); } -static bool psr_active(int fd, bool check_active) -{ - bool active; - char buf[512]; - - igt_debugfs_read(fd, "i915_edp_psr_status", buf); - - active = strstr(buf, "HW Enabled & Active bit: yes\n") && - (strstr(buf, "SRDENT") || strstr(buf, "SLEEP")); - return check_active ? active : !active; -} - -static bool wait_psr_entry(int fd) -{ - return igt_wait((psr_active(fd, true)), 500, 1); -} - static inline void manual(const char *expected) { igt_debug_manual_check("all", expected); @@ -237,7 +221,7 @@ static void run_test(data_t *data) manual("screen GREEN"); /* Confirm screen stays Green after PSR got active */ - igt_assert(wait_psr_entry(data->drm_fd)); + igt_assert(psr_wait_entry(data->drm_fd)); manual("screen GREEN"); /* Setting a secondary fb/plane */ @@ -250,7 +234,7 @@ static void run_test(data_t *data) else manual("GREEN background with WHITE box"); - igt_assert(wait_psr_entry(data->drm_fd)); + igt_assert(psr_wait_entry(data->drm_fd)); switch (data->op) { case PAGE_FLIP: /* Only in use when testing primary plane */ @@ -408,13 +392,13 @@ igt_main igt_subtest("basic") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); test_cleanup(&data); } igt_subtest("no_drrs") { setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); igt_assert(drrs_disabled(&data)); test_cleanup(&data); } @@ -423,7 +407,7 @@ igt_main igt_subtest_f("primary_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -433,7 +417,7 @@ igt_main igt_subtest_f("sprite_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_OVERLAY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -443,7 +427,7 @@ igt_main igt_subtest_f("cursor_%s", op_str(op)) { data.op = op; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } @@ -452,7 +436,7 @@ igt_main igt_subtest_f("dpms") { data.op = RENDER; setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); dpms_off_on(&data); run_test(&data); test_cleanup(&data); @@ -461,10 +445,10 @@ igt_main igt_subtest_f("suspend") { data.op = PLANE_ONOFF; setup_test_plane(&data, DRM_PLANE_TYPE_CURSOR); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); - igt_assert(wait_psr_entry(data.drm_fd)); + igt_assert(psr_wait_entry(data.drm_fd)); run_test(&data); test_cleanup(&data); } -- 2.17.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH i-g-t 4/4] tests/frontbuffer_tracking: Use the library functions to test PSR. 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 2/4] tests/psr: Prepare for moving PSR state checking functions into lib Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 3/4] tests/psr: Move PSR state test functions to lib Dhinakaran Pandiyan @ 2018-07-13 23:29 ` Dhinakaran Pandiyan 2018-07-13 23:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled Patchwork ` (2 subsequent siblings) 5 siblings, 0 replies; 8+ messages in thread From: Dhinakaran Pandiyan @ 2018-07-13 23:29 UTC (permalink / raw) To: igt-dev; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi kms_frontbuffer_tracking should test PSR the same way that kms_psr does. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> --- tests/kms_frontbuffer_tracking.c | 42 ++++---------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 116a95bc..1dfd7c1c 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -26,6 +26,7 @@ #include "igt.h" #include "igt_sysfs.h" +#include "igt_psr.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -756,22 +757,6 @@ static bool fbc_is_enabled(int lvl) return strstr(buf, "FBC enabled\n"); } -static bool psr_is_enabled(void) -{ - char buf[256]; - - debugfs_read("i915_edp_psr_status", buf); - return strstr(buf, "\nHW Enabled & Active bit: yes\n"); -} - -static void psr_print_status(void) -{ - char buf[256]; - - debugfs_read("i915_edp_psr_status", buf); - igt_info("PSR status:\n%s\n", buf); -} - static void drrs_set(unsigned int val) { char buf[2]; @@ -949,16 +934,6 @@ static bool fbc_wait_until_enabled(void) return igt_wait(fbc_is_enabled(IGT_LOG_DEBUG), 2000, 1); } -static bool psr_wait_until_enabled(void) -{ - return igt_wait(psr_is_enabled(), 5000, 1); -} - -static bool psr_wait_until_disabled(void) -{ - return igt_wait(!psr_is_enabled(), 5000, 1); -} - static bool drrs_wait_until_rr_switch_to_low(void) { return igt_wait(is_drrs_low(), 5000, 1); @@ -1659,17 +1634,10 @@ static void do_status_assertions(int flags) igt_assert(!fbc_wait_until_enabled()); } - if (flags & ASSERT_PSR_ENABLED) { - if (!psr_wait_until_enabled()) { - psr_print_status(); - igt_assert_f(psr_is_enabled(), "PSR still disabled\n"); - } - } else if (flags & ASSERT_PSR_DISABLED) { - if (!psr_wait_until_disabled()) { - psr_print_status(); - igt_assert_f(!psr_is_enabled(), "PSR still enabled\n"); - } - } + if (flags & ASSERT_PSR_ENABLED) + igt_assert_f(psr_wait_entry(drm.fd), "PSR still disabled\n"); + else if (flags & ASSERT_PSR_DISABLED) + igt_assert_f(psr_active(drm.fd, false), "PSR still enabled\n"); } static void __do_assertions(const struct test_mode *t, int flags, -- 2.17.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan ` (2 preceding siblings ...) 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 4/4] tests/frontbuffer_tracking: Use the library functions to test PSR Dhinakaran Pandiyan @ 2018-07-13 23:53 ` Patchwork 2018-07-14 6:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) Patchwork 2018-07-14 7:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork 5 siblings, 0 replies; 8+ messages in thread From: Patchwork @ 2018-07-13 23:53 UTC (permalink / raw) To: Dhinakaran Pandiyan; +Cc: igt-dev == Series Details == Series: series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. URL : https://patchwork.freedesktop.org/series/46519/ State : failure == Summary == IGT patchset build failed on latest successful build d8e97e1710b27a3931a1c53d1dd88c0e709c085b tests/psr: Rename kms_psr_sink_crc.c to kms_psr.c ninja: Entering directory `build' [1/334] Generating version.h with a custom command. [2/102] Linking target tests/kms_frontbuffer_tracking. FAILED: tests/kms_frontbuffer_tracking ccache cc -o tests/kms_frontbuffer_tracking 'tests/kms_frontbuffer_tracking@exe/kms_frontbuffer_tracking.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group lib/libigt.so -pthread -lcairo -lglib-2.0 -L/opt/igt/lib -ldrm -lkmod -lprocps -ludev -lunwind -lpciaccess -lm -lrt -lssl -lcrypto -L/opt/igt/lib -ldrm_intel -ldrm -lgsl -lgslcblas -lm -lpixman-1 -lpixman-1 -L/usr/lib/x86_64-linux-gnu -lxmlrpc_client -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -lcurl -Wl,--end-group -ldrm_nouveau -lpixman-1 -L/usr/lib/x86_64-linux-gnu -lxmlrpc_client -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -lcurl '-Wl,-rpath,$ORIGIN/../lib:XXXXXXXXXXXXXXXXXXXX' -Wl,-rpath-link,/home/cidrm/igt-gpu-tools/build/lib tests/kms_frontbuffer_tracking@exe/kms_frontbuffer_tracking.c.o: In function `do_status_assertions': /home/cidrm/igt-gpu-tools/build/../tests/kms_frontbuffer_tracking.c:1638: undefined reference to `psr_wait_entry' /home/cidrm/igt-gpu-tools/build/../tests/kms_frontbuffer_tracking.c:1640: undefined reference to `psr_active' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan ` (3 preceding siblings ...) 2018-07-13 23:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled Patchwork @ 2018-07-14 6:21 ` Patchwork 2018-07-14 7:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork 5 siblings, 0 replies; 8+ messages in thread From: Patchwork @ 2018-07-14 6:21 UTC (permalink / raw) To: Dhinakaran Pandiyan; +Cc: igt-dev == Series Details == Series: series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) URL : https://patchwork.freedesktop.org/series/46519/ State : success == Summary == = CI Bug Log - changes from CI_DRM_4488 -> IGTPW_1587 = == Summary - SUCCESS == No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/46519/revisions/2/mbox/ == Known issues == Here are the changes found in IGTPW_1587 that come from known issues: === IGT changes === ==== Issues hit ==== igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b: fi-snb-2520m: NOTRUN -> INCOMPLETE (fdo#103713) ==== Possible fixes ==== igt@debugfs_test@read_all_entries: fi-snb-2520m: INCOMPLETE (fdo#103713) -> PASS igt@kms_chamelium@hdmi-hpd-fast: fi-kbl-7500u: FAIL (fdo#103841, fdo#102672) -> SKIP fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672 fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713 fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841 == Participating hosts (46 -> 40) == Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-glk-j4005 fi-kbl-7560u == Build changes == * IGT: IGT_4557 -> IGTPW_1587 CI_DRM_4488: a3a527faf129e7901fdff5309a7e6df8abd72d13 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_1587: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1587/ IGT_4557: 140a67c13aad2595ee6c72e41d14d35a793158b5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1587/issues.html _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan ` (4 preceding siblings ...) 2018-07-14 6:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) Patchwork @ 2018-07-14 7:15 ` Patchwork 5 siblings, 0 replies; 8+ messages in thread From: Patchwork @ 2018-07-14 7:15 UTC (permalink / raw) To: Dhinakaran Pandiyan; +Cc: igt-dev == Series Details == Series: series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) URL : https://patchwork.freedesktop.org/series/46519/ State : success == Summary == = CI Bug Log - changes from IGT_4557_full -> IGTPW_1587_full = == Summary - WARNING == Minor unknown changes coming with IGTPW_1587_full need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_1587_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://patchwork.freedesktop.org/api/1.0/series/46519/revisions/2/mbox/ == Possible new issues == Here are the unknown changes that may have been introduced in IGTPW_1587_full: === IGT changes === ==== Warnings ==== igt@gem_exec_schedule@deep-blt: shard-kbl: PASS -> SKIP igt@gem_mocs_settings@mocs-rc6-vebox: shard-kbl: SKIP -> PASS igt@perf@mi-rpc: shard-hsw: PASS -> SKIP shard-glk: PASS -> SKIP == Known issues == Here are the changes found in IGTPW_1587_full that come from known issues: === IGT changes === ==== Issues hit ==== igt@gem_exec_fence@basic-busy-all: shard-snb: PASS -> INCOMPLETE (fdo#105411) igt@gem_ppgtt@blt-vs-render-ctx0: shard-kbl: PASS -> INCOMPLETE (fdo#106023, fdo#103665) igt@kms_available_modes_crc@available_mode_test_crc: shard-snb: PASS -> FAIL (fdo#106641) igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy: shard-hsw: PASS -> FAIL (fdo#105767) igt@kms_flip@plain-flip-ts-check-interruptible: shard-glk: PASS -> FAIL (fdo#100368) igt@kms_plane_multiple@atomic-pipe-a-tiling-x: shard-snb: PASS -> FAIL (fdo#103166) igt@kms_rotation_crc@primary-rotation-180: shard-snb: PASS -> FAIL (fdo#103925) ==== Possible fixes ==== {igt@gem_userptr_blits@readonly-mmap-unsync}: shard-snb: INCOMPLETE (fdo#105411) -> SKIP igt@kms_flip@2x-plain-flip-ts-check-interruptible: shard-glk: FAIL (fdo#100368) -> PASS igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes: shard-glk: FAIL (fdo#103375) -> PASS igt@testdisplay: shard-glk: INCOMPLETE (k.org#198133, fdo#103359) -> PASS {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368 fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166 fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359 fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375 fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665 fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925 fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411 fdo#105767 https://bugs.freedesktop.org/show_bug.cgi?id=105767 fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023 fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641 k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133 == Participating hosts (5 -> 5) == No changes in participating hosts == Build changes == * IGT: IGT_4557 -> IGTPW_1587 * Linux: CI_DRM_4487 -> CI_DRM_4488 CI_DRM_4487: 627ed020cac6a73f0a014537dac7191efbb57084 @ git://anongit.freedesktop.org/gfx-ci/linux CI_DRM_4488: a3a527faf129e7901fdff5309a7e6df8abd72d13 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_1587: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1587/ IGT_4557: 140a67c13aad2595ee6c72e41d14d35a793158b5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1587/shards.html _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-07-14 7:15 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-07-13 23:29 [igt-dev] [PATCH i-g-t 1/4] tests/psr: Remove option to run test with PSR disabled Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 2/4] tests/psr: Prepare for moving PSR state checking functions into lib Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 3/4] tests/psr: Move PSR state test functions to lib Dhinakaran Pandiyan 2018-07-14 5:58 ` [igt-dev] [PATCH i-g-t v2 " Dhinakaran Pandiyan 2018-07-13 23:29 ` [igt-dev] [PATCH i-g-t 4/4] tests/frontbuffer_tracking: Use the library functions to test PSR Dhinakaran Pandiyan 2018-07-13 23:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled Patchwork 2018-07-14 6:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/psr: Remove option to run test with PSR disabled. (rev2) Patchwork 2018-07-14 7:15 ` [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; as well as URLs for NNTP newsgroup(s).