walnux/include
Tiago Medicci Serrano ab60d0d3fb Framebuffer's callback buffer starts from the area being drawn.
The commit 664d45dcba updated the
behavior of the framebuffer's putarea callback enabling it to be
used to draw a particular area of the display. Previously, putarea
was only used to draw the entire area of the display. Any different
area was drawn, row by row, by putrun. Also, before checking for
which callback to call, the framebuffer driver adjusted the buffer
reference that was going to be used for calling the driver's callback
to point to the init of the relevant data. After that commit, the
framebuffer's buffer reference passed to the driver's putarea now
contains the data to draw the entire display. Unlike the previous
version of that implementation, only the putrun's callback buffer
was being referenced from the address that contains the data that
actually is being drawn.

This commit fixes it by adjusting the reference for the run buffer
passed to the putrun/putarea callback. It always starts from the
beginning of the relevant data that is actually being drawn. That is
necessary because lcddev (which uses the same LCD display driver
callbacks) actually don't allocate a buffer containing the data to
draw the whole display, so the same putarea implementation of the
LCD drivers would'n be able to work for both lcddev and framebuffer.
Also it's necessary to pass the stride argument to the LCD drivers
in order to enable them to do partial writes by calculating the
buffer offset while sending row-by-row. The stride is equal the
width multiplied by the bytes per pixel (may add some padding)
for framebuffer and is equal to the lenght of the row being drawn
(multiplied by the same BPP) for lcddev.

Why this approach?
Other possible approaches would be:
1) modify lcddev driver to translate received buffer data to a
buffer similar to the framebuffer. That wouldn't be efficient
considering memory allocation.
2) Create a new callback function. While possible, it'd be confusing
to create a different callback to draw the whole screen and another
to draw only an area of the screen. Also, these callbacks would
differ themselves only from the way the buffer is filled.
3) Simply reverting 664d45dcba would
break the usage of the putarea callback to draw an area of the
display, which would also be inefficient.

This approach is based on the Zephyr's implementation of the ST7789
driver: the buffer starts from the beginiing of the region that would
be drawn. The display device driver's putarea implementation should
check if the operation refers to a full screen/full row and implement
(if possible) a single operation to send the data to be drawn more
efficiently.

