Merge branch 'lvgl_backends' into 'main'
backends: make the framebuffer backend optional See merge request postmarketOS/buffybox!78
This commit is contained in:
commit
8a87b5071a
13 changed files with 51 additions and 32 deletions
|
|
@ -56,7 +56,7 @@ On distributions based on systemd, `unl0kr` can be used as a [password agent](ht
|
|||
# systemd-ask-password --no-tty # Unl0kr is started
|
||||
```
|
||||
|
||||
**Note**: SDL2 can be used as display backend for development purposes by setting the Meson option `developer` and use `backend=sdl` in the configuration file.
|
||||
**Note**: SDL can be used as a display backend for development purposes by setting the Meson option `lvgl_backends=sdl` and using `backend=sdl` in the configuration file.
|
||||
Other uses besides development are not supported by Buffybox.
|
||||
|
||||
## Packaging
|
||||
|
|
@ -121,3 +121,4 @@ For the license of bundled images and fonts, see [shared/cursor] and [shared/fon
|
|||
[shared/fonts]: ./shared/fonts
|
||||
[unl0kr]: ./unl0kr
|
||||
[unl0kr#42]: https://gitlab.com/cherrypicker/unl0kr/-/issues/42
|
||||
[f0rmz]: ./f0rmz
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ buffyboard_sources = files(
|
|||
)
|
||||
|
||||
buffyboard_dependencies = [
|
||||
common_dependencies,
|
||||
meson.get_compiler('c').find_library('m', required: false)
|
||||
common_dependencies
|
||||
]
|
||||
|
||||
buffyboard_args = [
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Manual post-processing steps for the generated lv_conf.h
|
||||
# 1. Comment LV_USE_LINUX_DRM (handled by meson.build)
|
||||
# 2. Comment LV_BIG_ENDIAN_SYSTEM (handled by meson.build)
|
||||
# 3. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py)
|
||||
# 1. Comment LV_USE_SDL
|
||||
# LV_USE_LINUX_FBDEV
|
||||
# LV_USE_LINUX_DRM
|
||||
# LV_BIG_ENDIAN_SYSTEM (handled by meson.build)
|
||||
# 2. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py)
|
||||
|
||||
LV_COLOR_DEPTH 32
|
||||
LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
|
||||
|
|
@ -106,7 +108,9 @@ LV_USE_GRID 0
|
|||
|
||||
LV_USE_OBSERVER 0
|
||||
|
||||
LV_USE_LINUX_FBDEV 1
|
||||
LV_USE_SDL 0
|
||||
|
||||
LV_USE_LINUX_FBDEV 0
|
||||
LV_LINUX_FBDEV_BSD 0
|
||||
LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT
|
||||
|
||||
|
|
|
|||
|
|
@ -1251,7 +1251,7 @@
|
|||
*==================*/
|
||||
|
||||
/** Use SDL to open window on PC and handle mouse and keyboard. */
|
||||
#define LV_USE_SDL 0
|
||||
//#define LV_USE_SDL 0
|
||||
#if LV_USE_SDL
|
||||
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
||||
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */
|
||||
|
|
@ -1280,7 +1280,7 @@
|
|||
#endif
|
||||
|
||||
/** Driver for /dev/fb */
|
||||
#define LV_USE_LINUX_FBDEV 1
|
||||
//#define LV_USE_LINUX_FBDEV 0
|
||||
#if LV_USE_LINUX_FBDEV
|
||||
#define LV_LINUX_FBDEV_BSD 0
|
||||
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT
|
||||
|
|
|
|||
|
|
@ -15,16 +15,21 @@ f0rmz_dependencies = [
|
|||
|
||||
f0rmz_args = []
|
||||
|
||||
deplibdrm = dependency('libdrm', required: get_option('with-drm'))
|
||||
if deplibdrm.found()
|
||||
f0rmz_dependencies += deplibdrm
|
||||
if get_option('lvgl_backends').contains('framebuffer')
|
||||
f0rmz_args += '-DLV_USE_LINUX_FBDEV=1'
|
||||
else
|
||||
f0rmz_args += '-DLV_USE_LINUX_FBDEV=0'
|
||||
endif
|
||||
|
||||
if get_option('lvgl_backends').contains('drm')
|
||||
f0rmz_dependencies += dependency('libdrm')
|
||||
f0rmz_args += '-DLV_USE_LINUX_DRM=1'
|
||||
else
|
||||
f0rmz_args += '-DLV_USE_LINUX_DRM=0'
|
||||
endif
|
||||
|
||||
if deplibsdl.found()
|
||||
f0rmz_dependencies += deplibsdl
|
||||
if get_option('lvgl_backends').contains('sdl')
|
||||
f0rmz_dependencies += dependency('sdl2')
|
||||
f0rmz_args += '-DLV_USE_SDL=1'
|
||||
else
|
||||
f0rmz_args += '-DLV_USE_SDL=0'
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ for and, if found, merged in the following order:
|
|||
*animations* = <true|false>
|
||||
Enable or disable animations. Useful for slower devices. Default: false.
|
||||
|
||||
*backend* = <fbdev|drm>
|
||||
The rendering backend to use. Default: fbdev.
|
||||
*backend* = <fbdev|drm|sdl>
|
||||
The rendering backend to use. Default: the first compiled backend from the list above.
|
||||
|
||||
*timeout* = <value>
|
||||
The time in seconds before unl0kr will consider the entry a failure
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ depinih = dependency('inih')
|
|||
deplibinput = dependency('libinput')
|
||||
deplibudev = dependency('libudev')
|
||||
depxkbcommon = dependency('xkbcommon') # For unl0kr and f0rmz only
|
||||
deplibsdl = dependency('sdl2', required: get_option('developer'))
|
||||
|
||||
if get_option('man')
|
||||
depscdoc = dependency('scdoc', native: true)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
option('with-drm', type: 'feature', value: 'auto', description: 'Enable DRM backend')
|
||||
option('developer', type: 'feature', value: 'auto', description: 'Enable developer features')
|
||||
option('lvgl_backends', type: 'array', choices: ['framebuffer', 'drm', 'sdl'], value: ['framebuffer', 'drm'])
|
||||
|
||||
option('man', type: 'boolean', value: true, description: 'Install manual pages')
|
||||
|
||||
option('systemd-buffyboard-service', type: 'feature', value: 'auto', description: 'Install systemd service file for buffyboard')
|
||||
|
||||
option('systemd-password-agent', type: 'feature', value: 'auto', description: 'Build a systemd password agent for touchscreens')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm -rf _build
|
||||
meson _build
|
||||
meson setup _build -Dlvgl_backends=framebuffer,drm
|
||||
meson compile -C _build
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm -rf _build
|
||||
meson _build -Dwith-drm=disabled
|
||||
meson setup _build -Dlvgl_backends=framebuffer
|
||||
meson compile -C _build
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Manual post-processing steps for the generated lv_conf.h
|
||||
# 1. Comment LV_USE_LINUX_DRM (handled by meson.build)
|
||||
# 2. Comment LV_BIG_ENDIAN_SYSTEM (handled by meson.build)
|
||||
# 3. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py)
|
||||
# 1. Comment LV_USE_SDL
|
||||
# LV_USE_LINUX_FBDEV
|
||||
# LV_USE_LINUX_DRM
|
||||
# LV_BIG_ENDIAN_SYSTEM (handled by meson.build)
|
||||
# 2. Add `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(bbx_font_32)` (a bug in generate_lv_conf.py)
|
||||
|
||||
LV_COLOR_DEPTH 32
|
||||
LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
|
||||
|
|
@ -106,7 +108,9 @@ LV_USE_GRID 0
|
|||
|
||||
LV_USE_OBSERVER 0
|
||||
|
||||
LV_USE_LINUX_FBDEV 1
|
||||
LV_USE_SDL 0
|
||||
|
||||
LV_USE_LINUX_FBDEV 0
|
||||
LV_LINUX_FBDEV_BSD 0
|
||||
LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT
|
||||
|
||||
|
|
|
|||
|
|
@ -1251,7 +1251,7 @@
|
|||
*==================*/
|
||||
|
||||
/** Use SDL to open window on PC and handle mouse and keyboard. */
|
||||
#define LV_USE_SDL 0
|
||||
//#define LV_USE_SDL 0
|
||||
#if LV_USE_SDL
|
||||
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
||||
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */
|
||||
|
|
@ -1280,7 +1280,7 @@
|
|||
#endif
|
||||
|
||||
/** Driver for /dev/fb */
|
||||
#define LV_USE_LINUX_FBDEV 1
|
||||
//#define LV_USE_LINUX_FBDEV 0
|
||||
#if LV_USE_LINUX_FBDEV
|
||||
#define LV_LINUX_FBDEV_BSD 0
|
||||
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT
|
||||
|
|
|
|||
|
|
@ -15,16 +15,21 @@ unl0kr_dependencies = [
|
|||
|
||||
unl0kr_args = []
|
||||
|
||||
deplibdrm = dependency('libdrm', required: get_option('with-drm'))
|
||||
if deplibdrm.found()
|
||||
unl0kr_dependencies += deplibdrm
|
||||
if get_option('lvgl_backends').contains('framebuffer')
|
||||
unl0kr_args += '-DLV_USE_LINUX_FBDEV=1'
|
||||
else
|
||||
unl0kr_args += '-DLV_USE_LINUX_FBDEV=0'
|
||||
endif
|
||||
|
||||
if get_option('lvgl_backends').contains('drm')
|
||||
unl0kr_dependencies += dependency('libdrm')
|
||||
unl0kr_args += '-DLV_USE_LINUX_DRM=1'
|
||||
else
|
||||
unl0kr_args += '-DLV_USE_LINUX_DRM=0'
|
||||
endif
|
||||
|
||||
if deplibsdl.found()
|
||||
unl0kr_dependencies += deplibsdl
|
||||
if get_option('lvgl_backends').contains('sdl')
|
||||
unl0kr_dependencies += dependency('sdl2')
|
||||
unl0kr_args += '-DLV_USE_SDL=1'
|
||||
else
|
||||
unl0kr_args += '-DLV_USE_SDL=0'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue