Skip to content

Move Linux frame buffer support to base system#342

Open
wulf7 wants to merge 27 commits into
freebsd:masterfrom
wulf7:linux-fb
Open

Move Linux frame buffer support to base system#342
wulf7 wants to merge 27 commits into
freebsd:masterfrom
wulf7:linux-fb

Conversation

@wulf7
Copy link
Copy Markdown
Contributor

@wulf7 wulf7 commented Feb 21, 2025

On Linux, framebuffer code is not a part of drm and can be used with non-drm drivers.
The aim is to move linux_fb.c vt_drmfb.c to linuxkpi_video module and import to base system after than.
The changes clashes with ongoing drm-kmod 6.xx import doing by @dumbbell. That should be resolved in future.
Still WIP

@wulf7 wulf7 requested review from dumbbell and evadot February 21, 2025 10:09
@emaste
Copy link
Copy Markdown
Member

emaste commented Mar 12, 2025

The aim is to move linux_fb.c vt_drmfb.c to linuxkpi_video module and import to base system after than.

Would be good to also indicate why they should be in the base system

@wulf7
Copy link
Copy Markdown
Contributor Author

wulf7 commented Mar 13, 2025

We a going to make drm.ko to be a part of base system

@Conan-Kudo
Copy link
Copy Markdown

On Linux, framebuffer code is not a part of drm and can be used with non-drm drivers.

This isn't completely true anymore, now that SimpleDRM is a thing and distros have largely replaced the traditional framebuffer with the DRM backed one.

wulf7 added 23 commits May 28, 2026 23:09
Generic framebufer driver is a lower layer than drm framebufer.
It should not depend on later.
The only usage of passing `struct drm_fb_helper` to vt_drmfb was using
it as a container of reference to parent BSD device.
Pass device directly from drm to vt_drmfb to not depend on drm.

Sponsored by:	Future Crew LLC
as vt_drmfb is the only user of skip_ddb. Keep skip_ddb sysctl
declarations in drm as they are children of drm sysctl nodes.

Sponsored by:	Future Crew LLC
support code to consolidate it in one place. This done with adding of
FreeBSD-specific fields to drm_driver structure to pass aperture
parametrs from drm drivers to framebufer support code.

Also remove struct apertures_struct from fb_info to follow upstream.

Sponsored by:	Future Crew LLC
Remove references to now unused headers, functions and kernel modules.

Sponsored by:	Future Crew LLC
and move them to BSD-licensed linux/fb.h

Sponsored by:	Future Crew LLC
While here move cfb_ declarations to BSD linux/fb.h too and
remove extraneous extern keywords.

Sponsored by:	Future Crew LLC
They do not depend on drm internals.
Add -DDEVELOPER to make options to compile linux_video.ko
Rename it to linuxkpi_skip_ddb as it is public symbol now.
This structure is used only in LKPI so no reasons to convert members
to native types.
system fbd can be enabled with setting of loader tunable
kern.vt.disable_drmfb to 1
instead rolling of own copies. They are almost identical. The only
difference is extra postswitch call in init method of vt_fb.
@wulf7 wulf7 force-pushed the linux-fb branch 2 times, most recently from 2d7a346 to 929169d Compare June 2, 2026 16:42
@wulf7 wulf7 changed the title WIP: move Linux frame buffer support to base system Move Linux frame buffer support to base system Jun 6, 2026
@wulf7
Copy link
Copy Markdown
Contributor Author

wulf7 commented Jun 6, 2026

The MR is submitted to review: https://reviews.freebsd.org/D57488

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants