public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Maarten@freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] lib/psr: Read enable_psr instead of relly in a value assumption
Date: Wed,  5 Sep 2018 14:05:04 -0700	[thread overview]
Message-ID: <20180905210505.28867-2-jose.souza@intel.com> (raw)
In-Reply-To: <20180905210505.28867-1-jose.souza@intel.com>

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

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com
Signed-off-by: José Roberto de Souza <jose.souza@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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-09-05 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 21:05 [igt-dev] [PATCH i-g-t 1/3] lib: Add functions to read parameters José Roberto de Souza
2018-09-05 21:05 ` José Roberto de Souza [this message]
2018-09-05 21:05 ` [igt-dev] [PATCH i-g-t 3/3] lib: Use newly added igt_get_module_param() in igt_save_module_param() José Roberto de Souza
2018-09-05 21:36 ` [igt-dev] [PATCH i-g-t 1/3] lib: Add functions to read parameters Chris Wilson
2018-09-05 22:42 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] " Patchwork
2018-09-06  7:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180905210505.28867-2-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=Maarten@freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox