Skip to content
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: Supporting multiple display #68260

Closed

Conversation

soburi
Copy link
Member

@soburi soburi commented Jan 30, 2024

This PR adds support for multi-display. This change affects APIs widely.
I also make some API improvements.
(Removal of font size restrictions, Function argument signedness changes, Remove needless arguments from font APIs)

  • 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_* .

Related API and implementation improvement have also been committed.

  • Remove unused arguments

cfb_get_font_size
cfb_get_numof_fonts

  • Change coordinate specification to signed integer

cfb_invert_area
cfb_print
cfb_draw_point (cfb_position)
cfb_draw_line
cfb_draw_rect

  • Removed the restriction that the vertical size of the font must be a multiple of 8.

This PR is part of a series of CFB enhancements (second of four #72177).
I would appreciate it if you could check the #67881 part first.

@soburi soburi added the DNM This PR should not be merged (Do Not Merge) label Jan 30, 2024
@soburi soburi force-pushed the cfb_support_multidisplay branch 2 times, most recently from 236493d to 5f3bcb1 Compare January 30, 2024 07:29
@soburi soburi changed the title Cfb support multidisplay fb: cfb: Supporting multiple display Jan 30, 2024
@soburi soburi marked this pull request as ready for review January 30, 2024 08:22
@zephyrbot zephyrbot added area: Display Release Notes To be mentioned in the release notes area: Samples Samples labels Jan 30, 2024
@kartben kartben assigned jfischer-no and unassigned kartben Jan 30, 2024
Comment on lines 468 to 469
CFB
===
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to go into the migration guide for v3.7.0 instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my late response.
Update done.

@soburi soburi force-pushed the cfb_support_multidisplay branch from 5f3bcb1 to 9cc5338 Compare March 3, 2024 09:33
@soburi soburi force-pushed the cfb_support_multidisplay branch 2 times, most recently from 922c789 to dc35fe4 Compare April 13, 2024 15:34
@soburi soburi force-pushed the cfb_support_multidisplay branch 4 times, most recently from 51ccabe to 48773e7 Compare April 28, 2024 20:31
@soburi soburi mentioned this pull request Apr 30, 2024
9 tasks
@soburi soburi force-pushed the cfb_support_multidisplay branch 3 times, most recently from 2d42a93 to 5c2eefe Compare May 1, 2024 23:53
@soburi soburi force-pushed the cfb_support_multidisplay branch 2 times, most recently from 8099533 to 48e9e48 Compare May 2, 2024 01:19
@soburi soburi removed the DNM This PR should not be merged (Do Not Merge) label May 2, 2024
@soburi soburi requested a review from henrikbrixandersen May 2, 2024 04:41
@soburi soburi force-pushed the cfb_support_multidisplay branch from 48e9e48 to 3d41b9e Compare May 5, 2024 15:33
soburi added 7 commits July 2, 2024 19:42
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>
@soburi soburi force-pushed the cfb_support_multidisplay branch from 3d41b9e to dc2c64a Compare July 2, 2024 10:45
@soburi soburi marked this pull request as draft July 2, 2024 10:45
Copy link

github-actions bot commented Sep 1, 2024

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.

@github-actions github-actions bot added the Stale label Sep 1, 2024
@github-actions github-actions bot closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Display area: Samples Samples Release Notes To be mentioned in the release notes Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants