fb & gfx rework
This patchset aims to simplify the vendor-provided graphics library and adds a well-defined abstraction layer between the LCD driver, framebuffer and graphics code.
Merge request reports
Activity
added 3-Epicardium label
- Resolved by Mateusz Zalega
- Resolved by Mateusz Zalega
- Resolved by rahix
- Resolved by Mateusz Zalega
- Resolved by rahix
- Resolved by Mateusz Zalega
- Resolved by Mateusz Zalega
- Resolved by rahix
Hi @msgctl, thanks for the MR! From taking a quick look, the new graphics API is really great!
A few general notes, additionally to the comments interleaved with the diff:
Code-Style
Now that gfx is part of "our" code, please remove
lib/gfx/*
from the blacklist intools/code-style.sh
so it also gets properly formatted.Inline
You have used
inline
or eveninline_always
for quite a few functions. Please reduce theinline
usage as much as possible. The compiler is smart enough to decide on its own when it makes sense to inline calls. There might be some rare cases where there is a considerable performance impact. If we run into such a bottleneck, we can still force inlining the relevant function as an optimization later.Float
As far as I can see, all colors will make a roundtrip through a floating point representation (
gfx_color_rgb_f
) before being converted to the display format. I don't know exact numbers, but I feel like this is an unnecessary cost in speed and complexity, as almost always the input will be 24-bit RGB.added 59 commits
-
3698939e...6d1686e0 - 47 commits from branch
master
- 848ab0af - fb: gfx: replaced vendor implementation
- 1a622930 - gfx: fixed splashscreen glitch
- 796259ed - fb: gfx: switched default color format to RGB888
- 0cc0ed8f - fb: gfx: dropped forced function inlining
- f1d9ad31 - gfx: simplified gfx_color
- cb1ad7ab - gfx: gfx_puts: truncate strings that don't fit the screen
- 5b6fc7b8 - bootloader: coding style and text color bug
- e2e927bf - coding style: include order
- fd4157ab - epicardium: added a TODO note about missing linestyle implementation
- 538e134e - tools: refactored code-style.sh blacklist code
- eae26ae9 - tools: code-style.sh: whitelisted lib/gfx/* code
- 0c53de83 - coding style: reformatted gfx & framebuffer code
Toggle commit list-
3698939e...6d1686e0 - 47 commits from branch
added 1 commit
- 095c0b7c - coding style: reformatted files modified by the fb & gfx refactor
LGTM! Thank you very much!
There is one more thing but it is something for which you are absolutely not to blame: Because you touched some files in hw-tests which weren't previously formatted, your changes get drowned in the formatting changes. To fix this once and for all, I pushed some commits to master which format all of those file.
Now, I have to ask you to rebase again but because of my commits this would produce horrible merge-conflicts. To prevent these, you can rebase like this:
$ git fetch origin $ git rebase -X theirs origin/master
This will unconditionally take your version for all changes (which is ok here because you also applied the formatting script).
Edited by rahixadded 17 commits
-
095c0b7c...1bb79811 - 3 commits from branch
master
- 634bcbae - fb: gfx: replaced vendor implementation
- b9d1de80 - gfx: fixed splashscreen glitch
- c4eb791d - fb: gfx: switched default color format to RGB888
- 4690e9ac - fb: gfx: dropped forced function inlining
- 78b54eee - gfx: simplified gfx_color
- 3579c6a5 - gfx: gfx_puts: truncate strings that don't fit the screen
- ff90df67 - bootloader: coding style and text color bug
- 79eb6d50 - coding style: include order
- 6df8fc32 - epicardium: added a TODO note about missing linestyle implementation
- 1f2b362a - tools: refactored code-style.sh blacklist code
- 4711278a - tools: code-style.sh: whitelisted lib/gfx/* code
- d25efa54 - coding style: reformatted gfx & framebuffer code
- 5aab15b7 - coding style: reformatted LCD_Driver.c
- ed026d54 - coding style: reformatted files modified by the fb & gfx refactor
Toggle commit list-
095c0b7c...1bb79811 - 3 commits from branch