Page MenuHomeFreeBSD

Add a simple-framebuffer vt driver
ClosedPublic

Authored by andrew on May 4 2021, 4:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 4:44 AM
Unknown Object (File)
Tue, Mar 19, 5:05 PM
Unknown Object (File)
Tue, Mar 19, 5:05 PM
Unknown Object (File)
Dec 20 2023, 5:43 AM
Unknown Object (File)
Dec 11 2023, 6:13 AM
Unknown Object (File)
Nov 29 2023, 10:18 AM
Unknown Object (File)
Oct 4 2023, 8:37 AM
Unknown Object (File)
Sep 5 2023, 10:23 PM

Details

Summary

This allows us to support this hardware and, in the future, use clocks
so they are enabled past the initial kernel boot process.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew requested review of this revision.May 4 2021, 4:41 PM

I don't think it make much sense to commit that without all formats supported and clocks, efifb should be good enough instead. (and yes I know that it's not on the mac blah that you're working on :P )

sys/dev/vt/hw/simplefb/simplefb.c
91

I can easily add more formats, although can't test the clocks as I don't have hardware that has the clocks property.

sys/dev/vt/hw/simplefb/simplefb.c
6

@emaste Can I drop this? It's in all the vt drivers where the Foundation has a copyright statement.

91

Most of them are missing from the bindings. This seems to be a full list of the currently supported formats: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/platform_data/simplefb.h?id=d665ea6ea86c785760ee4bad4543dab3267ad074#n16

I can easily add the other formats. It looks like a8r8g8b8, r5g6b5, and r8g8b8 are used in the in-tree dts files. Many of the simple-framebuffer nodes lack a format so I guess the firmware fills this property in.

I can easily add more formats, although can't test the clocks as I don't have hardware that has the clocks property.

I'll handle the clock part if you want but it's something like
clk_t clk;
int err;
for (int idx = 0; ; idx++) {
err = clk_get_by_ofw_index(dev, 0, idx, &clk);
if (err == 0)

clk_enable(clk);

else

break;

}

sys/dev/vt/hw/simplefb/simplefb.c
91

I'll boot a few board this weekend to check if there is other format added by bootloader.

We don't have a device_t to use this early so would need to create a driver to attach to the same node later in the boot. One of the problems is it's a child of /chosen so doesn't get probed. For testing I created a chosen driver we could use that attaches to the chosen node and adds any children it finds.

andrew retitled this revision from Add an simple-framebuffer vt driver to Add a simple-framebuffer vt driver.May 5 2021, 8:58 AM

Add more formats found in local dts files

We don't have a device_t to use this early so would need to create a driver to attach to the same node later in the boot. One of the problems is it's a child of /chosen so doesn't get probed. For testing I created a chosen driver we could use that attaches to the chosen node and adds any children it finds.

Mhm right, I'll have to think about how to do this properly ...

sys/dev/vt/hw/simplefb/simplefb.c
6

Yes all FreeBSD Foundation copyrights can have All rights reserved. removed. I did a pass over the tree before but did not get everything.

125

Hrm, this is what we're using everywhere I suppose :(

kevans added inline comments.
sys/dev/vt/hw/simplefb/simplefb.c
87

I think, if I understand the notation correctly?

  • Drop "all rights reserved", as per emaste 2021/01/05
  • Correct red offset
ray added a subscriber: ray.

Looks good to me.
Thanks!

sys/dev/vt/hw/simplefb/simplefb.c
87

Yes. All I saw defined from higher to lower. So "b5" is lower 5 bits.

This revision is now accepted and ready to land.Mar 5 2023, 10:39 AM
sys/dev/vt/hw/simplefb/simplefb.c
8–9

You could change this to "Portions of this software were..."

This revision was automatically updated to reflect the committed changes.