lvgl icon indicating copy to clipboard operation
lvgl copied to clipboard

Use VGLite in linux or other OS with MMU

Open MrThanlon opened this issue 1 year ago • 6 comments

Introduce the problem

In the src/draw directory, LVGL contains adaptation code related to VGLite. However, the issue lies in the fact that this codebase seems to be usable only on platforms without MMU enabled, such as baremetal. In contrast, on Linux or other OS that utilize MMU, the memory and address fields within the vg_lite_buffer_t structure are distinct. memory represents the CPU-mapped virtual address, while address corresponds to the physical address visible to the GPU. It is advisable to utilize vg_lite_allocate for allocating buffers intended for GPU use, instead of placing an arbitrary pointer in the vg_lite_buffer_t::memory field. Any suggestions for modifications?

Proposal

No response

MrThanlon avatar Nov 18 '24 03:11 MrThanlon

I noticed that in the lv_vg_lite_buffer_init function, buffers with width = 16, height = 12, and format = VG_LITE_A8 are frequently allocated. What are these buffers used for?

MrThanlon avatar Nov 18 '24 03:11 MrThanlon

Hi,

What kind of hardware do you use?

I noticed that in the lv_vg_lite_buffer_init function, buffers with width = 16, height = 12, and format = VG_LITE_A8 are frequently allocated. What are these buffers used for?

It's for letter drawing. A PR is already opened to eliminate it.

kisvegabor avatar Nov 20 '24 12:11 kisvegabor

cc @FASTSHIFT @nicusorcitu

kisvegabor avatar Nov 20 '24 12:11 kisvegabor

@cosmindanielradu19 @cristian-stoica

nicusorcitu avatar Nov 20 '24 13:11 nicusorcitu

Hi,

What kind of hardware do you use?

I noticed that in the lv_vg_lite_buffer_init function, buffers with width = 16, height = 12, and format = VG_LITE_A8 are frequently allocated. What are these buffers used for?

It's for letter drawing. A PR is already opened to eliminate it.

kendryte K230. I try to allocate a LV_MEM_SIZE buffer from vg_lite_allocate, and pass to LV_MEM_ADR, and calculate offset of physical address in lv_vg_lite_buffer_init , it works.

MrThanlon avatar Nov 21 '24 02:11 MrThanlon

@MrThanlon Consider connecting the memory allocation interface pair of lv_draw_buf to the vg_lite_allocate interface.

FASTSHIFT avatar Nov 21 '24 05:11 FASTSHIFT

We need some feedback on this issue.

Now we mark this as "Abandoned" because there was no activity here for 14 days.

Remove the "Stale" label or comment else this will be closed in 7 days.

lvgl-bot avatar Dec 08 '24 02:12 lvgl-bot

Not stale

uLipe avatar Dec 08 '24 17:12 uLipe

The VGLite API from the LVGL is a client API which communicates to the lower half API, composed by a Kernel Driver component that handles the GPU communication low level stuff, the SoC manufacturer is responsible to provide this kernel interface API.

For other parts like NXP processors, they provide a Linux like kernel driver.

You may reach the SoC manufacturer to check about the low level stuff for VGLite targeting its GPU.

Of course there is a possibility to bridge the VGLite client APi to the low level using the POSIX mmap() system calls to get the base address of the GPU device.

uLipe avatar Dec 08 '24 18:12 uLipe

The VGLite API from the LVGL is a client API which communicates to the lower half API, composed by a Kernel Driver component that handles the GPU communication low level stuff, the SoC manufacturer is responsible to provide this kernel interface API.

For other parts like NXP processors, they provide a Linux like kernel driver.

You may reach the SoC manufacturer to check about the low level stuff for VGLite targeting its GPU.

Of course there is a possibility to bridge the VGLite client APi to the low level using the POSIX mmap() system calls to get the base address of the GPU device.

The kernel driver only provides memory allocation (mainly DMA memory allocator and dma-buf management) and the functionality to read and write GPU registers, the bridge is implemented by libvg_lite.so.

MrThanlon avatar Dec 09 '24 02:12 MrThanlon

We need some feedback on this issue.

Now we mark this as "Abandoned" because there was no activity here for 14 days.

Remove the "Stale" label or comment else this will be closed in 7 days.

lvgl-bot avatar Dec 28 '24 01:12 lvgl-bot

Not stale.

uLipe avatar Dec 29 '24 15:12 uLipe

I'm wondering if the time of a more complete memory management module has arrived, the idea is not just allocating buffers but doing some sort of management using the host OS capabilities, in the future most of the OS env for MCU will be on top of trust zones while the MPUs will receive more and more capabilities, so allocation, mapping, and capabilities settings would be some of things that LVGL may handle by itself ( like frame buffers or mapping GPU register space on OS Like Linux, Windows or QNX)

uLipe avatar Dec 29 '24 17:12 uLipe

We need some feedback on this issue.

Now we mark this as "Abandoned" because there was no activity here for 14 days.

Remove the "Stale" label or comment else this will be closed in 7 days.

lvgl-bot avatar Jan 16 '25 01:01 lvgl-bot

As there was no activity here for a while we close this issue. But don't worry, the conversation is still here and you can get back to it at any time.

Feel free to comment if you have remarks or ideas on this topic.

lvgl-bot avatar Jan 23 '25 01:01 lvgl-bot