-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fb: cfb: Support memory constrainted system by partial frame transferring #72204
fb: cfb: Support memory constrainted system by partial frame transferring #72204
Conversation
01537cb
to
1c410a5
Compare
1c410a5
to
49c75ce
Compare
bd90ce8
to
a54b6d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow that's pretty major, just picked on few cosmetic changes, not familiar enough to do a proper review but at this point as @jfischer-no pointed out, if you want to main the subsystem let's go with it
fb->buf[fb_index] |= byte; | ||
|
||
if (g_y == 0) { | ||
g_y += (8 - offset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for the parenthesis here
#include <zephyr/display/cfb.h> | ||
|
||
const uint8_t cfb_font_1016_rectspace[1][20] = { | ||
/* */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot something?
@@ -0,0 +1,3 @@ | |||
CONFIG_STDOUT_CONSOLE=n | |||
CONFIG_HEAP_MEM_POOL_SIZE=1244160 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds a bit random, maybe pick some more recognizable number?
.draw_figure = \ | ||
{ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: bring the bracket up, same for the others
The logic introduced in zephyrproject-rtos#67881 can also handle fonts with heights other than integer multiple of 8. I remove the restriction. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add test cases for 1x1 and 11x13 fonts. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Change the arguments of `cfb_invert_area`, `cfb_print`, and `cfb_draw_(point|line|rect)`, which used unsigned integers to specify coordinates to signed integers. This is because coordinate calculations are usually based on real numbers, so it is difficult to use unless negative numbers are accepted. We clip drawings outside the drawable area on the implementation side. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
`cfb_get_font_size` and `cfb_get_numof_fonts` take a `const struct driver *` as a first argument, but not use it. Remove the argument and clean up related sources. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
There are three major changes. - Introducing `struct cfb_display` - Changed the argument `struct device *` to `struct cfb_framebuffer *` - Rename APIs starting with `cfb_framebuffer_*` Introduces struct cfb_display as a data structure to represent the display. As a result, it is now possible to create multiple pieces of data managed using a single static variable in previous implementations, making it possible to handle multiple displays. The old `struct cfb_framebuffer` remains but is now part of the `struct cfb_display` data structure. You can get cfb_framebuffer from cfb_display using the added API `cfb_display_get_framebuffer`. All places where a `struct device *` argument was passed to specify the target will be replaced with a `struct cfb_framebuffer *`. In line with this, API names starting with `cfb_framebuffer_*`, which were redundant and inconsistent names, will remove `_framebuffer` and change to `cfb_*` . Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add `display select` command to select display. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add a note about the changes of CFB(Character framebuffer) APIs. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The pixel per tile value can be calculated from pixel_format, so delete the ppt field. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
If a character that does not exist in the font was specified, it was replaced with a space character, but it will now draw with 0 data. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Added support for color displays. Along with color support, we are introducing the concept of foreground and background colors. Drawing fonts and lines is done with the foreground color, and clear operation fills with the background color. With the introduction of drawing colors, we have removed the process of inverting data before transfer if the inverted flag was enabled during finalizing. Replacing the "Invert" operation by swapping the foreground and background colors. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
I have removed the process to set the display format to monochrome. Also, I added board settings conf files for native_sim and native_sim_64 to change the initial value of the SDL display driver's pixel format. CFB operates according to the pixel format set here. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Added a test to check the display on a color display. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add the `fgcolor` `bgcolor` and `display pixel_format` to support color display Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
CHARACTER_FRAMEBUFFER_SHELL_DRIVER_NAME is not used. Remove it. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
CFB was an abbreviation for Character Framebuffer. However, it currently supports characters and graphic drawing, so it has become far from actual. However, since there are only a few API changes, I don't want to change symbol names, etc. Therefore, we will keep the abbreviation CFB and change the name to `Compact Framebuffer`. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Update README to update to current specs. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Allows you to draw part of the screen so that the drawing process can be performed even if the buffer size is not large enough. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Store operations for the frame buffer as commands, Change to a method that draws at once and transfers at finalize. Commands are managed in a linked list and processed at the finalization. The behavior of drawing APIs does not change. It's just that the timing at which drawing is done to memory is internally delayed a little. Typical usage stores command in the buffer. The behavior of existing drawing APIs has been changed to store commands in this buffer. For this reason, an argument for buffer specification is added to the initialization function cfb_display_init. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
a54b6d8
to
d37422c
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
By dividing and transferring the frame, we can draw with less buffer.
This function is helpful for displays on color LCDs in configurations where there is not enough offscreen buffer.
(For example, Longan Nano LCD requires 160x80x 2bpp = 25Kbytes to allocate offscreen memory, but the SoC only has 32Kbytes of memory, so allocating offscreen buffers is unrealistic.)
This behavior occurs if the buffer size is smaller than the screen frame, and if the buffer is large enough, it behaves similarly to the existing behavior.
If you divide and transfer, the drawing will be done all at once during cfb_finalize, so you need to hold the drawing operation until finalize is executed.
For this reason, I'm introducing a drawing command mechanism and adding a command buffer.
This PR is part of a series of CFB enhancements (fourth of four #72177).
I would appreciate it if you could check the #58817 part first.