lib/psr: Add support for toggling edp psr through debugfs, v5.
PATCH v5 1/4 lib/psr: Add support for toggling edp psr through debugfs, v5.
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)
--- lib/igt_psr.c | 86 +++++++++++++++++++++++++++++++- lib/igt_psr.h | 2 + tests/kms_frontbuffer_tracking.c | 6 +-- 3 files changed, 89 insertions(+), 5 deletions(-)
lib/igt_psr.c +85 -1
@@ -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); +}
lib/igt_psr.h +2 -0
@@ -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
tests/kms_frontbuffer_tracking.c +2 -4
@@ -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 (); }
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v5 2/4 tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously.
This might save a modeset when the second screen is disabled in the first step, and re-enabled when enabling the secondary screen.
--- tests/kms_frontbuffer_tracking.c | 40 ++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 15 deletions(-)
tests/kms_frontbuffer_tracking.c +25 -15
@@ -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)
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v5 3/4 tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling features, v5.
In reply to Maarten LankhorstDisabling 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)
--- tests/kms_frontbuffer_tracking.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
tests/kms_frontbuffer_tracking.c +19 -9
@@ -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)
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v5 4/4 tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
In reply to Maarten LankhorstUntil 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.
--- tests/kms_frontbuffer_tracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/kms_frontbuffer_tracking.c +2 -2
@@ -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]);
Signature · 6 lines
2.18.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
Quoted 3 lines · PDT Maarten Lankhorst
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
Quoted 23 lines
Now we can just stage the disable without applying it, so each subtest can set its desired mode and
igt_displaywill update the state as required.Signed-off-by Maarten Lankhorst <[email protected]>--- tests/kms_frontbuffer_tracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/tests/kms_frontbuffer_tracking.cindexa570f93a33a8..921aaffcb52c100644tests/kms_frontbuffer_tracking.c +1
-1@@ -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);
tests/kms_frontbuffer_tracking.c static void init_crcs(enum pixel_format format, · line 1278
Quoted 8 lines
tests/kms_frontbuffer_tracking.c +1
-1@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
Quoted 7 lines · PDT Maarten Lankhorst
Quoted 3 lines
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
Quoted 27 lines
Quoted 27 lines
Now we can just stage the disable without applying it, so each subtest can set its desired mode and
igt_displaywill update the state as required.Signed-off-by Maarten Lankhorst <[email protected]>--- tests/kms_frontbuffer_tracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/tests/kms_frontbuffer_tracking.cindexa570f93a33a8..921aaffcb52c100644tests/kms_frontbuffer_tracking.c +1
-1@@ -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]); }
Quoted 8 lines
tests/kms_frontbuffer_tracking.c static void init_crcs(enum pixel_format format, · line 1278
Quoted 5 lines
tests/kms_frontbuffer_tracking.c +1
-1-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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Dhinakaran Pandiyan
Reviewed-byRe: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
Quoted 17 lines · PDT Maarten Lankhorst
Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
Quoted 7 lines · PDT Maarten Lankhorst
Quoted 2 lines
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 callingigt_display_commit. Next enable CRTC will enable PSR.
Quoted 8 lines
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
Quoted 30 lines
~Maarten
Quoted 28 lines
Quoted 28 lines
Now we can just stage the disable without applying it, so each subtest can set its desired mode and
igt_displaywill update the state as required.Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_frontbuffer_tracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/tests/kms_frontbuffer_tracking.cindexa570f93a33a8..921aaffcb52c100644tests/kms_frontbuffer_tracking.c +1
-1@@ -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]);
Quoted 8 lines
Quoted 8 lines
tests/kms_frontbuffer_tracking.c static void init_crcs(enum pixel_format format, · line 1278
Quoted 8 lines
tests/kms_frontbuffer_tracking.c +1
-1} -unset_all_crtcs (); +igt_display_reset (&drm.display);tests/kms_frontbuffer_tracking.c +0
-0for (r =0 ; r < pattern->n_rects; r++)igt_remove_fb (drm.fd, &tmp_fbs[r]);
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v5 4/4] tests/kms_frontbuffer_tracking: Don't unset mode after reading CRC
Op 30-08-18 om 04:02 schreef Dhinakaran Pandiyan:
Quoted 60 lines · PDT Maarten Lankhorst
Quoted 15 lines
Op 18-08-18 om 02:04 schreef Dhinakaran Pandiyan:
Quoted 6 lines · PDT Maarten Lankhorst
Quoted 2 lines
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 callingigt_display_commit. Next enable CRTC will enable PSR.Quoted 8 lines
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 <[email protected]>Quoted 30 lines
~Maarten
Quoted 28 lines
Quoted 28 lines
Now we can just stage the disable without applying it, so each subtest can set its desired mode and
igt_displaywill update the state as required.Signed-off-by Maarten Lankhorst <[email protected]>---
tests/kms_frontbuffer_tracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/tests/kms_frontbuffer_tracking.cindexa570f93a33a8..921aaffcb52c100644tests/kms_frontbuffer_tracking.c +1
-1@@ -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]);
Quoted 11 lines
Quoted 8 lines
Quoted 8 lines
tests/kms_frontbuffer_tracking.c static void init_crcs(enum pixel_format format, · line 1278
Quoted 8 lines
tests/kms_frontbuffer_tracking.c +1
-1} -unset_all_crtcs (); +igt_display_reset (&drm.display);tests/kms_frontbuffer_tracking.c +0
-0for (r =0 ; r < pattern->n_rects; r++)igt_remove_fb (drm.fd, &tmp_fbs[r]);
Thanks, pushed. :)
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[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.
In reply to Maarten Lankhorst== Series Details ==
== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[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.
In reply to Maarten Lankhorst== Series Details ==
== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 50 lines · PDT Maarten Lankhorst
It's harmful to write to
enable_psrat runtime, and the patch that allows us to changei915_edp_psr_debugwith 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 ini915_edp_psr_debug. Changes since v3:
- Enable IRQ debugging for extra logging.
- Force PSR1 mode. (dhnkrn)
- Move PSR enable/disable functions tolib/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 <[email protected]>--- lib/igt_psr.c | 86 +++++++++++++++++++++++++++++++- lib/igt_psr.h | 2 + tests/kms_frontbuffer_tracking.c | 6 +-- 3 files changed, 89 insertions(+), 5 deletions(-)lib/igt_psr.c +7
-1@@ -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));
lib/igt_psr.c bool psr_wait_entry(int fd) · line 56
Quoted 10 lines
lib/igt_psr.c +10
-0+} + +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 <[email protected]>
Quoted 103 lines
lib/igt_psr.c +68
-0+*/ + 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); +}lib/igt_psr.h +2
-0@@ -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 (quoted diff) +0
-0
b/tests/kms_frontbuffer_tracking.cindex1dfd7c1cee8d..7ea2f697184d100644tests/kms_frontbuffer_tracking.c +1
-3@@ -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 (); }
tests/kms_frontbuffer_tracking.c static void enable_features_for_test(const struct · line 1723
Quoted 8 lines
tests/kms_frontbuffer_tracking.c +1
-1@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 77 lines · Maarten Lankhorst
It's harmful to write to
enable_psrat runtime, and the patch that allows
us to changei915_edp_psr_debugwith 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 ini915_edp_psr_debug. Changes since v3:
- Enable IRQ debugging for extra logging.
- Force PSR1 mode. (dhnkrn)
- Move PSR enable/disable functions tolib/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 <[email protected]>--- lib/igt_psr.c | 86 +++++++++++++++++++++++++++++++- lib/igt_psr.h | 2 + tests/kms_frontbuffer_tracking.c | 6 +-- 3 files changed, 89 insertions(+), 5 deletions(-)lib/igt_psr.c +7
-1@@ -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));
lib/igt_psr.c +8
-0+} + +static int has_psr_debugfs (int fd) +{ +int ret; + +/* +* Check if new PSR debugfs api is usable by writing an invalid value.
lib/igt_psr.c +10
-1+* 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. */
lib/igt_psr.c bool psr_wait_entry(int fd) · line 71
Quoted 7 lines
lib/igt_psr.c +7
-0+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.
lib/igt_psr.c bool psr_wait_entry(int fd) · line 82
Quoted 11 lines
lib/igt_psr.c +11
-0+ +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.
Quoted 88 lines
lib/igt_psr.c +42
-0+ +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); +}lib/igt_psr.h +2
-0@@ -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 tests/kms_frontbuffer_tracking.c +2
-4@@ -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 ();
Quoted 1 line
}
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev