[igt-dev] [PATCH i-g-t v2 3/3] test/kms_fbcon_fbt: Give a explicit parameter name to functions that expect debugfs fd

José Roberto de Souza jose.souza at intel.com
Thu Sep 20 17:59:18 UTC 2018


Let's rename to debugfs_fd all the parameters of the functions that
expect debugfs fd to avoid call one those functions with the wrong
file descriptor.

v2:
- Fixing code style
- Renaming fbc_wait_until_enabled() too

Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 tests/kms_fbcon_fbt.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index 138eda9b..8de3da83 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -121,10 +121,10 @@ static bool fbc_is_enabled(int debugfs_fd)
 	return strstr(buf, "FBC enabled\n");
 }
 
-static bool fbc_wait_until_enabled(int fd)
+static bool fbc_wait_until_enabled(int debugfs_fd)
 {
-	bool r = igt_wait(fbc_is_enabled(fd), 5000, 1);
-	fbc_print_status(fd);
+	bool r = igt_wait(fbc_is_enabled(debugfs_fd), 5000, 1);
+	fbc_print_status(debugfs_fd);
 	return r;
 }
 
@@ -203,34 +203,35 @@ static bool psr_is_enabled(int debugfs_fd)
 	return strstr(buf, "\nHW Enabled & Active bit: yes\n");
 }
 
-static bool psr_wait_until_enabled(int fd)
+static bool psr_wait_until_enabled(int debugfs_fd)
 {
-	bool r = igt_wait(psr_is_enabled(fd), 5000, 1);
-	psr_print_status(fd);
+	bool r = igt_wait(psr_is_enabled(debugfs_fd), 5000, 1);
+
+	psr_print_status(debugfs_fd);
 	return r;
 }
 
-static void disable_features(int fd)
+static void disable_features(int debugfs_fd)
 {
 	igt_set_module_param_int("enable_fbc", 0);
-	psr_disable(fd);
+	psr_disable(debugfs_fd);
 }
 
-static inline void fbc_modparam_enable(int fd)
+static inline void fbc_modparam_enable(int debugfs_fd)
 {
 	igt_set_module_param_int("enable_fbc", 1);
 }
 
-static inline void psr_debugfs_enable(int fd)
+static inline void psr_debugfs_enable(int debugfs_fd)
 {
-	psr_enable(fd);
+	psr_enable(debugfs_fd);
 }
 
 struct feature {
-	bool (*supported_on_chipset)(int fd);
-	bool (*wait_until_enabled)(int fd);
+	bool (*supported_on_chipset)(int debugfs_fd);
+	bool (*wait_until_enabled)(int debugfs_fd);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
-	void (*enable)(int fd);
+	void (*enable)(int debugfs_fd);
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
-- 
2.19.0



More information about the igt-dev mailing list