diff options
Diffstat (limited to 'meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch')
| -rw-r--r-- | meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch b/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch deleted file mode 100644 index 2d2c4c60f1..0000000000 --- a/meta-oe/recipes-graphics/lvgl/files/0005-Add-DRM-KMS-example-support.patch +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | From dabf40559428733413432afa29598bc145aa6636 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Marek Vasut <marex@denx.de> | ||
| 3 | Date: Tue, 12 Mar 2024 03:08:13 +0100 | ||
| 4 | Subject: [PATCH 5/6] Add DRM/KMS example support | ||
| 5 | |||
| 6 | Extend the main.c to support both legacy fbdev and DRM/KMS initialization. | ||
| 7 | |||
| 8 | To use legacy fbdev support, adjust lv_conf.h as follows: | ||
| 9 | LV_USE_LINUX_FBDEV=1 | ||
| 10 | LV_USE_LINUX_DRM=0 | ||
| 11 | |||
| 12 | To use DRM/KMS support, adjust lv_conf.h as follows: | ||
| 13 | LV_USE_LINUX_FBDEV=0 | ||
| 14 | LV_USE_LINUX_DRM=1 | ||
| 15 | |||
| 16 | Upstream-Status: Backport [a0f03515bd7417a0d100058b133c3e8d69be9451] | ||
| 17 | Signed-off-by: Marek Vasut <marex@denx.de> | ||
| 18 | --- | ||
| 19 | CMakeLists.txt | 5 ++++- | ||
| 20 | main.c | 8 ++++++++ | ||
| 21 | 2 files changed, 12 insertions(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 24 | index d91b196..c1cfb7f 100644 | ||
| 25 | --- a/CMakeLists.txt | ||
| 26 | +++ b/CMakeLists.txt | ||
| 27 | @@ -12,6 +12,9 @@ target_include_directories(lvgl PUBLIC ${PROJECT_SOURCE_DIR}) | ||
| 28 | |||
| 29 | add_executable(main main.c mouse_cursor_icon.c) | ||
| 30 | |||
| 31 | -target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} m pthread) | ||
| 32 | +include(${CMAKE_CURRENT_LIST_DIR}/lvgl/tests/FindLibDRM.cmake) | ||
| 33 | +include_directories(${Libdrm_INCLUDE_DIRS}) | ||
| 34 | + | ||
| 35 | +target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} ${Libdrm_LIBRARIES} m pthread) | ||
| 36 | add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main DEPENDS main) | ||
| 37 | |||
| 38 | diff --git a/main.c b/main.c | ||
| 39 | index 288519c..ab4e936 100644 | ||
| 40 | --- a/main.c | ||
| 41 | +++ b/main.c | ||
| 42 | @@ -17,6 +17,14 @@ static void lv_linux_disp_init(void) | ||
| 43 | |||
| 44 | lv_linux_fbdev_set_file(disp, videocard); | ||
| 45 | } | ||
| 46 | +#elif LV_USE_LINUX_DRM | ||
| 47 | +static void lv_linux_disp_init(void) | ||
| 48 | +{ | ||
| 49 | + const char *videocard = lv_linux_get_video_card_node("/dev/dri/card0"); | ||
| 50 | + lv_display_t * disp = lv_linux_drm_create(); | ||
| 51 | + | ||
| 52 | + lv_linux_drm_set_file(disp, videocard, -1); | ||
| 53 | +} | ||
| 54 | #else | ||
| 55 | #error Unsupported configuration | ||
| 56 | #endif | ||
| 57 | -- | ||
| 58 | 2.43.0 | ||
| 59 | |||
