Skip to contentSkip to conversation

lib/sysfs: Fix fbcon rebind

PATCH In review [email protected] 4 participants 7 messages Sep 6, 2017 – Sep 8, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/sysfs: Fix fbcon rebind

From: Ville Syrjälä <[email protected]>

"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.

---
 lib/igt_sysfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/igt_sysfs.c +3 -2
index 9227e374bf44..12be8a165c34 100644
@@ -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);
 		}
 	}
Signature · 6 lines
2.13.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for lib/sysfs: Fix fbcon rebind

== Series Details ==

== Series Details ==

Series: lib/sysfs: Fix fbcon rebind
URL : https://patchwork.freedesktop.org/series/29880/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 918863f8e3e8f49235fd2e4a36e11f386c06c11c intel_display_poller: Fix truncation of a test name.

with latest DRM-Tip kernel build CI_DRM_3044
0640ea73be26 drm-tip: 2017y-09m-06d-06h-41m-15s UTC integration manifest

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:443s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:381s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:543s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:269s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:510s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:509s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:508s
fi-cfl-s         total:289  pass:250  dwarn:4   dfail:0   fail:0   skip:35  time:451s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:451s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:598s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:430s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:409s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:440s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:493s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:464s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:495s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:573s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:593s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:553s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:530s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:507s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:458s
fi-skl-x1585l    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:483s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:578s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:428s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_152/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to [email protected]

Quoting [email protected] (2017-09-06 14:04:01)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

"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.

Quoted 3 lines

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.

Hmm, CONFIG_DUMMY_CONSOLE suggests that the dummy isn't universal either. If there is no dummy, can the last be unbound? I have no idea. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 12 lines · Chris Wilson

Quoting [email protected] (2017-09-06 14:04:01)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

"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.

Quoted 6 lines
Quoted 3 lines

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.

Hmm, CONFIG_DUMMY_CONSOLE suggests that the dummy isn't universal either. If there is no dummy, can the last be unbound? I have no idea.

DUMMY_CONSOLE isn't user visible and default=y, so you can't actually disable it, I think.

It does have some suspicious looking dependencies though:
depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y

So it gets disabled only if you have both VGA and SGI_NEWPORT enabled. I suspect someone meant to say '&&' instead of '||'. But for us the '||' works better since we don't allow rebinding vgacon after it's been kicked out, and so having dummy+vga is good.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 23 lines · Ville Syrjälä
Quoted 12 lines · Chris Wilson

Quoting [email protected] (2017-09-06 14:04:01)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

"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.

Quoted 6 lines
Quoted 3 lines

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.

Hmm, CONFIG_DUMMY_CONSOLE suggests that the dummy isn't universal either. If there is no dummy, can the last be unbound? I have no idea.

DUMMY_CONSOLE isn't user visible and default=y, so you can't actually disable it, I think.

Quoted 7 lines

It does have some suspicious looking dependencies though:
depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y

So it gets disabled only if you have both VGA and SGI_NEWPORT enabled. I suspect someone meant to say '&&' instead of '||'. But for us the '||' works better since we don't allow rebinding vgacon after it's been kicked out, and so having dummy+vga is good.

We select the dummy con in i915, to be able to kick out vgacon before we register fbdev. So should always be there.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

✓ Fi.CI.IGT: success for lib/sysfs: Fix fbcon rebind

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: lib/sysfs: Fix fbcon rebind
URL : https://patchwork.freedesktop.org/series/29880/
State : success

== Summary ==

Test kms_flip:

        Subgroup plain-flip-fb-recreate-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test perf:
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252 +1
Test kms_atomic_transition:
        Subgroup plane-use-after-nonblocking-unbind:
                fail       -> INCOMPLETE (shard-hsw) fdo#101847

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#101847 https://bugs.freedesktop.org/show_bug.cgi?id=101847

shard-hsw total:2226 pass:1215 dwarn:0 dfail:0 fail:16 skip:994 time:9337s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_152/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#6 lore raw
In reply to [email protected]

Quoting [email protected] (2017-09-06 14:04:01)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

"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.

Quoted 5 lines

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.

Ok, if it works in one direction, it should work in the other... And pragmatically if it works, it works. However, I do worry if that if we have been measuring our test runtimes with never having to rebind fbcon if we suddenly get a slowdown...

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx