Skip to content

Commit

Permalink
Merge pull request #953 from zoltanvb/rpi_guide_update
Browse files Browse the repository at this point in the history
Minor additions to RPi and KMS.
  • Loading branch information
fpscan authored Jun 23, 2024
2 parents 629f0ed + 07f09e1 commit 79e73c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions docs/guides/kms-mode.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
## Purpose
KMS (Kernel Mode Setting) mode is a feature where RetroArch can use the OpenGL driver outside Xorg, running straight in the virtual terminal. It is a fairly obscure feature, but very powerful in a console scenario.
KMS (Kernel Mode Setting) mode is a feature where RetroArch can use the OpenGL or Vulkan driver outside Xorg/Wayland, running straight in the virtual terminal. It is a fairly obscure feature, but very powerful in a console scenario.

## Requirements
To use KMS mode you need:

- Recent version of MESA (9.0+) (dev)
- libgbm 9.0+, libdrm (dev)
- MESA version 9.0+ (including dev package)
- Use of Vulkan requires KHR_Display extension, present from Mesa 21 onwards
- libgbm 9.0+, libdrm (including dev package)
- Open source driver which supports KMS
- ./configure with flags "--enable-kms" and "--enable-egl"

These require a fairly up-to-date distro.

After compiling RetroArch, you should see this when running `retroarch --features`:

KMS:
KMS/EGL context support: yes

If KMS mode is working correctly, RetroArch should start up outside Xorg as well.
If KMS mode is working correctly, RetroArch should start up without any desktop environment as well, straight from the terminal.
5 changes: 3 additions & 2 deletions docs/guides/rpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ For Pi 4 to enable 4K 60 Hz refresh, a line is needed in `config.txt`:
Initially, RPi's VideoCore IV GPU (used for models earlier than RPi 4) was supported through vendor-specific Broadcom OpenGL/EGL libraries. This library is linked when `--enable-videocore` option is specified for `./configure`.
To compile RetroArch with legacy drivers, specify the `--enable-videcore` option instead of `--disable-videocore` above. Note that this library is only available for 32-bit systems. The binaries must be present in `/opt/vc` for compilation to work. Legacy drivers (or "userland") may be installed as `libraspberrypi-dev` package, or retrieved from https://github.com/raspberrypi/userland, and installed as:

sudo apt install cmake
git clone https://github.com/raspberrypi/userland.git
cd userland/
./buildme /

To start RetroArch built this way, system must be switched to "Legacy GL" driver using `raspi-config`.
To start RetroArch built this way, system must be switched to "Legacy GL" driver using `raspi-config`. This is not possible starting from Debian 12 Bookworm, so make sure you are running an older distribution.
In addition to this, RetroArch has a specific `dispmanx` video driver that utilizes the vendor-specific API instead of OpenGL. This video driver can be enabled with `--enable-dispmanx`, however it has only limited functionalities, in particular only RGUI is supported, and there are no widgets/overlays. As a corner case, dispmanx driver works in fake KMS mode.
Neither dispmanx driver nor legacy GL drivers work with RetroArch in KMS mode.
Neither dispmanx driver nor legacy GL drivers work with RetroArch in KMS mode. If you run into problems with compilation, try adding the userland to package-cfg by issuing `export PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/` before running `./configure`.

## Checking OpenGL details

Expand Down

0 comments on commit 79e73c6

Please sign in to comment.