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	range 1 32
11	depends on LV_Z_BUFFER_ALLOC_STATIC
12	help
13	  Number of bits per pixel.
14
15choice
16	prompt "Memory pool"
17	default LV_Z_MEM_POOL_SYS_HEAP
18	help
19	  Memory pool to use for lvgl allocated objects
20
21	config LV_Z_MEM_POOL_HEAP_LIB_C
22	  bool "C library Heap"
23	  depends on !MINIMAL_LIBC || (MINIMAL_LIBC_MALLOC_ARENA_SIZE != 0)
24	  help
25		Use C library malloc and free to allocate objects on the C library heap
26
27	config LV_Z_MEM_POOL_SYS_HEAP
28		bool "User space lvgl pool"
29		help
30		  Use a dedicated memory pool from a private sys heap.
31
32endchoice
33
34if LV_Z_MEM_POOL_SYS_HEAP
35
36config LV_Z_MEM_POOL_MIN_SIZE
37	int "Minimum memory pool block size"
38	default 16
39	help
40	  Size of the smallest block in the memory pool in bytes
41
42config LV_Z_MEM_POOL_MAX_SIZE
43	int "Maximum memory pool block size"
44	default 2048
45	help
46	  Size of the largest block in the memory pool in bytes
47
48config LV_Z_MEM_POOL_NUMBER_BLOCKS
49	int "Number of max size blocks in memory pool"
50	default 1
51	help
52	  Number of maximum sized blocks in the memory pool.
53
54endif
55
56config LV_Z_VDB_SIZE
57	int "Rendering buffer size"
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.
94choice
95	prompt "Rendering Buffer Allocation"
96	default LV_Z_BUFFER_ALLOC_STATIC
97	help
98	  Type of allocation that should be used for allocating rendering buffers
99
100config LV_Z_BUFFER_ALLOC_STATIC
101	bool "Static"
102	help
103	  Rendering buffers are statically allocated based on the following
104	  configuration parameters:
105	  * Horizontal screen resolution
106	  * Vertical screen resolution
107	  * Rendering buffer size
108	  * Bytes per pixel
109
110config LV_Z_BUFFER_ALLOC_DYNAMIC
111	bool "Dynamic"
112	help
113	  Rendering buffers are dynamically allocated based on the actual
114	  display parameters
115
116endchoice
117
118endmenu
119