Improve rev 183168, so that if /chosen/stdout is connected to the serial

port by OF the syscons won't take over console. Only attach syscons to "screen"
if /chosen/stdout is not connected, which could be the case when loader(8)
is booted directly from the OF. This fixes Marcel's Xserver.

Reported by:	marcel
This commit is contained in:
Maxim Sobolev 2008-09-23 22:16:23 +00:00
parent 28b53d8cbd
commit d3e5e8d1b6

View File

@ -234,17 +234,16 @@ ofwfb_configure(int flags)
chosen = OF_finddevice("/chosen");
OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
node = OF_instance_to_package(stdout);
OF_getprop(node, "device_type", type, sizeof(type));
if (strcmp(type, "display") != 0) {
if (node == -1) {
/*
* Attaching to "/chosen/stdout" has failed, try
* The "/chosen/stdout" does not exist try
* using "screen" directly.
*/
node = OF_finddevice("screen");
OF_getprop(node, "device_type", type, sizeof(type));
if (strcmp(type, "display") != 0)
return (0);
}
OF_getprop(node, "device_type", type, sizeof(type));
if (strcmp(type, "display") != 0)
return (0);
/* Only support 8 and 32-bit framebuffers */
OF_getprop(node, "depth", &depth, sizeof(depth));