public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/sysfs: Fix fbcon rebind
@ 2017-09-06 13:04 ville.syrjala
  2017-09-06 13:22 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: ville.syrjala @ 2017-09-06 13:04 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

"echo 1 > vtconN/bind" doesn't actually do anything. Looks like the only
way to rebind fbcon is to unbind the current console.

I suppose the failure to rebind might be a kernel bug, but I can't be
bothered to decode the vt.c spaghetti so let's just try to handle this
in igt. For simplicity let's assume the currently bound console is the
dummy console and unbind that when we want to rebind fbcon. That works
for me.

With rebinding not working we can't really tell wich console is going
to get bound anyway, so there's no way to make this code really robust,
assuming we ever had more than these two console drivers involved.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_sysfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 9227e374bf44..12be8a165c34 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -516,13 +516,14 @@ void kick_fbcon(bool enable)
 		if (len >= 0)
 			buf[len] = '\0';
 
-		if (!strstr(buf, "frame buffer device"))
+		if (!strstr(buf, enable ? "dummy device" :
+			    "frame buffer device"))
 			continue;
 
 		sprintf(buf, "%s/%s/bind", path, de->d_name);
 		fd = open(buf, O_WRONLY);
 		if (fd != -1) {
-			igt_ignore_warn(write(fd, enable ? "1\n" : "0\n", 2));
+			igt_ignore_warn(write(fd, "0\n", 2));
 			close(fd);
 		}
 	}
-- 
2.13.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-08  7:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-06 13:04 [PATCH i-g-t] lib/sysfs: Fix fbcon rebind ville.syrjala
2017-09-06 13:22 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-06 14:08 ` [PATCH i-g-t] " Chris Wilson
2017-09-06 14:34   ` Ville Syrjälä
2017-09-08  7:09     ` Daniel Vetter
2017-09-06 14:17 ` ✓ Fi.CI.IGT: success for " Patchwork
2017-09-07 18:44 ` [PATCH i-g-t] " Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox