Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: move Linux frame buffer support to base system #342

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

wulf7
Copy link
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 and others added 13 commits February 21, 2025 10:58
It should be drawn with background rather than foreground color.

Sponsored by:	Future Crew LLC
used by color splash screens.

Sponsored by:	Future Crew LLC
In that case vt_drmfb_bitblt_bitmap truncates bitmap width to not cross
the border and passes truncated width to cfb_imageblit that results into
calculation of wrong line offsets in source bitmap. To see that move
mouse pointer to right display edge and slightly touch it.

To fix the issue pass both original and truncated width to cfb_imageblit
and use former to calculate line offsets and latter to limit width of
picture.

Sponsored by:	Future Crew LLC
With replacement of muls and divs with adds and shifts

Sponsored by:	Future Crew LLC
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
drm_device destructor is called when pci_device reference count becomes
zero. pci_device destructor is called when drm_device reference count
becomes zero. As both of them decreases respective counters, noone can
reach zero and run destructor that results in armed amdgpu timers after
kldunload of amdgpu.ko with following panic.
To workaround the panic do not take extra reference in drm codeto break
circular dependency. This allows amdgpu.ko to be kldunloaded without
system crash.

Sponsored by:	Future Crew LLC
Sponsored by:	Future Crew LLC
@wulf7 wulf7 requested review from dumbbell and evadot February 21, 2025 10:09
@emaste
Copy link
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
Contributor Author

wulf7 commented Mar 13, 2025

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

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.

None yet

2 participants