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)
Sun, Nov 17, 12:02 PM
Unknown Object (File)
Tue, Nov 12, 4:50 AM
Unknown Object (File)
Sat, Nov 9, 5:43 PM
Unknown Object (File)
Wed, Oct 23, 11:15 AM
Unknown Object (File)
Wed, Oct 23, 8:46 AM
Unknown Object (File)
Oct 14 2024, 8:39 PM
Unknown Object (File)
Oct 14 2024, 8:07 PM
Unknown Object (File)
Sep 5 2024, 2:53 AM

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.