diff options
| author | Jaeyoon Jung <jaeyoon.jung@lge.com> | 2024-04-03 06:30:57 +0900 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-04-02 17:54:04 -0700 |
| commit | 0bee442a0ee9b1236b9e49947069c45e51423cca (patch) | |
| tree | 2c4f0af0a9eb15dcfbe77399f9d525f444776828 | |
| parent | b5573a4896d8b2d587e25269d7e1b0f6a311f0e2 (diff) | |
| download | meta-openembedded-0bee442a0ee9b1236b9e49947069c45e51423cca.tar.gz | |
lvgl: Set resolution prior to buffer
It fixes an issue where the fbdev driver fails to set up a buffer due to
buffer size mismatch. It happens when the actual screen resolution is
smaller than the default one 800x480 because the actual resolution was
being set after lv_display_set_buffers.
Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 31 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch b/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch new file mode 100644 index 0000000000..449db53dfb --- /dev/null +++ b/meta-oe/recipes-graphics/lvgl/files/0008-fix-fbdev-set-resolution-prior-to-buffer.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From a6f822f75b3ba01b00c028608c93160d09a6ffd1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jaeyoon Jung <jaeyoon.jung@lge.com> | ||
| 3 | Date: Mon, 1 Apr 2024 18:00:39 +0900 | ||
| 4 | Subject: [PATCH] fix(fbdev): set resolution prior to buffer | ||
| 5 | |||
| 6 | Otherwise it ends up with using the default value 800x480 and may fail | ||
| 7 | at lv_display_set_buffers due to incorrect resolution. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://github.com/lvgl/lvgl/pull/6004] | ||
| 10 | Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com> | ||
| 11 | --- | ||
| 12 | |||
| 13 | src/drivers/display/fb/lv_linux_fbdev.c | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/src/drivers/display/fb/lv_linux_fbdev.c b/src/drivers/display/fb/lv_linux_fbdev.c | ||
| 17 | index b3cc89199..5fb4c5c9f 100644 | ||
| 18 | --- a/src/drivers/display/fb/lv_linux_fbdev.c | ||
| 19 | +++ b/src/drivers/display/fb/lv_linux_fbdev.c | ||
| 20 | @@ -233,8 +233,8 @@ void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file) | ||
| 21 | draw_buf_2 = malloc(draw_buf_size); | ||
| 22 | } | ||
| 23 | |||
| 24 | - lv_display_set_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE); | ||
| 25 | lv_display_set_resolution(disp, hor_res, ver_res); | ||
| 26 | + lv_display_set_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE); | ||
| 27 | |||
| 28 | if(width > 0) { | ||
| 29 | lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 254, width * 10)); | ||
diff --git a/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb index 3fc3f92860..6e8371baad 100644 --- a/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb +++ b/meta-oe/recipes-graphics/lvgl/lvgl-demo-fb_9.1.0.bb | |||
| @@ -13,6 +13,7 @@ SRC_URI = "\ | |||
| 13 | file://0005-Add-DRM-KMS-example-support.patch \ | 13 | file://0005-Add-DRM-KMS-example-support.patch \ |
| 14 | file://0006-Add-SDL2-example-support.patch \ | 14 | file://0006-Add-SDL2-example-support.patch \ |
| 15 | file://0007-fix-cmake-generate-versioned-shared-libraries.patch;patchdir=lvgl \ | 15 | file://0007-fix-cmake-generate-versioned-shared-libraries.patch;patchdir=lvgl \ |
| 16 | file://0008-fix-fbdev-set-resolution-prior-to-buffer.patch;patchdir=lvgl \ | ||
| 16 | " | 17 | " |
| 17 | SRCREV_demo = "dccc6a1ca48372aa993dbea7a8e17dec6f42df6a" | 18 | SRCREV_demo = "dccc6a1ca48372aa993dbea7a8e17dec6f42df6a" |
| 18 | SRCREV_lvgl = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" | 19 | SRCREV_lvgl = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" |
diff --git a/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb b/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb index 0ebd6ec422..4435c40777 100644 --- a/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb +++ b/meta-oe/recipes-graphics/lvgl/lvgl_9.1.0.bb | |||
| @@ -12,6 +12,7 @@ SRC_URI = "\ | |||
| 12 | git://github.com/lvgl/lvgl;protocol=https;branch=master \ | 12 | git://github.com/lvgl/lvgl;protocol=https;branch=master \ |
| 13 | file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch \ | 13 | file://0002-fix-sdl-handle-both-LV_IMAGE_SRC_FILE-and-LV_IMAGE_S.patch \ |
| 14 | file://0007-fix-cmake-generate-versioned-shared-libraries.patch \ | 14 | file://0007-fix-cmake-generate-versioned-shared-libraries.patch \ |
| 15 | file://0008-fix-fbdev-set-resolution-prior-to-buffer.patch \ | ||
| 15 | " | 16 | " |
| 16 | SRCREV = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" | 17 | SRCREV = "e1c0b21b2723d391b885de4b2ee5cc997eccca91" |
| 17 | 18 | ||
