Description
What MCU/Processor/Board and compiler are you using?
- Processor: Allwinner V3s on a LicheePi Zero at the moment (soon to be custom hardware)
- Compiler: Buildroot 2024.02.3 to compile a very lean version of Linux 6.6.0. Compiling lv_port_linux with either GCC (for local testing) or cross-compile for the V3s (arm-linux-gnueabihf-gcc)
- LVGL v9.2.0
What do you want to achieve?
I have been able to successfully get LVGL to run using “legacy” framebuffer (that’s how it’s listed in the Linux menuconfig!), as well as “evdev” (two lines, poof the touchscreen works perfectly!) Getting 30fps (seems to be a hard limit there for some reason…haven’t dug into why), with very decent performance on an 800x480 LCD panel. I can’t complain here!
However, I would like to be able to compile LVGL to use both DRM (video) and LIBINPUT (touch) as they are not “legacy” Linux device access methods. It’s kinda difficult to justify using “legacy” functionality on “new” systems!
What have you tried so far?
Tried compiling with DRM
Switched the “lv_conf.h” enables:
#define LV_USE_LINUX_FBDEV 0
#define LV_USE_LINUX_DRM 1
Compiling provides the classic error:
.../lv_linux_drm.c:21:10: fatal error: xf86drm.h: No such file or directory
Installed “libdrm-dev”, and recompiled. Then got this error:
xf86drm.h:40:10: fatal error: drm.h: No such file or directory
Spent awhile chasing this one before finally adding “-I/usr/include/libdrm” to the CFLAGS in the Makefile. That resulted in a huge cornucopia of errors in the following genre:
lv_port_linux/lvgl/src/drivers/display/drm/lv_linux_drm.o: in function `page_flip_handler':
lv_linux_drm.c:(.text+0x8): undefined reference to `drmModeAtomicFree'
Lots and lots of “undefined references.”
My LibDRM library version is as follows:
Package: libdrm-dev
Version: 2.4.118-0xneon+22.04+jammy+release+build10
Tried compiling for LIBINPUT
Similar story. Switched the “lv_conf.h” flags as follows (NOTE: I switched display back to framebuffer so that wasn’t a problem!)
/*Driver for evdev input devices*/
#define LV_USE_EVDEV 0
/*Driver for libinput input devices*/
#define LV_USE_LIBINPUT 1
Note that I did modify the default “lv_port_linux” sample init code so the “lv_linux_disp_init()” calls would return an “lv_display_t*” pointer to the created display. That enabled code like this to work:
/*Linux display device init*/
lv_display_t* disp = lv_linux_disp_init();
// Initialize the touch driver.
#if LV_USE_LIBINPUT
lv_indev_t *indev = lv_libinput_create(LV_INDEV_TYPE_POINTER, "/dev/input/event0");
#elif LV_USE_EVDEV
lv_indev_t *indev = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event0");
#endif
lv_indev_set_display(indev, disp);
Compiling the project for libinput resulted in a similar “file not found” error, so I installed “libinput-dev” (already installed!??!) followed by “libinput-tool” as needed to run the “libinput list-devices” command referenced in the docs.
Retrying compilation now results in a similar cornucopia of errors (only the first few shown here):
lv_port_linux/lvgl/src/drivers/libinput/lv_libinput.o: in function `_delete':
lv_libinput.c:(.text+0xe4): undefined reference to `libinput_path_remove_device'
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/../../../../arm-linux-gnueabihf/bin/ld: lv_libinput.c:(.text+0xec): undefined reference to `libinput_device_unref'
/usr/lib/gcc-cross/arm-linux-gnueabihf/11/../../../../arm-linux-gnueabihf/bin/ld: lv_libinput.c:(.text+0xf6): undefined reference to `libinput_unref'
More “undefined references” for page after page of errors.
My LibInput version is:
Package: libinput-dev
Version: 1.20.0-1ubuntu0.3
My conclusion
While I can very much utilize LVGL with FB and EVDEV, it seems that both DRM and LibInput need a little bit of upkeep (or at least documentation) if they are going to be viable options.
It appears that both DRM and LibInput were coded against a (presumably) much earlier version of the Linux drivers. Apparently they are not compatible with Linux 5.15 (i.e. Ubuntu 22.04 / KDE Neon 6.0).
Does anyone know what specific Linux version “lv_port_linux” was coded to be compatible with? Or am I missing something more major?