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.

Looking for hackers with the skills:

graphics drivers kernel drm grub2

This project is part of:

Hack Week 24

Activity

  • 14 days ago: Pharaoh_Atem liked this project.
  • about 1 month ago: tdz added keyword "graphics" to this project.
  • about 1 month ago: tdz added keyword "drivers" to this project.
  • about 1 month ago: tdz added keyword "kernel" to this project.
  • about 1 month ago: tdz added keyword "drm" to this project.
  • about 1 month ago: tdz added keyword "grub2" to this project.
  • about 1 month ago: michals liked this project.
  • about 1 month ago: llansky3 liked this project.
  • about 1 month ago: tdz liked this project.
  • about 1 month ago: tdz started this project.
  • about 1 month ago: tdz originated this project.

  • Comments

    • tdz
      about 1 month ago by tdz | Reply

      Day 1: I forked of simpledrm into a new vesadrm driver. This immediately works well on non-EFI PC hardware. I further added support for EDID information. This data has to be provided by the boot loader. There's already a field in Linux's boot parameters. It is not set by grub. So a patch there seems required.

      See: https://gitlab.suse.de/tzimmermann/linux/-/commits/vesadrm-day1

    • tdz
      about 1 month ago by tdz | Reply

      Day 2: With vesadrm in place and the EDID property attached, it was time to fill it with data. As mentioned, there's already such a field in the kernel's boot params on x86. It has never been used; or at least i could not find any related code in grub2, grub(-legacy) or even LiLo.

      But grub2 already reads out the EDID for its graphics backends. And all we have to do is to copy is to the Linux boot parameters. We cannot transfer EDID extension headers, so we have to clear the extension field. Still, the result is EDID data for the firmware drivers. A patch for grub2 is on OBS at https://build.opensuse.org/package/show/home:tdz:branches:Base:System/grub2.

      Here's a screenshot of my test system's GNOME, where it correctly names the monitor from the provided data.

      This was on Wayland. I also have a patch pending for Xorg, so that it accepts vesadrm as driver.

      Overall, this project is going nicely and I'm very happy with the progress being made.

      See: https://gitlab.suse.de/tzimmermann/linux/-/commits/vesadrm-day2

    • tdz
      30 days ago by tdz | Reply

      Day 3: EDID support in vesadrm works well the patched grub2. So today I worked on support for color LUTs. On VGA hardware, it is possible to write the VGA color LUT behind the back of the VESA interface. VESA even tells us if it runs on VGA-compatible hardware. Linux' existing vesafb driver contains example code to do this. If set up, pixels in framebuffer memory will be look into the VGA color LUT during scanout to produce the actual output color.

      With this in place, vesadrm now sets up a gamma-LUT property for userspace. Compositors can load gamma tables into the property and vesadrm programs them to VGA. Combined with the EDID data, this enables simple SDR color management. GNOME also implements 'night mode' via gamma luts. When I tested, this now works nicely with vesadrm.

      See: https://gitlab.suse.de/tzimmermann/linux/-/commits/vesadrm-day3

    • tdz
      29 days ago by tdz | Reply

      Day 4: The gamma LUT also serves as the color look-up table for color-index modes. Getting DRM format C8 done was the topic of day 4. C8 is a palette mode with 8 bits per pixel. The value is the index into the color LUT. The LUT itself is again in the VGA hardware. C8 is supported by fbcon, so I could wire-up everything directly. When grub programs the mode and runs the kernel, vesadrm now displayes the console correctly. Before day 4, vesadrm would have simply refused to probe.

      Compositors don't support C8 (X11 window managers did in the early 90s, but that likely don't count today.) Instead they want XRGB8888. Vesadrm also emulates this via the color LUT. The compositor's framebuffer is in XRGB8888 format, which vesadrm transforms to RGB332 during screen updates. RGB332 is 3 bits of red, 3 bits of green and 2 bits of blue; all packed into a single byte. With the hardware programmed to C8, that byte is the index into the color LUT, which vesadrm programs to RGB666 values that VGA requires. This process is called dithering and transforms the compositor's 24-bit RGB output into an 256-color output on the display.

      A photo of the output of my test system is here. This is Firefox on GNOME ruining at 800x600 with 256 colors. While not exactly pretty, it is fast and usable. The desktop UI elements are fairly close to their expected colors. Graphics with higher fidelity, such as the picture on that opened website, show significant distortion.

      See: https://gitlab.suse.de/tzimmermann/linux/-/commits/vesadrm-day4

    • tdz
      29 days ago by tdz | Reply

      Summary: I'm really happy how this project turned out. With some polish, everything up-to-and-including day 3 has the potential to go upstream as new driver. That would give a vesadrm driver similar to simpledrm, but with EDID and color management. Support for color-index modes could be added later. There, it would make sense to add additional modes, such as C4, C2, and C1. A bit more work would be required in the DRM framework work support that. Not only would that enable support for really low-end PC hardware, but it would also give an easily available (via qemu) testbed for these low-end features. Some of them are required by today's LCD display, which can be hard to obtain.

      For a possible efidrm, it would be a fork of vesadrm up-to-and-including day 2. That is simpledrm plus EDID support. Seems simple enough. AFAICT grub can also provide EDID data from EFI on x86. On non-x86, the kernel would have to fetch it by itself from the EFI firmware.

      • Pharaoh_Atem
        14 days ago by Pharaoh_Atem | Reply

        This is awesome! Do you know when you'll submit it to be included upstream?

    Similar Projects

    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 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


    Officially Become a Kernel Hacker! by m.crivellari

    Description

    My studies as well my spare time are dedicated to the Linux Kernel. Currently I'm focusing on interrupts on x86_64, but my interests are not restricted to one specific topic, for now.

    I also "played" a little bit with kernel modules (ie lantern, a toy packet analyzer) and I've added a new syscall in order read from a task A, the memory of a task B.

    Maybe this will be a good chance to...

    Goals

    • create my first kernel patch

    Resources

    Achivements


    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


    Modularization and Modernization of cifs.ko for Enhanced SMB Protocol Support by hcarvalho

    Creator:
    Enzo Matsumiya ematsumiya@suse.de @ SUSE Samba team
    Members:
    Henrique Carvalho henrique.carvalho@suse.com @ SUSE Samba team

    Description

    Split cifs.ko in 2 separate modules; one for SMB 1.0 and 2.0.x, and another for SMB 2.1, 3.0, and 3.1.1.

    Goals

    Primary

    Start phasing out/deprecation of older SMB versions

    Secondary

    • Clean up of the code (with focus on the newer versions)
    • Update cifs-utils
    • Update documentation
    • Improve backport workflow (see below)

    Technical details

    Ideas for the implementation.

    • fs/smb/client/{old,new}.c to generate the respective modules
      • Maybe don't create separate folders? (re-evaluate as things progresses!)
    • Remove server->{ops,vals} if possible
    • Clean up fs_context.* -- merge duplicate options into one, handle them in userspace utils
    • Reduce code in smb2pdu.c -- tons of functions with very similar init/setup -> send/recv -> handle/free flow
    • Restructure multichannel
      • Treat initial connection as "channel 0" regardless of multichannel enabled/negotiated status, proceed with extra channels accordingly
      • Extra channel just point to "channel 0" as the primary server, no need to allocate an extra TCPServerInfo for each one
    • Authentication mechanisms
      • Modernize algorithms (references: himmelblau, IAKERB/Local KDC, SCRAM, oauth2 (Azure), etc.


    Improve UML page fault handler by ptesarik

    Description

    Improve UML handling of segmentation faults in kernel mode. Although such page faults are generally caused by a kernel bug, it is annoying if they cause an infinite loop, or panic the kernel. More importantly, a robust implementation allows to write KUnit tests for various guard pages, preventing potential kernel self-protection regressions.

    Goals

    Convert the UML page fault handler to use oops_* helpers, go through a few review rounds and finally get my patch series merged in 6.14.

    Resources

    Wrong initial attempt: https://lore.kernel.org/lkml/20231215121431.680-1-petrtesarik@huaweicloud.com/T/


    FizzBuzz OS by mssola

    Project Description

    FizzBuzz OS (or just fbos) is an idea I've had in order to better grasp the fundamentals of the low level of a RISC-V machine. In practice, I'd like to build a small Operating System kernel that is able to launch three processes: one that simply prints "Fizz", another that prints "Buzz", and the third which prints "FizzBuzz". These processes are unaware of each other and it's up to the kernel to schedule them by using the timer interrupts as given on openSBI (fizz on % 3 seconds, buzz on % 5 seconds, and fizzbuzz on % 15 seconds).

    This kernel provides just one system call, write, which allows any program to pass the string to be written into stdout.

    This project is free software and you can find it here.

    Goal for this Hackweek

    • Better understand the RISC-V SBI interface.
    • Better understand RISC-V in privileged mode.
    • Have fun.

    Resources

    Results

    The project was a resounding success add-emoji Lots of learning, and the initial target was met.


    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