This project could get us rid of the last fbdev drivers we're stil shipping: efifb and vesafb.
Platform drivers handle hardware that is not auto-detected, but somehow there. For graphics this would be VGA, VESA, or UEFI framebuffers. In SUSE Linux, we currently support VESA and UEFI with fbdev drivers. Those load early in the boot process and maintain graphics hardware until the actual driver takes over.
It would be nice to support VESA and UEFI with modern DRM drivers. Doing so would give us basic support for very old, very modern or very obscure graphics hardware. This in itself is not complicated. The problem is the handover to the actual HW driver. For the old fbdev, there's a mechanism for the HW driver to disable the platform driver. Not such thing exists for DRM. Implementing this mechanism would be the main goal of the project.
This project is part of:
Hack Week 19
Activity
Comments
-
almost 5 years ago by vliaskovitis | Reply
Interested though I only have limited kms experience (I have tested vkms/vgem, igt tools, and written a small vkms-like module in the past). Are the proposed drm drivers supposed to follow the fbdev->drm conversion from the fbconv helpers work https://gitlab.freedesktop.org/tzimmermann/linux/commits/fbconv , or are they meant to be from-scratch drm drivers? No idea about the handover mechanism though. If this is something that could be done and tested with VMs or a standard desktop without specific gfx cards (i assume so as vesafb is generic), and there are separable tasks that you don't plan on hacking, let me know.
-
almost 5 years ago by tdz | Reply
Hi!
I started working on this idea today.
The drivers are written from scratch. (1) The fbdev drivers are just trivial framebuffers that the screen image is being copied into. At least efifb cannot even do modesetting. It uses the display mode that has been set by the UEFI BIOS.
The hand-over mechanism is similar to how fbdev does it. The platform driver claims a piece of I/O memory, and once the actual driver wants to take the memory range, it kicks out the platform driver.
I was a bit optimistic about the number of fbdev drivers. There are 2 or 3 others besides efifb and vesafb. Yet, those would be a significant step forward.
I don't know about testing in VMs. If the current kernel's efifb works in the VM, the new driver should work as well.
Best regards Thomas
(1) It's nice that you recognized my work on fbconv. :)
-
-
almost 5 years ago by tdz | Reply
Day 2: Reviewing efifb and vesafb shows that these drivers don't actually do any modesetting or even call much of their respective interfaces. They only pick up a preconfigured framebuffer. Therefore I'm changing goal slightly. Instead of recreating these drivers for DRM, I'm porting over simplefb. It also picks up a preconfigured framebuffer, but it's entirely agnostic to the platform and works with firmware, bootloader or device tree. It even support EFI and VESA. AFAICT all the setup is done by the platform and the kernel's boot code. Just as simplefb, the new DRM driver would take these settings and make them available within the graphics framework.
-
almost 5 years ago by tdz | Reply
Day 3: After two days of tinkering with the platform setup code, I typed down the driver today. The kernel fetches the framebuffer from GRUB and provides it as framebuffer device. My driver picks up the device and provides it via DRM. So far, the fbdev console emulation works and I was able to get GDM partially working. Apparently, X11 wants a PCI ID, which the device doesn't have. But there's probably a way around this limitation. All in all, this looks really good so far.
-
almost 5 years ago by tdz | Reply
Day 4: I spent the day on cleaning up what I have and implementing the hand-over code. The hand-over is slightly tricky, as it requires to remove the DRM device while it's being used by the platform driver. And it's concurrent code that requires some locking. It's partially working ATM.
-
almost 5 years ago by tdz | Reply
Day 5: Today I finished the hand-over code. My test system is equipped with a Radeon graphics card. The bootloader, grub, configures a display mode before running the kernel. The built-in simplekms takes over early in the boot process and displays typical boot message. Once the radeon driver is ready, it kicks simplekms out and takes over the framebuffer. The hand-over is generic, so arbitrary drivers can kickout any platform driver.
If there's no native DRM driver for the hardware, simplekms remains active and provides a basic framebuffer for Wayland compositors or the framebuffer console. I did not get native X11 running, as X11 requested a PCI device. I did not look further into this problem. However, Gnome runs fine in Wayland mode and X applications can be started via Xwayland.
Yeah, I think this was a successful hackweek and the project is complete for now. After a bit more polishing, the driver could go upstream.
Similar Projects
Kill DMA and DMA32 memory zones by ptesarik
Description
Provide a better allocator for DMA-capable buffers, making the DMA and DMA32 zones obsolete.
Goals
Make a PoC kernel which can boot a x86 VM and a Raspberry Pi (because early RPi4 boards have some of the weirdest DMA constraints).
Resources
- LPC2024 talk:
- video:
Modernize ocfs2 by goldwynr
Ocfs2 has gone into a stage of neglect and disrepair. Modernize the code to generate enough interest.
Goals: * Change the mount sequence to use fscontext * Move from using bufferhead to bio/folios * Use iomap * Run it through xfstests
Improve various phones kernel mainline support (Qualcomm, Exynos, MediaTek) by pvorel
Similar to previous hackweeks ( https://hackweek.opensuse.org/projects/improve-qualcomm-soc-msm8994-slash-msm8992-kernel-mainline-support, https://hackweek.opensuse.org/projects/test-mainline-kernel-on-an-older-qualcomm-soc-msm89xx-explore-mainline-kernel-qualcomm-mainlining) try to improve kernel mainline support of various phones.
Model checking the BPF verifier by shunghsiyu
Project Description
BPF verifier plays a crucial role in securing the system (though less so now that unprivileged BPF is disabled by default in both upstream and SLES), and bugs in the verifier has lead to privilege escalation vulnerabilities in the past (e.g. CVE-2021-3490).
One way to check whether the verifer has bugs to use model checking (a formal verification technique), in other words, build a abstract model of how the verifier operates, and then see if certain condition can occur (e.g. incorrect calculation during value tracking of registers) by giving both the model and condition to a solver.
For the solver I will be using the Z3 SMT solver to do the checking since it provide a Python binding that's relatively easy to use.
Goal for this Hackweek
Learn how to use the Z3 Python binding (i.e. Z3Py) to build a model of (part of) the BPF verifier, probably the part that's related to value tracking using tristate numbers (aka tnum), and then check that the algorithm work as intended.
Resources
- Formal Methods for the Informal Engineer: Tutorial #1 - The Z3 Theorem Prover and its accompanying notebook is a great introduction into Z3
- Has a section specifically on model checking
- Software Verification and Analysis Using Z3 a great example of using Z3 for model checking
- Sound, Precise, and Fast Abstract Interpretation with Tristate Numbers - existing work that use formal verification to prove that the multiplication helper used for value tracking work as intended
- [PATCH v5 net-next 00/12] bpf: rewrite value tracking in verifier - initial patch set that adds tristate number to the verifier
Create DRM drivers for VESA and EFI framebuffers by tdz
Description
We already have simpledrm for firmware framebuffers. But the driver is originally for ARM boards, not PCs. It is already overloaded with code to support both use cases. At the same time it is missing possible features for VESA and EFI, such as palette modes or EDID support. We should have DRM drivers for VESA and EFI interfaces. The infrastructure exists already and initial drivers can be forked from simpledrm.
Goals
- Initially, a bare driver for VESA or EFI should be created. It can take functionality from simpledrm.
- Then we can begin to add additional features. The boot loader can provide EDID data. With VGA hardware, VESA can support paletted modes or color management. Example code exists in vesafb.
Create DRM drivers for VESA and EFI framebuffers by tdz
Description
We already have simpledrm for firmware framebuffers. But the driver is originally for ARM boards, not PCs. It is already overloaded with code to support both use cases. At the same time it is missing possible features for VESA and EFI, such as palette modes or EDID support. We should have DRM drivers for VESA and EFI interfaces. The infrastructure exists already and initial drivers can be forked from simpledrm.
Goals
- Initially, a bare driver for VESA or EFI should be created. It can take functionality from simpledrm.
- Then we can begin to add additional features. The boot loader can provide EDID data. With VGA hardware, VESA can support paletted modes or color management. Example code exists in vesafb.
Create a DRM driver for VGA video cards by tdz
Yes, those VGA video cards. The goal of this project is to implement a DRM graphics driver for such devices. While actual hardware is hard to obtain or even run today, qemu emulates VGA output.
VGA has a number of limitations, which make this project interesting.
- There are only 640x480 pixels (or less) on the screen. That resolution is also a soft lower limit imposed by DRM. It's mostly a problem for desktop environments though.
- Desktop environments assume 16 million colors, but there are only 16 colors with VGA. VGA's 256 color palette is not available at 640x480. We can choose those 16 colors freely. The interesting part is how to choose them. We have to build a palette for the displayed frame and map each color to one of the palette's 16 entries. This is called dithering, and VGA's limitations are a good opportunity to learn about dithering algorithms.
- VGA has an interesting memory layout. Most graphics devices use linear framebuffers, which store the pixels byte by byte. VGA uses 4 bitplanes instead. Plane 0 holds all bits 0 of all pixels. Plane 1 holds all bits 1 of all pixels, and so on.
The driver will probably not be useful to many people. But, if finished, it can serve as test environment for low-level hardware. There's some interest in supporting old Amiga and Atari framebuffers in DRM. Those systems have similar limitations as VGA, but are harder to obtain and test with. With qemu, the VGA driver could fill this gap.
Apart from the Wikipedia entry, good resources on VGA are at osdev.net and FreeVGA
Finish gfxprim application multiplexor (window manager) by metan
Project Description
I've implemented drivers for a few e-ink displays during the last hackweek and made sure that gfxprim widgets run nicely on e-ink as well. The missing piece to have a portable e-ink computer/reader/music player/... is a application that can switch between currently running applications and that can start new applications as well. Half of the solution is ready, there is a proxy gfxprim backend where applications render into a piece of a shared memory and input events (e.g. keyboard, mouse) can be multiplexed. What is missing is an interface (possibly touchscreen friendly as well) to make it user friendly.
Goal for this Hackweek
Make nekowm usable "window manager".
Resources
Create a DRM driver for VGA video cards by tdz
Yes, those VGA video cards. The goal of this project is to implement a DRM graphics driver for such devices. While actual hardware is hard to obtain or even run today, qemu emulates VGA output.
VGA has a number of limitations, which make this project interesting.
- There are only 640x480 pixels (or less) on the screen. That resolution is also a soft lower limit imposed by DRM. It's mostly a problem for desktop environments though.
- Desktop environments assume 16 million colors, but there are only 16 colors with VGA. VGA's 256 color palette is not available at 640x480. We can choose those 16 colors freely. The interesting part is how to choose them. We have to build a palette for the displayed frame and map each color to one of the palette's 16 entries. This is called dithering, and VGA's limitations are a good opportunity to learn about dithering algorithms.
- VGA has an interesting memory layout. Most graphics devices use linear framebuffers, which store the pixels byte by byte. VGA uses 4 bitplanes instead. Plane 0 holds all bits 0 of all pixels. Plane 1 holds all bits 1 of all pixels, and so on.
The driver will probably not be useful to many people. But, if finished, it can serve as test environment for low-level hardware. There's some interest in supporting old Amiga and Atari framebuffers in DRM. Those systems have similar limitations as VGA, but are harder to obtain and test with. With qemu, the VGA driver could fill this gap.
Apart from the Wikipedia entry, good resources on VGA are at osdev.net and FreeVGA
New openSUSE-welcome by lkocman
Project Description
Let's revisit our existing openSUSE welcome app.
My goal was to show Leap 16 in a new coat. Welcome app adds to the first time use experience. We've recently added donation button to our existing welcome.
Some things that I recently wanted to address were EOL and possibly upgrade notification.
I've already done some experiments with mint welcome app, but not sure if it's better than the existing one.
There is also a PR to rework existing app https://github.com/openSUSE/openSUSE-welcome/pull/36 (this should be considered as an option too)
Goal for this Hackweek
New welcome app, possibly with EOL notification for Leap.
1) Welcome application(s) with (rebrand changes) maintained under github.com/openSUSE
2) Application is submitted to openSUSE:Factory && openSUSE:Leap:16.0
3) Updated needles in openQA (probably post hackweek)
Resources
Reddit discussion about the best welcome app out there.
Github repo for the current welcome app.
Create DRM drivers for VESA and EFI framebuffers by tdz
Description
We already have simpledrm for firmware framebuffers. But the driver is originally for ARM boards, not PCs. It is already overloaded with code to support both use cases. At the same time it is missing possible features for VESA and EFI, such as palette modes or EDID support. We should have DRM drivers for VESA and EFI interfaces. The infrastructure exists already and initial drivers can be forked from simpledrm.
Goals
- Initially, a bare driver for VESA or EFI should be created. It can take functionality from simpledrm.
- Then we can begin to add additional features. The boot loader can provide EDID data. With VGA hardware, VESA can support paletted modes or color management. Example code exists in vesafb.