[igt-dev] [PATCH i-g-t 2/3] lib/psr: Read enable_psr instead of relly in a value assumption

José Roberto de Souza jose.souza at intel.com
Wed Sep 5 21:05:04 UTC 2018


Instead of having a static variable with a assumed value lets be more
accurate and read the parameter.

Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 lib/igt_psr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index bc142632..75200342 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -68,14 +68,14 @@ static int has_psr_debugfs(int fd)
 
 static bool psr_modparam_set(int val)
 {
-	static int oldval = -1;
+	int oldval = -1;
 
+	igt_get_module_param_int("enable_psr", &oldval);
 	igt_set_module_param_int("enable_psr", val);
 
 	if (val == oldval)
 		return false;
 
-	oldval = val;
 	return true;
 }
 
-- 
2.18.0



More information about the igt-dev mailing list