summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2017-09-06 15:41:08 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2017-09-08 16:37:02 +0300
commitd18fca7f6cf37a05f759135d6b872ff31113532c (patch)
tree5d144f832c7cf68cb61db8f321dadd2828207333 /lib
parentd5de89eb17938484718be1144f5957f05ab44dc2 (diff)
lib/sysfs: Fix fbcon rebind
"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. Additionally Daniel Vetter pointed out: "We select the dummy con in i915, to be able to kick out vgacon before we register fbdev. So should always be there." Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index f7853ca0..817678bc 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -537,13 +537,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);
}
}