Page MenuHomeFreeBSD

Add a delayed VT attachment for ofwfb
Needs ReviewPublic

Authored by jhibbits on Jun 15 2018, 3:57 AM.
Tags
None
Referenced Files
F102529514: D15818.diff
Wed, Nov 13, 3:45 PM
Unknown Object (File)
Tue, Nov 5, 1:07 PM
Unknown Object (File)
Fri, Oct 18, 9:35 AM
Unknown Object (File)
Thu, Oct 17, 8:53 AM
Unknown Object (File)
Wed, Oct 16, 3:35 PM
Unknown Object (File)
Tue, Oct 15, 12:22 PM
Unknown Object (File)
Oct 14 2024, 2:49 PM
Unknown Object (File)
Oct 13 2024, 1:21 AM
Subscribers

Details

Reviewers
nwhitehorn
Summary

In some cases, /chosen/stdout is not the VGA console. In this case there may still be a viable console. This adds a device node under vgapci* if it's a viable OFW device tree node.

Test Plan

Still need to test that I didn't break direct attachment.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17316
Build 17151: arc lint + arc unit

Event Timeline

sys/dev/vt/hw/ofwfb/ofwfb.c
90

No way for these to be the same driver?

522

It seems a bit weird to have a newbus device appear only if it's *not* the console.

525

How does this interact with drm consoles? I guess the probe bits compete later on? How about module loading of drm consoles?

551

"Open Firmware" usually has a space in it.

jhibbits added inline comments.
sys/dev/vt/hw/ofwfb/ofwfb.c
90

I think they could be the same. I mentioned this on IRC just a few minutes ago. If I move the /chosen handling code into the ofwfb_probe function instead, that might suffice, so that it's not looking for /chosen properties in the ofwfb_init().

522

If it's not the system console, but has all the makings of a video console.

525

Not sure. I don't have anything that can really use drm console right now. Maybe 'fb' device name is wrong for this.

551

Oops. I'll blame my chrome keyboard's tendency to forget I hit space.

jhibbits marked an inline comment as done.

Reduce the diff, by sharing the same VT driver between the early attach and delayed attach. This required moving some config setting into the probe routine, but that should be fine.

sys/dev/vt/hw/ofwfb/ofwfb.c
116

Is this tested on Apple hardware?

522

So? Don't you always want a newbus device, even if it is the console (like uart)?

What is needed to get this in tree? Testing on Apple hardware was mentioned. What should be tested?

@tuexen this needs revisited to clean up a bit. As @nwhitehorn mentioned, it looks a little strange in how it attaches, so I need to rethink it. Right now the patch exists to help those who have a Talos or Blackbird and want to boot from serial, but output to the onboard VGA/HDMI.

sys/dev/vt/hw/ofwfb/ofwfb.c
522

Newbus should always have a node if the hardware is there... console or not is something else and should have no influence on this choice.

@jhibbits Thanks for the explanation. I'm using it on a blackbird. I have also a G5 Powermac in my lab, so if there is a need for testing, just let me know. I would like to run an unmodified version of FreeBSD just to make sure I don't commit anything by accident...

Justin, I tested this patch on Blackbird and it looks good, just need to be rebased to latest main. Also tested it along with D30626.

I didn't check how does it interact with loader.conf(5) "console" parameter: should it suppress the attachment if user explicitly sets console=comconsole? ; Should it attach only if user explicitly sets console="comconsole,vidconsole" or console="vidconsole" and the /chosen device is the serial?