Finally, this approach requires that the drivers which implement
the putarea callback and expects the entire framebuffer buffer
to be modified. They don't need to calculate where the data begins
as the new buffer represents the data from the address that is
actually being drawn. This includes adjusting the LCD drivers
GC9A01 and ST7789 and the driver for APA102-based LED matrix display.
2022-08-13 20:36:45 +08:00
..
arpa Net thread-safe ntoa functions 2022-08-02 21:04:19 +08:00
cxx libc/wchar: remove unnecessary config 2022-07-27 00:36:49 +08:00
net wireless/ieee802154: Don't set IFF_DOWN in mac802154netdev_register 2022-07-19 11:09:16 +03:00
netinet Net thread-safe ntoa functions 2022-08-02 21:04:19 +08:00
netpacket netpacket/sockaddr_ll: complete the members of sockaddr_ll 2022-06-03 13:04:09 +08:00
nuttx Framebuffer's callback buffer starts from the area being drawn. 2022-08-13 20:36:45 +08:00
ssp add ssp.h 2022-01-29 01:04:23 +08:00
sys syscall: remove directory syscall 2022-08-10 13:33:08 +08:00
.gitignore Add Embedded Template Library (ETL) support 2022-08-05 09:38:48 +08:00
aio.h Change dpends on SCHED_[L|H]PWORK to SCHED_WORKQUEUE 2022-05-28 18:41:51 +03:00
alloca.h
assert.h assert: static_assert is not support in c standard C89,C99. 2022-04-21 23:11:21 +08:00
byteswap.h byteswap.h: add byteswap.h header file 2021-08-20 07:47:07 -07:00
ctype.h libc: Implement local_t related functions 2021-07-30 09:43:26 -03:00
debug.h Add printflike and scanflike to all printf/scanf like functions 2022-07-18 14:14:36 +03:00
dirent.h fs/dir: support fchdir and dirfd 2022-08-09 23:30:01 +08:00
dlfcn.h
dsp.h libdsp: initialize flux_link in params, remove flux_link from pmsm_phy_params 2022-02-20 21:58:10 +08:00
dspb16.h libdsp: port lib_observer.c to b16 2022-02-20 21:58:10 +08:00
elf.h elf: add elf define of Note Section 2021-11-23 20:34:56 +09:00
elf32.h elf: add elf define of Note Section 2021-11-23 20:34:56 +09:00
elf64.h elf: add elf define of Note Section 2021-11-23 20:34:56 +09:00
endian.h Use builtins for byteswapping 2022-06-29 11:32:59 +08:00
err.h libc/err: Add _func suffix to avoid the the penitential symbol collision 2022-08-08 07:39:59 -04:00
errno.h errno: use staic errno to replace tl_errno before tls initialization 2021-09-12 11:48:31 +08:00
execinfo.h sched/backtrace: Dump the complete stack regardless the depth 2021-12-29 12:09:54 +08:00
fcntl.h libc: Implement memfd on top of tmpfs 2022-08-09 22:13:09 +03:00
fixedmath.h
fnmatch.h libc: Rename match to fnmatch 2021-08-02 08:23:35 -03:00
ftw.h fs: Change off_t and related types to int64_t if long long is supported 2021-08-04 06:48:30 -07:00
getopt.h Implement getopt_long() and getopt_long_only() 2021-04-01 23:06:23 -05:00
glob.h libc/misc: add lib_glob. 2021-09-25 07:54:39 -03:00
grp.h
hex2bin.h libc/hex2bin: Handle the line ending(\r, \n and \r\n) dynamically 2021-11-26 11:55:00 -03:00
ifaddrs.h net: Implement getifaddrs and freeifaddrs 2021-12-21 11:01:33 -03:00
inttypes.h fs: Change off_t and related types to int64_t if long long is supported 2021-08-04 06:48:30 -07:00
iso646.h
langinfo.h libc: Add the empty nl_langinfo implementation 2021-07-31 15:35:47 -03:00
libgen.h
libintl.h libc: Implement gettext function 2021-08-03 12:14:07 -03:00
limits.h libc/wchar: support wchar 2022-07-27 00:36:49 +08:00
locale.h libc: Reorder LC_XXX as Linux 2021-07-31 15:35:47 -03:00
lzf.h libc/lzfcompress: add lzf compress stream 2021-12-20 08:39:33 -06:00
malloc.h mm/mm_heap: change CONFIG_MM_BACKTRACE to int type 2022-07-26 23:45:31 +08:00
mqueue.h
netdb.h libc/rexec/rexec_af: support remote execution 2021-09-12 21:14:06 +08:00
nl_types.h libc: Support message catalog function 2021-08-02 08:24:59 -03:00
nxflat.h
poll.h
pthread.h Revert "libc: Call pthread_exit in user-space by up_pthread_exit" 2022-02-09 21:21:43 +08:00
pty.h libc: Implement openpty function 2021-05-12 21:08:23 -07:00
pwd.h libc/pwd: Add NSS_BUFLEN_PASSWD macro 2021-05-11 16:40:33 +01:00
queue.h
resolv.h Add dn resolution function 2022-03-17 09:37:15 +02:00
sched.h sched/backtrace: Dump the complete stack regardless the depth 2021-12-29 12:09:54 +08:00
semaphore.h semphore: release all semphores' holder that the task held when exit 2022-02-13 03:20:51 +08:00
signal.h signal: add define of SIGHUP/SIGTTIN 2022-06-03 12:50:14 +08:00
spawn.h libc: Implement execvp, execlp and execvpe as macro 2022-04-22 10:40:31 +03:00
stdbool.h libc: Remove C99_BOOL8 from libs/libxx/Kconfig 2022-05-05 16:23:32 -03:00
stddef.h stddef: Let offset be defined from toolchain 2021-08-27 08:55:45 -07:00
stdint.h include/wchar.h: Remove NULL macro from it 2022-06-03 22:25:49 +03:00
stdio.h include/stdio:add setlinebuf marco 2021-11-29 11:18:36 -06:00
stdlib.h libc/wchar: support wchar 2022-07-27 00:36:49 +08:00
stdnoreturn.h
string.h libs/libc/string: add memmem 2022-07-22 19:04:11 +03:00
strings.h Remove the unneeded void cast 2022-04-17 23:32:05 +03:00
syscall.h arch: Remove SYS_RESERVED from Kconfg 2022-02-27 22:54:13 +08:00
syslog.h include/debug.h/syslog.h: Fix small typos and repeated words 2021-03-22 06:06:44 -07:00
termios.h libc: Implement terminal api regardless of CONFIG_SERIAL_TERMIOS setting 2021-12-29 08:11:08 -03:00
threads.h include/threads: Fix pthread_mutexattr_t initialization on mtx_init 2021-08-31 11:21:22 +08:00
time.h libc/time: rearrange itimerspec struct elements 2022-06-03 13:04:25 +08:00
unistd.h fs/dir: support fchdir and dirfd 2022-08-09 23:30:01 +08:00
utime.h libc: Implement utime on top of utimes 2021-07-09 15:51:28 -03:00
uuid.h
wchar.h arch: Define WCHAR_[MIN|MAX] in arch/include/limits.h 2022-06-03 22:25:49 +03:00
wctype.h libc: Remove the unnecessary include from wchar and wctype 2022-07-27 10:55:37 +03:00