rpi(4): sdl2 kms/drm compilation (no X)

If you followed my previous post about enabling the vc4-kms driver without X, you may also want to build SDL2 with kms/drm support. This directions were made for the rpi4, but it should work on the rpi3 too…


sudo apt install -y build-essential git libasound2-dev libsamplerate0-dev libibus-1.0-dev libdbus-1-dev libudev-dev libgles2-mesa-dev libdrm-dev libgbm-dev
git clone https://github.com/spurious/SDL-mirror.git
cd SDL-mirror
CFLAGS='-mfpu=neon -mtune=cortex-a72 -march=armv8-a' ./configure --prefix=/usr --disable-video-x11 --disable-video-wayland --disable-video-rpi --enable-video-kmsdrm --enable-arm-neon
make -j4
sudo make install

Now we can see if all is working by compiling the test programs:

cd test
./configure
make -j4

And see what happen!

cpasjuste@raspberrypi:~/dev/SDL-mirror/test $ ./testdisplayinfo 
INFO: Using video target 'KMSDRM'.
INFO: See 1 displays.
INFO: 0: "0" (1920x1080, (0, 0)), 17 modes.
INFO:     DPI: ddpi=95.372787; hdpi=95.623528; vdpi=94.593102
INFO: CURRENT: fmt=SDL_PIXELFORMAT_ARGB8888 w=1920 h=1080 refresh=60
INFO: DESKTOP: fmt=SDL_PIXELFORMAT_ARGB8888 w=1920 h=1080 refresh=60
INFO:     MODE 0: fmt=SDL_PIXELFORMAT_ARGB8888 w=1920 h=1080 refresh=60
INFO:     MODE 1: fmt=SDL_PIXELFORMAT_ARGB8888 w=1920 h=1080 refresh=50
INFO:     MODE 2: fmt=SDL_PIXELFORMAT_ARGB8888 w=1600 h=900 refresh=60
INFO:     MODE 3: fmt=SDL_PIXELFORMAT_ARGB8888 w=1280 h=1024 refresh=75
INFO:     MODE 4: fmt=SDL_PIXELFORMAT_ARGB8888 w=1280 h=1024 refresh=60
INFO:     MODE 5: fmt=SDL_PIXELFORMAT_ARGB8888 w=1280 h=720 refresh=60
INFO:     MODE 6: fmt=SDL_PIXELFORMAT_ARGB8888 w=1280 h=720 refresh=50
INFO:     MODE 7: fmt=SDL_PIXELFORMAT_ARGB8888 w=1152 h=864 refresh=75
INFO:     MODE 8: fmt=SDL_PIXELFORMAT_ARGB8888 w=1024 h=768 refresh=75
INFO:     MODE 9: fmt=SDL_PIXELFORMAT_ARGB8888 w=1024 h=768 refresh=60
INFO:     MODE 10: fmt=SDL_PIXELFORMAT_ARGB8888 w=800 h=600 refresh=75
INFO:     MODE 11: fmt=SDL_PIXELFORMAT_ARGB8888 w=800 h=600 refresh=60
INFO:     MODE 12: fmt=SDL_PIXELFORMAT_ARGB8888 w=720 h=576 refresh=50
INFO:     MODE 13: fmt=SDL_PIXELFORMAT_ARGB8888 w=720 h=480 refresh=60
INFO:     MODE 14: fmt=SDL_PIXELFORMAT_ARGB8888 w=720 h=400 refresh=70
INFO:     MODE 15: fmt=SDL_PIXELFORMAT_ARGB8888 w=640 h=480 refresh=75
INFO:     MODE 16: fmt=SDL_PIXELFORMAT_ARGB8888 w=640 h=480 refresh=60

Be the first to comment

Leave a Reply

Your email address will not be published.


*