diff options
author | Pranay Samala <pranay.samala@intel.com> | 2025-07-07 09:02:46 +0530 |
---|---|---|
committer | Kamil Konieczny <kamil.konieczny@linux.intel.com> | 2025-07-07 11:07:36 +0200 |
commit | 690975fbec7d7e4c9f27fa1a3f0c51343af26545 (patch) | |
tree | 944fba1a125452c13fbd40aaec23de41140cbeb8 | |
parent | 0207540ca466c48faee7bd38dc11db2718d6bea7 (diff) |
In case of nested updated the exit handler will be called multiple
times. Hence calling it before the updates rather than calling after
update.
v3: Refactored for readability and address logical comment.
Fixes: 56b91193b825 ("lib/igt_sysfs: Implement dynamic adjustment of debug log level")
Fixes: a2ab0ec12ef4 ("tests/kms_atomic_transition: Reducing debug loglevel dynamically")
Fixes: 4baeb7397d71 ("tests/intel/kms_dp_linktrain_fallback: Reduce debug loglevel dynamically")
Fixes: 7a8a3744466f ("tests/kms_cursor_legacy: Reduce debug loglevel dynamically")
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
Reviewed-by: Jan Sokolowski <jan.sokolowski@intel.com>
Reviewed-by: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
-rw-r--r-- | lib/igt_sysfs.c | 8 | ||||
-rw-r--r-- | lib/igt_sysfs.h | 1 | ||||
-rw-r--r-- | tests/intel/kms_dp_linktrain_fallback.c | 1 | ||||
-rw-r--r-- | tests/kms_atomic_transition.c | 1 | ||||
-rw-r--r-- | tests/kms_cursor_legacy.c | 1 |
5 files changed, 5 insertions, 7 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index 3331d46d0..aec157b5b 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -493,7 +493,7 @@ void igt_drm_debug_mask_reset(void) close(dir); } -static void igt_drm_debug_mask_reset_exit_handler(int sig) +void igt_drm_debug_mask_reset_exit_handler(int sig) { igt_drm_debug_mask_reset(); } @@ -530,12 +530,6 @@ void igt_drm_debug_mask_update(unsigned int mask_to_set) igt_assert(igt_sysfs_set(dir, "debug", buf)); close(dir); - - /* - * TODO: Check whether multiple exit handlers will get installed, - * if we call this api multiple times - */ - igt_install_exit_handler(igt_drm_debug_mask_reset_exit_handler); } void update_debug_mask_if_ci(unsigned int debug_mask_if_ci) diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h index b86ceb63d..9cbd216e6 100644 --- a/lib/igt_sysfs.h +++ b/lib/igt_sysfs.h @@ -148,6 +148,7 @@ void igt_drm_debug_mask_reset(void); int igt_drm_debug_mask_get(int dir); int igt_sysfs_drm_module_params_open(void); void update_debug_mask_if_ci(unsigned int debug_mask_if_ci); +void igt_drm_debug_mask_reset_exit_handler(int sig); enum drm_debug_category { DRM_UT_CORE = 1 << 0, diff --git a/tests/intel/kms_dp_linktrain_fallback.c b/tests/intel/kms_dp_linktrain_fallback.c index e67c29f86..fa58999e8 100644 --- a/tests/intel/kms_dp_linktrain_fallback.c +++ b/tests/intel/kms_dp_linktrain_fallback.c @@ -605,6 +605,7 @@ igt_main igt_display_require_output(&data.display); for_each_pipe(&data.display, data.pipe) data.n_pipes++; + igt_install_exit_handler(igt_drm_debug_mask_reset_exit_handler); update_debug_mask_if_ci(debug_mask_if_ci); /* diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c index 0829133a1..8c6094987 100644 --- a/tests/kms_atomic_transition.c +++ b/tests/kms_atomic_transition.c @@ -1187,6 +1187,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) for_each_connected_output(&data.display, output) count++; + igt_install_exit_handler(igt_drm_debug_mask_reset_exit_handler); update_debug_mask_if_ci(debug_mask_if_ci); } diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 5973dcaed..9f6e644e1 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -1851,6 +1851,7 @@ igt_main */ intel_psr2_restore = i915_psr2_sel_fetch_to_psr1(display.drm_fd, NULL); + igt_install_exit_handler(igt_drm_debug_mask_reset_exit_handler); update_debug_mask_if_ci(debug_mask_if_ci); } |