* [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
@ 2018-08-17 8:56 Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously Maarten Lankhorst
` (6 more replies)
0 siblings, 7 replies; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-17 8:56 UTC (permalink / raw)
To: igt-dev
It's harmful to write to enable_psr at runtime, and the patch that allows
us to change i915_edp_psr_debug with the panel running will require us
to abandon the module parameter. Hence the userspace change needs to be
put in IGT first before we can change it at kernel time.
Toggling it to debugfs will mean we can skip a modeset when changing our
feature set.
Changes since v1:
- Rebase with the previous patches dropped.
Changes since v2:
- Rebase on top of new api in i915_edp_psr_debug.
Changes since v3:
- Enable IRQ debugging for extra logging.
- Force PSR1 mode. (dhnkrn)
- Move PSR enable/disable functions to lib/igt_psr. (dhnkrn)
Changes since v4:
- Redisable irqs right away when debugfs api doesn't work. (dhnkrn)
- Use hex everywhere. (dhnkrn)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
lib/igt_psr.c | 86 +++++++++++++++++++++++++++++++-
lib/igt_psr.h | 2 +
tests/kms_frontbuffer_tracking.c | 6 +--
3 files changed, 89 insertions(+), 5 deletions(-)
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index c979b0b59936..614caa6fd809 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -21,7 +21,9 @@
* IN THE SOFTWARE.
*/
-#include "igt_psr.h"
+#include "igt_psr.h"
+#include "igt_sysfs.h"
+#include <errno.h>
bool psr_active(int fd, bool check_active)
{
@@ -38,3 +40,85 @@ bool psr_wait_entry(int fd)
{
return igt_wait(psr_active(fd, true), 500, 1);
}
+
+static ssize_t psr_write(int fd, const char *buf)
+{
+ return igt_sysfs_write(fd, "i915_edp_psr_debug", buf, strlen(buf));
+}
+
+static int has_psr_debugfs(int fd)
+{
+ int ret;
+
+ /*
+ * Check if new PSR debugfs api is usable by writing an invalid value.
+ * Legacy mode will return OK here, debugfs api will return -EINVAL.
+ * -ENODEV is returned.
+ */
+ ret = psr_write(fd, "0xf");
+ if (ret == -EINVAL)
+ return 0;
+ else if (ret < 0)
+ return ret;
+
+ /* legacy debugfs api, we enabled irqs by writing, disable them. */
+ psr_write(fd, "0");
+ return -EINVAL;
+}
+
+static bool psr_modparam_set(int val)
+{
+ static int oldval = -1;
+
+ igt_set_module_param_int("enable_psr", val);
+
+ if (val == oldval)
+ return false;
+
+ oldval = val;
+ return true;
+}
+
+static int psr_restore_debugfs_fd = -1;
+
+static void restore_psr_debugfs(int sig)
+{
+ psr_write(psr_restore_debugfs_fd, "0");
+}
+
+static bool psr_set(int fd, bool enable)
+{
+ int ret;
+
+ ret = has_psr_debugfs(fd);
+ if (ret == -ENODEV) {
+ igt_skip_on_f(enable, "PSR not available\n");
+ return false;
+ }
+
+ if (ret == -EINVAL) {
+ ret = psr_modparam_set(enable);
+ } else {
+ ret = psr_write(fd, enable ? "0x3" : "0x1");
+ igt_assert(ret > 0);
+ }
+
+ /* Restore original value on exit */
+ if (psr_restore_debugfs_fd == -1) {
+ psr_restore_debugfs_fd = dup(fd);
+ igt_assert(psr_restore_debugfs_fd >= 0);
+ igt_install_exit_handler(restore_psr_debugfs);
+ }
+
+ return ret;
+}
+
+bool psr_enable(int fd)
+{
+ return psr_set(fd, true);
+}
+
+bool psr_disable(int fd)
+{
+ return psr_set(fd, false);
+}
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index 980f85e04b3e..0ef22c3d1258 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -30,5 +30,7 @@
bool psr_wait_entry(int fd);
bool psr_active(int fd, bool check_active);
+bool psr_enable(int fd);
+bool psr_disable(int fd);
#endif
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1dfd7c1cee8d..7ea2f697184d 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -941,8 +941,6 @@ static bool drrs_wait_until_rr_switch_to_low(void)
#define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
#define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
-#define psr_enable() igt_set_module_param_int("enable_psr", 1)
-#define psr_disable() igt_set_module_param_int("enable_psr", 0)
#define drrs_enable() drrs_set(1)
#define drrs_disable() drrs_set(0)
@@ -1137,7 +1135,7 @@ static void disable_features(const struct test_mode *t)
return;
fbc_disable();
- psr_disable();
+ psr_disable(drm.debugfs);
drrs_disable();
}
@@ -1719,7 +1717,7 @@ static void enable_features_for_test(const struct test_mode *t)
if (t->feature & FEATURE_FBC)
fbc_enable();
if (t->feature & FEATURE_PSR)
- psr_enable();
+ psr_enable(drm.debugfs);
if (t->feature & FEATURE_DRRS)
drrs_enable();
}
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
@ 2018-08-17 8:56 ` Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 3/4] tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5 Maarten Lankhorst
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-17 8:56 UTC (permalink / raw)
To: igt-dev
This might save a modeset when the second screen is disabled in the
first step, and re-enabled when enabling the secondary screen.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_frontbuffer_tracking.c | 40 ++++++++++++++++++++------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 7ea2f697184d..07b70fbfb4b7 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1687,10 +1687,18 @@ static void enable_prim_screen_and_wait(const struct test_mode *t)
do_assertions(ASSERT_NO_ACTION_CHANGE);
}
-static void enable_scnd_screen_and_wait(const struct test_mode *t)
+static void enable_both_screens_and_wait(const struct test_mode *t)
{
+ fill_fb_region(&prim_mode_params.primary, COLOR_PRIM_BG);
fill_fb_region(&scnd_mode_params.primary, COLOR_SCND_BG);
- set_mode_for_params(&scnd_mode_params);
+
+ __set_mode_for_params(&prim_mode_params);
+ __set_mode_for_params(&scnd_mode_params);
+
+ igt_display_commit2(&drm.display, drm.display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ wanted_crc = &blue_crcs[t->format].crc;
+ fbc_update_last_action();
do_assertions(ASSERT_NO_ACTION_CHANGE);
}
@@ -1822,7 +1830,11 @@ static void prepare_subtest_data(const struct test_mode *t,
static void prepare_subtest_screens(const struct test_mode *t)
{
- enable_prim_screen_and_wait(t);
+ if (t->pipes == PIPE_DUAL)
+ enable_both_screens_and_wait(t);
+ else
+ enable_prim_screen_and_wait(t);
+
if (t->screen == SCREEN_PRIM) {
if (t->plane == PLANE_CUR)
set_region_for_test(t, &prim_mode_params.cursor);
@@ -1830,11 +1842,7 @@ static void prepare_subtest_screens(const struct test_mode *t)
set_region_for_test(t, &prim_mode_params.sprite);
}
- if (t->pipes == PIPE_SINGLE)
- return;
-
- enable_scnd_screen_and_wait(t);
- if (t->screen == SCREEN_SCND) {
+ if (t->pipes == PIPE_DUAL && t->screen == SCREEN_SCND) {
if (t->plane == PLANE_CUR)
set_region_for_test(t, &scnd_mode_params.cursor);
if (t->plane == PLANE_SPR)
@@ -1872,16 +1880,18 @@ static void rte_subtest(const struct test_mode *t)
do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
- enable_prim_screen_and_wait(t);
+ if (t->pipes == PIPE_SINGLE)
+ enable_prim_screen_and_wait(t);
+ else
+ enable_both_screens_and_wait(t);
+
set_region_for_test(t, &prim_mode_params.cursor);
set_region_for_test(t, &prim_mode_params.sprite);
- if (t->pipes == PIPE_SINGLE)
- return;
-
- enable_scnd_screen_and_wait(t);
- set_region_for_test(t, &scnd_mode_params.cursor);
- set_region_for_test(t, &scnd_mode_params.sprite);
+ if (t->pipes == PIPE_DUAL) {
+ set_region_for_test(t, &scnd_mode_params.cursor);
+ set_region_for_test(t, &scnd_mode_params.sprite);
+ }
}
static void update_wanted_crc(const struct test_mode *t, igt_crc_t *crc)
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t v5 3/4] tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously Maarten Lankhorst
@ 2018-08-17 8:56 ` Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC Maarten Lankhorst
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-17 8:56 UTC (permalink / raw)
To: igt-dev
Disabling PSR and FBC used to require a commit, but now that changes
to FBC take effect after the next commit, and PSR is toggled through
debugfs we can skip those modesets.
Changes since v1:
- Try to avoid modesets for PSR if the kernel supports it, but otherwise force
a modeset for the changes to take effect.
Changes since v2:
- Rebase on top of previous PSR changes.
Changes since v3:
- Rebase on move to lib/igt_psr.
Changes since v4:
- Split out related changes. (dhnkrn)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_frontbuffer_tracking.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 07b70fbfb4b7..a570f93a33a8 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1129,14 +1129,14 @@ static void unset_all_crtcs(void)
igt_display_commit(&drm.display);
}
-static void disable_features(const struct test_mode *t)
+static bool disable_features(const struct test_mode *t)
{
if (t->feature == FEATURE_DEFAULT)
- return;
+ return false;
fbc_disable();
- psr_disable(drm.debugfs);
drrs_disable();
+ return psr_disable(drm.debugfs);
}
static void *busy_thread_func(void *data)
@@ -1717,17 +1717,21 @@ static void set_region_for_test(const struct test_mode *t,
do_assertions(ASSERT_NO_ACTION_CHANGE);
}
-static void enable_features_for_test(const struct test_mode *t)
+static bool enable_features_for_test(const struct test_mode *t)
{
+ bool ret = false;
+
if (t->feature == FEATURE_DEFAULT)
- return;
+ return false;
if (t->feature & FEATURE_FBC)
fbc_enable();
if (t->feature & FEATURE_PSR)
- psr_enable(drm.debugfs);
+ ret = psr_enable(drm.debugfs);
if (t->feature & FEATURE_DRRS)
drrs_enable();
+
+ return ret;
}
static void check_test_requirements(const struct test_mode *t)
@@ -1809,23 +1813,29 @@ static void set_crtc_fbs(const struct test_mode *t)
static void prepare_subtest_data(const struct test_mode *t,
struct draw_pattern_info *pattern)
{
+ bool need_modeset;
+
check_test_requirements(t);
stop_busy_thread();
- disable_features(t);
+ need_modeset = disable_features(t);
set_crtc_fbs(t);
if (t->screen == SCREEN_OFFSCREEN)
fill_fb_region(&offscreen_fb, COLOR_OFFSCREEN_BG);
- unset_all_crtcs();
+ igt_display_reset(&drm.display);
+ if (need_modeset)
+ igt_display_commit(&drm.display);
init_blue_crc(t->format);
if (pattern)
init_crcs(t->format, pattern);
- enable_features_for_test(t);
+ need_modeset = enable_features_for_test(t);
+ if (need_modeset)
+ igt_display_commit(&drm.display);
}
static void prepare_subtest_screens(const struct test_mode *t)
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 3/4] tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5 Maarten Lankhorst
@ 2018-08-17 8:56 ` Maarten Lankhorst
2018-08-18 0:04 ` Dhinakaran Pandiyan
2018-08-17 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-17 8:56 UTC (permalink / raw)
To: igt-dev
Until the previous commit we had to disable the mode after reading CRC
because otherwise we might not have been enable features correctly.
Now we can just stage the disable without applying it, so each subtest
can set its desired mode and igt_display will update the state as
required.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_frontbuffer_tracking.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a570f93a33a8..921aaffcb52c 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1220,7 +1220,7 @@ static void init_blue_crc(enum pixel_format format)
print_crc("Blue CRC: ", &blue_crcs[format].crc);
- unset_all_crtcs();
+ igt_display_reset(&drm.display);
igt_remove_fb(drm.fd, &blue);
@@ -1272,7 +1272,7 @@ static void init_crcs(enum pixel_format format,
print_crc("", &pattern->crcs[format][r]);
}
- unset_all_crtcs();
+ igt_display_reset(&drm.display);
for (r = 0; r < pattern->n_rects; r++)
igt_remove_fb(drm.fd, &tmp_fbs[r]);
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
` (2 preceding siblings ...)
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC Maarten Lankhorst
@ 2018-08-17 11:04 ` Patchwork
2018-08-17 14:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2018-08-17 11:04 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
URL : https://patchwork.freedesktop.org/series/48382/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4684 -> IGTPW_1726 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48382/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1726 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
{fi-byt-clapper}: PASS -> INCOMPLETE (fdo#102657)
{igt@kms_psr@primary_page_flip}:
{fi-icl-u}: NOTRUN -> FAIL (fdo#107383) +3
{igt@kms_psr@sprite_plane_onoff}:
{fi-bdw-samus}: NOTRUN -> FAIL (fdo#107360)
{igt@pm_rpm@module-reload}:
fi-bxt-dsi: NOTRUN -> WARN (fdo#107602)
{fi-icl-u}: NOTRUN -> WARN (fdo#107602)
{fi-bdw-samus}: NOTRUN -> DMESG-FAIL (fdo#107603)
==== Possible fixes ====
igt@drv_selftest@live_hangcheck:
fi-skl-guc: DMESG-FAIL (fdo#106685, fdo#107174) -> PASS
fi-bxt-j4205: DMESG-FAIL (fdo#106560) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-bxt-dsi: INCOMPLETE (fdo#103927) -> PASS
==== Warnings ====
{igt@kms_psr@primary_page_flip}:
fi-cnl-psr: DMESG-WARN (fdo#107372) -> DMESG-FAIL (fdo#107372)
{igt@pm_rpm@module-reload}:
fi-skl-6700k2: FAIL -> WARN (fdo#107602)
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#102657 https://bugs.freedesktop.org/show_bug.cgi?id=102657
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106685 https://bugs.freedesktop.org/show_bug.cgi?id=106685
fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
fdo#107360 https://bugs.freedesktop.org/show_bug.cgi?id=107360
fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
== Participating hosts (52 -> 49) ==
Additional (2): fi-icl-u fi-bdw-samus
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* IGT: IGT_4604 -> IGTPW_1726
CI_DRM_4684: bb1a6d0044581c5d8867afde39111ea4605c644d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1726: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1726/
IGT_4604: 2a5777f8a694f1f8edcf021afb1ef36192c6762d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1726/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
` (3 preceding siblings ...)
2018-08-17 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
@ 2018-08-17 14:31 ` Patchwork
2018-08-18 0:02 ` [igt-dev] [PATCH i-g-t v5 1/4] " Dhinakaran Pandiyan
2018-09-04 21:41 ` Souza, Jose
6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2018-08-17 14:31 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
URL : https://patchwork.freedesktop.org/series/48382/
State : success
== Summary ==
= CI Bug Log - changes from IGT_4604_full -> IGTPW_1726_full =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/48382/revisions/1/mbox/
== Known issues ==
Here are the changes found in IGTPW_1726_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_suspend@shrink:
shard-snb: PASS -> FAIL (fdo#106886)
igt@gem_exec_schedule@pi-ringfull-bsd1:
shard-kbl: NOTRUN -> FAIL (fdo#103158)
igt@prime_vgem@basic-wait-default:
shard-snb: PASS -> INCOMPLETE (fdo#105411)
==== Possible fixes ====
igt@gem_mocs_settings@mocs-rc6-bsd1:
shard-snb: INCOMPLETE (fdo#105411) -> SKIP
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
shard-kbl: FAIL (fdo#99912) -> PASS
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* IGT: IGT_4604 -> IGTPW_1726
* Linux: CI_DRM_4680 -> CI_DRM_4684
CI_DRM_4680: c0adc75a6340ba5a3f9cf07c5064627ee73b9ba9 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_4684: bb1a6d0044581c5d8867afde39111ea4605c644d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1726: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1726/
IGT_4604: 2a5777f8a694f1f8edcf021afb1ef36192c6762d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1726/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
` (4 preceding siblings ...)
2018-08-17 14:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-08-18 0:02 ` Dhinakaran Pandiyan
2018-09-04 21:41 ` Souza, Jose
6 siblings, 0 replies; 12+ messages in thread
From: Dhinakaran Pandiyan @ 2018-08-18 0:02 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: igt-dev
On Friday, August 17, 2018 1:56:39 AM PDT Maarten Lankhorst wrote:
> It's harmful to write to enable_psr at runtime, and the patch that allows
> us to change i915_edp_psr_debug with the panel running will require us
> to abandon the module parameter. Hence the userspace change needs to be
> put in IGT first before we can change it at kernel time.
>
> Toggling it to debugfs will mean we can skip a modeset when changing our
> feature set.
>
> Changes since v1:
> - Rebase with the previous patches dropped.
> Changes since v2:
> - Rebase on top of new api in i915_edp_psr_debug.
> Changes since v3:
> - Enable IRQ debugging for extra logging.
> - Force PSR1 mode. (dhnkrn)
> - Move PSR enable/disable functions to lib/igt_psr. (dhnkrn)
> Changes since v4:
> - Redisable irqs right away when debugfs api doesn't work. (dhnkrn)
> - Use hex everywhere. (dhnkrn)
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> lib/igt_psr.c | 86 +++++++++++++++++++++++++++++++-
> lib/igt_psr.h | 2 +
> tests/kms_frontbuffer_tracking.c | 6 +--
> 3 files changed, 89 insertions(+), 5 deletions(-)
>
> diff --git a/lib/igt_psr.c b/lib/igt_psr.c
> index c979b0b59936..614caa6fd809 100644
> --- a/lib/igt_psr.c
> +++ b/lib/igt_psr.c
> @@ -21,7 +21,9 @@
> * IN THE SOFTWARE.
> */
>
> -#include "igt_psr.h"
> +#include "igt_psr.h"
> +#include "igt_sysfs.h"
> +#include <errno.h>
>
> bool psr_active(int fd, bool check_active)
> {
> @@ -38,3 +40,85 @@ bool psr_wait_entry(int fd)
> {
> return igt_wait(psr_active(fd, true), 500, 1);
> }
> +
> +static ssize_t psr_write(int fd, const char *buf)
> +{
> + return igt_sysfs_write(fd, "i915_edp_psr_debug", buf, strlen(buf));
> +}
> +
> +static int has_psr_debugfs(int fd)
> +{
> + int ret;
> +
> + /*
> + * Check if new PSR debugfs api is usable by writing an invalid value.
> + * Legacy mode will return OK here, debugfs api will return -EINVAL.
> + * -ENODEV is returned.
^ some words are missing in that last line, can you fix that when
merging?
Patches 1-3 Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> + */
> + ret = psr_write(fd, "0xf");
> + if (ret == -EINVAL)
> + return 0;
> + else if (ret < 0)
> + return ret;
> +
> + /* legacy debugfs api, we enabled irqs by writing, disable them. */
> + psr_write(fd, "0");
> + return -EINVAL;
> +}
> +
> +static bool psr_modparam_set(int val)
> +{
> + static int oldval = -1;
> +
> + igt_set_module_param_int("enable_psr", val);
> +
> + if (val == oldval)
> + return false;
> +
> + oldval = val;
> + return true;
> +}
> +
> +static int psr_restore_debugfs_fd = -1;
> +
> +static void restore_psr_debugfs(int sig)
> +{
> + psr_write(psr_restore_debugfs_fd, "0");
> +}
> +
> +static bool psr_set(int fd, bool enable)
> +{
> + int ret;
> +
> + ret = has_psr_debugfs(fd);
> + if (ret == -ENODEV) {
> + igt_skip_on_f(enable, "PSR not available\n");
> + return false;
> + }
> +
> + if (ret == -EINVAL) {
> + ret = psr_modparam_set(enable);
> + } else {
> + ret = psr_write(fd, enable ? "0x3" : "0x1");
> + igt_assert(ret > 0);
> + }
> +
> + /* Restore original value on exit */
> + if (psr_restore_debugfs_fd == -1) {
> + psr_restore_debugfs_fd = dup(fd);
> + igt_assert(psr_restore_debugfs_fd >= 0);
> + igt_install_exit_handler(restore_psr_debugfs);
> + }
> +
> + return ret;
> +}
> +
> +bool psr_enable(int fd)
> +{
> + return psr_set(fd, true);
> +}
> +
> +bool psr_disable(int fd)
> +{
> + return psr_set(fd, false);
> +}
> diff --git a/lib/igt_psr.h b/lib/igt_psr.h
> index 980f85e04b3e..0ef22c3d1258 100644
> --- a/lib/igt_psr.h
> +++ b/lib/igt_psr.h
> @@ -30,5 +30,7 @@
>
> bool psr_wait_entry(int fd);
> bool psr_active(int fd, bool check_active);
> +bool psr_enable(int fd);
> +bool psr_disable(int fd);
>
> #endif
> diff --git a/tests/kms_frontbuffer_tracking.c
> b/tests/kms_frontbuffer_tracking.c index 1dfd7c1cee8d..7ea2f697184d 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -941,8 +941,6 @@ static bool drrs_wait_until_rr_switch_to_low(void)
>
> #define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
> #define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
> -#define psr_enable() igt_set_module_param_int("enable_psr", 1)
> -#define psr_disable() igt_set_module_param_int("enable_psr", 0)
> #define drrs_enable() drrs_set(1)
> #define drrs_disable() drrs_set(0)
>
> @@ -1137,7 +1135,7 @@ static void disable_features(const struct test_mode
> *t) return;
>
> fbc_disable();
> - psr_disable();
> + psr_disable(drm.debugfs);
> drrs_disable();
> }
>
> @@ -1719,7 +1717,7 @@ static void enable_features_for_test(const struct
> test_mode *t) if (t->feature & FEATURE_FBC)
> fbc_enable();
> if (t->feature & FEATURE_PSR)
> - psr_enable();
> + psr_enable(drm.debugfs);
> if (t->feature & FEATURE_DRRS)
> drrs_enable();
> }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC Maarten Lankhorst
@ 2018-08-18 0:04 ` Dhinakaran Pandiyan
2018-08-22 10:17 ` Maarten Lankhorst
0 siblings, 1 reply; 12+ messages in thread
From: Dhinakaran Pandiyan @ 2018-08-18 0:04 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: igt-dev
On Friday, August 17, 2018 1:56:42 AM PDT Maarten Lankhorst wrote:
> Until the previous commit we had to disable the mode after reading CRC
> because otherwise we might not have been enable features correctly.
>
I didn't get this, why was this the case?
-DK
> Now we can just stage the disable without applying it, so each subtest
> can set its desired mode and igt_display will update the state as
> required.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> tests/kms_frontbuffer_tracking.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_frontbuffer_tracking.c
> b/tests/kms_frontbuffer_tracking.c index a570f93a33a8..921aaffcb52c 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -1220,7 +1220,7 @@ static void init_blue_crc(enum pixel_format format)
>
> print_crc("Blue CRC: ", &blue_crcs[format].crc);
>
> - unset_all_crtcs();
> + igt_display_reset(&drm.display);
>
> igt_remove_fb(drm.fd, &blue);
>
> @@ -1272,7 +1272,7 @@ static void init_crcs(enum pixel_format format,
> print_crc("", &pattern->crcs[format][r]);
> }
>
> - unset_all_crtcs();
> + igt_display_reset(&drm.display);
>
> for (r = 0; r < pattern->n_rects; r++)
> igt_remove_fb(drm.fd, &tmp_fbs[r]);
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
2018-08-18 0:04 ` Dhinakaran Pandiyan
@ 2018-08-22 10:17 ` Maarten Lankhorst
2018-08-30 2:02 ` Dhinakaran Pandiyan
0 siblings, 1 reply; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-22 10:17 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: igt-dev
Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
> On Friday, August 17, 2018 1:56:42 AM PDT Maarten Lankhorst wrote:
>> Until the previous commit we had to disable the mode after reading CRC
>> because otherwise we might not have been enable features correctly.
>>
> I didn't get this, why was this the case?
>
> -DK
If we applied this patch before the 3/4:
- Modeset enable, read CRC, enable legacy PSR switch. No modeset done in test after because mode is identical. PSR still disabled.
Now patched, legacy PSR:
- Modeset enable, read CRC, enable legacy PSR switch, disable CRTC if using legacy PSR by calling igt_display_commit. Next enable CRTC will enable PSR.
Now patched, debugfs PSR:
- Modeset enable
- Read CRC
- Enable debugfs PSR switch. PSR enabled.
- Next commit will be done by test, which can disable the mode or set a mode. The latter case will be a compatible mode, in which case we avoid the modeset.
~Maarten
>
>> Now we can just stage the disable without applying it, so each subtest
>> can set its desired mode and igt_display will update the state as
>> required.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> tests/kms_frontbuffer_tracking.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/kms_frontbuffer_tracking.c
>> b/tests/kms_frontbuffer_tracking.c index a570f93a33a8..921aaffcb52c 100644
>> --- a/tests/kms_frontbuffer_tracking.c
>> +++ b/tests/kms_frontbuffer_tracking.c
>> @@ -1220,7 +1220,7 @@ static void init_blue_crc(enum pixel_format format)
>>
>> print_crc("Blue CRC: ", &blue_crcs[format].crc);
>>
>> - unset_all_crtcs();
>> + igt_display_reset(&drm.display);
>>
>> igt_remove_fb(drm.fd, &blue);
>>
>> @@ -1272,7 +1272,7 @@ static void init_crcs(enum pixel_format format,
>> print_crc("", &pattern->crcs[format][r]);
>> }
>>
>> - unset_all_crtcs();
>> + igt_display_reset(&drm.display);
>>
>> for (r = 0; r < pattern->n_rects; r++)
>> igt_remove_fb(drm.fd, &tmp_fbs[r]);
>
>
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
2018-08-22 10:17 ` Maarten Lankhorst
@ 2018-08-30 2:02 ` Dhinakaran Pandiyan
2018-08-30 9:12 ` Maarten Lankhorst
0 siblings, 1 reply; 12+ messages in thread
From: Dhinakaran Pandiyan @ 2018-08-30 2:02 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: igt-dev
On Wednesday, August 22, 2018 3:17:45 AM PDT Maarten Lankhorst wrote:
> Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
> > On Friday, August 17, 2018 1:56:42 AM PDT Maarten Lankhorst wrote:
> >> Until the previous commit we had to disable the mode after reading CRC
> >> because otherwise we might not have been enable features correctly.
> >
> > I didn't get this, why was this the case?
> >
> > -DK
>
> If we applied this patch before the 3/4:
> - Modeset enable, read CRC, enable legacy PSR switch. No modeset done in
> test after because mode is identical. PSR still disabled.
>
> Now patched, legacy PSR:
> - Modeset enable, read CRC, enable legacy PSR switch, disable CRTC if using
> legacy PSR by calling igt_display_commit. Next enable CRTC will enable PSR.
>
> Now patched, debugfs PSR:
> - Modeset enable
> - Read CRC
> - Enable debugfs PSR switch. PSR enabled.
> - Next commit will be done by test, which can disable the mode or set a
> mode. The latter case will be a compatible mode, in which case we avoid the
> modeset.
>
I happened to see your email today, sorry for the delay. Can you please
include this explanation in the commit message?
If CI is happy, series is
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ~Maarten
>
> >> Now we can just stage the disable without applying it, so each subtest
> >> can set its desired mode and igt_display will update the state as
> >> required.
> >>
> >> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >> ---
> >>
> >> tests/kms_frontbuffer_tracking.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/tests/kms_frontbuffer_tracking.c
> >> b/tests/kms_frontbuffer_tracking.c index a570f93a33a8..921aaffcb52c
> >> 100644
> >> --- a/tests/kms_frontbuffer_tracking.c
> >> +++ b/tests/kms_frontbuffer_tracking.c
> >> @@ -1220,7 +1220,7 @@ static void init_blue_crc(enum pixel_format format)
> >>
> >> print_crc("Blue CRC: ", &blue_crcs[format].crc);
> >>
> >> - unset_all_crtcs();
> >> + igt_display_reset(&drm.display);
> >>
> >> igt_remove_fb(drm.fd, &blue);
> >>
> >> @@ -1272,7 +1272,7 @@ static void init_crcs(enum pixel_format format,
> >>
> >> print_crc("", &pattern->crcs[format][r]);
> >>
> >> }
> >>
> >> - unset_all_crtcs();
> >> + igt_display_reset(&drm.display);
> >>
> >> for (r = 0; r < pattern->n_rects; r++)
> >>
> >> igt_remove_fb(drm.fd, &tmp_fbs[r]);
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
2018-08-30 2:02 ` Dhinakaran Pandiyan
@ 2018-08-30 9:12 ` Maarten Lankhorst
0 siblings, 0 replies; 12+ messages in thread
From: Maarten Lankhorst @ 2018-08-30 9:12 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: igt-dev
Op 30-08-18 om 04:02 schreef Dhinakaran Pandiyan:
> On Wednesday, August 22, 2018 3:17:45 AM PDT Maarten Lankhorst wrote:
>> Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
>>> On Friday, August 17, 2018 1:56:42 AM PDT Maarten Lankhorst wrote:
>>>> Until the previous commit we had to disable the mode after reading CRC
>>>> because otherwise we might not have been enable features correctly.
>>> I didn't get this, why was this the case?
>>>
>>> -DK
>> If we applied this patch before the 3/4:
>> - Modeset enable, read CRC, enable legacy PSR switch. No modeset done in
>> test after because mode is identical. PSR still disabled.
>>
>> Now patched, legacy PSR:
>> - Modeset enable, read CRC, enable legacy PSR switch, disable CRTC if using
>> legacy PSR by calling igt_display_commit. Next enable CRTC will enable PSR.
>>
>> Now patched, debugfs PSR:
>> - Modeset enable
>> - Read CRC
>> - Enable debugfs PSR switch. PSR enabled.
>> - Next commit will be done by test, which can disable the mode or set a
>> mode. The latter case will be a compatible mode, in which case we avoid the
>> modeset.
>>
> I happened to see your email today, sorry for the delay. Can you please
> include this explanation in the commit message?
>
> If CI is happy, series is
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>
>> ~Maarten
>>
>>>> Now we can just stage the disable without applying it, so each subtest
>>>> can set its desired mode and igt_display will update the state as
>>>> required.
>>>>
>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>> ---
>>>>
>>>> tests/kms_frontbuffer_tracking.c | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/tests/kms_frontbuffer_tracking.c
>>>> b/tests/kms_frontbuffer_tracking.c index a570f93a33a8..921aaffcb52c
>>>> 100644
>>>> --- a/tests/kms_frontbuffer_tracking.c
>>>> +++ b/tests/kms_frontbuffer_tracking.c
>>>> @@ -1220,7 +1220,7 @@ static void init_blue_crc(enum pixel_format format)
>>>>
>>>> print_crc("Blue CRC: ", &blue_crcs[format].crc);
>>>>
>>>> - unset_all_crtcs();
>>>> + igt_display_reset(&drm.display);
>>>>
>>>> igt_remove_fb(drm.fd, &blue);
>>>>
>>>> @@ -1272,7 +1272,7 @@ static void init_crcs(enum pixel_format format,
>>>>
>>>> print_crc("", &pattern->crcs[format][r]);
>>>>
>>>> }
>>>>
>>>> - unset_all_crtcs();
>>>> + igt_display_reset(&drm.display);
>>>>
>>>> for (r = 0; r < pattern->n_rects; r++)
>>>>
>>>> igt_remove_fb(drm.fd, &tmp_fbs[r]);
>
>
>
Thanks, pushed. :)
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5.
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
` (5 preceding siblings ...)
2018-08-18 0:02 ` [igt-dev] [PATCH i-g-t v5 1/4] " Dhinakaran Pandiyan
@ 2018-09-04 21:41 ` Souza, Jose
6 siblings, 0 replies; 12+ messages in thread
From: Souza, Jose @ 2018-09-04 21:41 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org, maarten.lankhorst@linux.intel.com
On Fri, 2018-08-17 at 10:56 +0200, Maarten Lankhorst wrote:
> It's harmful to write to enable_psr at runtime, and the patch that
> allows
> us to change i915_edp_psr_debug with the panel running will require
> us
> to abandon the module parameter. Hence the userspace change needs to
> be
> put in IGT first before we can change it at kernel time.
>
> Toggling it to debugfs will mean we can skip a modeset when changing
> our
> feature set.
>
> Changes since v1:
> - Rebase with the previous patches dropped.
> Changes since v2:
> - Rebase on top of new api in i915_edp_psr_debug.
> Changes since v3:
> - Enable IRQ debugging for extra logging.
> - Force PSR1 mode. (dhnkrn)
> - Move PSR enable/disable functions to lib/igt_psr. (dhnkrn)
> Changes since v4:
> - Redisable irqs right away when debugfs api doesn't work. (dhnkrn)
> - Use hex everywhere. (dhnkrn)
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> lib/igt_psr.c | 86
> +++++++++++++++++++++++++++++++-
> lib/igt_psr.h | 2 +
> tests/kms_frontbuffer_tracking.c | 6 +--
> 3 files changed, 89 insertions(+), 5 deletions(-)
>
> diff --git a/lib/igt_psr.c b/lib/igt_psr.c
> index c979b0b59936..614caa6fd809 100644
> --- a/lib/igt_psr.c
> +++ b/lib/igt_psr.c
> @@ -21,7 +21,9 @@
> * IN THE SOFTWARE.
> */
>
> -#include "igt_psr.h"
> +#include "igt_psr.h"
> +#include "igt_sysfs.h"
> +#include <errno.h>
>
> bool psr_active(int fd, bool check_active)
> {
> @@ -38,3 +40,85 @@ bool psr_wait_entry(int fd)
> {
> return igt_wait(psr_active(fd, true), 500, 1);
> }
> +
> +static ssize_t psr_write(int fd, const char *buf)
> +{
> + return igt_sysfs_write(fd, "i915_edp_psr_debug", buf,
> strlen(buf));
> +}
> +
> +static int has_psr_debugfs(int fd)
> +{
> + int ret;
> +
> + /*
> + * Check if new PSR debugfs api is usable by writing an invalid
> value.
> + * Legacy mode will return OK here, debugfs api will return
> -EINVAL.
> + * -ENODEV is returned.
> + */
> + ret = psr_write(fd, "0xf");
> + if (ret == -EINVAL)
> + return 0;
> + else if (ret < 0)
> + return ret;
> +
> + /* legacy debugfs api, we enabled irqs by writing, disable
> them. */
> + psr_write(fd, "0");
> + return -EINVAL;
> +}
> +
> +static bool psr_modparam_set(int val)
> +{
> + static int oldval = -1;
This looks wrong, why not read the module parameter? it will guaratee
that the returned value is correct here if something else left the
parameter with another value.
> +
> + igt_set_module_param_int("enable_psr", val);
> +
> + if (val == oldval)
> + return false;
> +
> + oldval = val;
> + return true;
> +}
> +
> +static int psr_restore_debugfs_fd = -1;
Maybe move this to the top of the file.
Other than that LGTM.
> +
> +static void restore_psr_debugfs(int sig)
> +{
> + psr_write(psr_restore_debugfs_fd, "0");
> +}
> +
> +static bool psr_set(int fd, bool enable)
> +{
> + int ret;
> +
> + ret = has_psr_debugfs(fd);
> + if (ret == -ENODEV) {
> + igt_skip_on_f(enable, "PSR not available\n");
> + return false;
> + }
> +
> + if (ret == -EINVAL) {
> + ret = psr_modparam_set(enable);
> + } else {
> + ret = psr_write(fd, enable ? "0x3" : "0x1");
> + igt_assert(ret > 0);
> + }
> +
> + /* Restore original value on exit */
> + if (psr_restore_debugfs_fd == -1) {
> + psr_restore_debugfs_fd = dup(fd);
> + igt_assert(psr_restore_debugfs_fd >= 0);
> + igt_install_exit_handler(restore_psr_debugfs);
> + }
> +
> + return ret;
> +}
> +
> +bool psr_enable(int fd)
> +{
> + return psr_set(fd, true);
> +}
> +
> +bool psr_disable(int fd)
> +{
> + return psr_set(fd, false);
> +}
> diff --git a/lib/igt_psr.h b/lib/igt_psr.h
> index 980f85e04b3e..0ef22c3d1258 100644
> --- a/lib/igt_psr.h
> +++ b/lib/igt_psr.h
> @@ -30,5 +30,7 @@
>
> bool psr_wait_entry(int fd);
> bool psr_active(int fd, bool check_active);
> +bool psr_enable(int fd);
> +bool psr_disable(int fd);
>
> #endif
> diff --git a/tests/kms_frontbuffer_tracking.c
> b/tests/kms_frontbuffer_tracking.c
> index 1dfd7c1cee8d..7ea2f697184d 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -941,8 +941,6 @@ static bool
> drrs_wait_until_rr_switch_to_low(void)
>
> #define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
> #define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
> -#define psr_enable() igt_set_module_param_int("enable_psr", 1)
> -#define psr_disable() igt_set_module_param_int("enable_psr", 0)
> #define drrs_enable() drrs_set(1)
> #define drrs_disable() drrs_set(0)
>
> @@ -1137,7 +1135,7 @@ static void disable_features(const struct
> test_mode *t)
> return;
>
> fbc_disable();
> - psr_disable();
> + psr_disable(drm.debugfs);
> drrs_disable();
> }
>
> @@ -1719,7 +1717,7 @@ static void enable_features_for_test(const
> struct test_mode *t)
> if (t->feature & FEATURE_FBC)
> fbc_enable();
> if (t->feature & FEATURE_PSR)
> - psr_enable();
> + psr_enable(drm.debugfs);
> if (t->feature & FEATURE_DRRS)
> drrs_enable();
> }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-09-04 21:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17 8:56 [igt-dev] [PATCH i-g-t v5 1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 2/4] tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 3/4] tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5 Maarten Lankhorst
2018-08-17 8:56 ` [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC Maarten Lankhorst
2018-08-18 0:04 ` Dhinakaran Pandiyan
2018-08-22 10:17 ` Maarten Lankhorst
2018-08-30 2:02 ` Dhinakaran Pandiyan
2018-08-30 9:12 ` Maarten Lankhorst
2018-08-17 11:04 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5,1/4] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
2018-08-17 14:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-08-18 0:02 ` [igt-dev] [PATCH i-g-t v5 1/4] " Dhinakaran Pandiyan
2018-09-04 21:41 ` Souza, Jose
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).