1# Copyright (c) 2018-2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
2# Copyright (c) 2020 Teslabs Engineering S.L.
3# SPDX-License-Identifier: Apache-2.0
4
5menu "Memory manager settings"
6
7config LV_Z_BITS_PER_PIXEL
8	int "Bits per pixel"
9	default 32
10	default 32 if LV_COLOR_DEPTH_32
11	default 24 if LV_COLOR_DEPTH_24
12	default 16 if LV_COLOR_DEPTH_16
13	default 8 if LV_COLOR_DEPTH_8
14	default 1 if LV_COLOR_DEPTH_1
15	range 1 32
16	help
17	  Number of bits per pixel.
18
19choice LV_Z_MEMORY_POOL
20	prompt "Memory pool"
21	default LV_Z_MEM_POOL_SYS_HEAP
22	help
23	  Memory pool to use for lvgl allocated objects
24
25	config LV_Z_MEM_POOL_HEAP_LIB_C
26	  bool "C library Heap"
27	  depends on !MINIMAL_LIBC || (COMMON_LIBC_MALLOC_ARENA_SIZE != 0)
28	  help
29		Use C library malloc and free to allocate objects on the C library heap
30
31	config LV_Z_MEM_POOL_SYS_HEAP
32		bool "User space lvgl pool"
33		select SYS_HEAP_INFO
34		help
35		  Use a dedicated memory pool from a private sys heap.
36
37endchoice
38
39config LV_Z_MEM_POOL_SIZE
40	int "Memory pool size"
41	default 2048
42	depends on LV_Z_MEM_POOL_SYS_HEAP
43	help
44	  Size of the memory pool in bytes
45
46config LV_Z_MEMORY_POOL_CUSTOM_SECTION
47	bool "Link memory pool to custom section"
48	depends on LV_Z_MEM_POOL_SYS_HEAP
49	help
50	  Place LVGL memory pool in custom section, with tag ".lvgl_heap".
51	  This can be used by custom linker scripts to relocate the LVGL
52	  memory pool to a custom location, such as tightly coupled or
53	  external memory.
54
55config LV_Z_VDB_SIZE
56	int "Rendering buffer size"
57	default 100 if LV_Z_FULL_REFRESH
58	default 10
59	range 1 100
60	help
61	  Size of the buffer used for rendering screen content as a percentage
62	  of total display size.
63
64config LV_Z_DOUBLE_VDB
65	bool "Use two rendering buffers"
66	help
67	  Use two buffers to render and flush data in parallel
68
69config LV_Z_FULL_REFRESH
70	bool "Force full refresh mode"
71	help
72	  Force full refresh of display on update. When combined with
73	  LV_Z_VDB_SIZE, this setting can improve performance for display
74	  controllers that require a framebuffer to be present in system memory,
75	  since the controller can render the LVGL framebuffer directly
76
77config LV_Z_VDB_ALIGN
78	int "Rending buffer alignment"
79	default 4
80	depends on LV_Z_BUFFER_ALLOC_STATIC
81	help
82	  Rendering buffer alignment. Depending on chosen color depth,
83	  buffer may be accessed as a uint8_t *, uint16_t *, or uint32_t *,
84	  so buffer must be aligned to prevent unaligned memory access
85
86config LV_Z_VBD_CUSTOM_SECTION
87	bool "Link rendering buffers to custom section"
88	depends on LV_Z_BUFFER_ALLOC_STATIC
89	help
90	  Place LVGL rendering buffers in custom section, with tag ".lvgl_buf".
91	  This can be used by custom linker scripts to relocate the LVGL
92	  rendering buffers to a custom location, such as tightly coupled or
93	  external memory.
94
95config LV_Z_MONOCHROME_CONVERSION_BUFFER
96	bool "Use intermediate conversion buffer for monochrome displays"
97	default y
98	help
99	  When using a monochrome display an intermediate buffer with LV_Z_VDB_SIZE
100	  is needed to perform the conversion.
101
102choice LV_Z_RENDERING_BUFFER_ALLOCATION
103	prompt "Rendering Buffer Allocation"
104	default LV_Z_BUFFER_ALLOC_STATIC
105	help
106	  Type of allocation that should be used for allocating rendering buffers
107
108config LV_Z_BUFFER_ALLOC_STATIC
109	bool "Static"
110	help
111	  Rendering buffers are statically allocated based on the following
112	  configuration parameters:
113	  * Horizontal screen resolution
114	  * Vertical screen resolution
115	  * Rendering buffer size
116	  * Bytes per pixel
117
118config LV_Z_BUFFER_ALLOC_DYNAMIC
119	bool "Dynamic"
120	help
121	  Rendering buffers are dynamically allocated based on the actual
122	  display parameters
123
124endchoice
125
126endmenu
127