|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Screen rotation 180° in the flush. See include/gfx_turn.h. More...
Functions | |
| void | gfx_turn_init (gfx_turn_t *t, int width, int height) |
NORMAL, nothing failed, for a width x height picture; the shown flag NORMAL too. | |
| void | gfx_turn_request (gfx_turn_t *t, bool turned) |
| What the setting asks for; taken at the next gfx_turn_next(). | |
| void | gfx_turn_fail (gfx_turn_t *t, gfx_turn_fail_t why) |
| Fall back to NORMAL until the next start. | |
| bool | gfx_turn_drawing (const gfx_turn_t *t) |
| Whether the frame being drawn goes into a logical buffer. | |
| void | gfx_turn_begin (gfx_turn_t *t, const gfx_canvas_t *logical) |
Start a frame: drawing turned, the damage record bound to logical, empty and attached; NORMAL, no record attached. | |
| static gfx_turn_show_t | fall_back (gfx_turn_t *t, const gfx_color_t *logical, gfx_color_t *fb, gfx_turn_fail_t why) |
Fall back for this frame: logical into fb as drawn. | |
| gfx_turn_show_t | gfx_turn_flush (gfx_turn_t *t, const gfx_color_t *logical, gfx_color_t *fb, const gfx_turn_ops_t *ops) |
End a frame: copy what it drew into fb, turned. | |
| bool | gfx_turn_presented (gfx_turn_t *t, gfx_turn_show_t show) |
| The frame of the last flush is on the glass: set the shown flag. | |
| void | gfx_turn_next (gfx_turn_t *t) |
| After a flip: take the request for the next frame. | |
| bool | gfx_turn_take_repaint (gfx_turn_t *t) |
| Whether the UI must repaint everything before the next frame; clears it. | |
| bool | gfx_turn_take_alert (gfx_turn_t *t) |
| Whether the fallback's alert is due; clears it. | |
| bool | gfx_turn_shown (void) |
| What the panel shows: the one flag picture and touch turn by. Read from any task. | |
| gfx_turn_copy_t | gfx_turn_engine_copy (const gfx_turn_engine_t *e, const gfx_color_t *src, gfx_color_t *dst, gfx_rect_t r, int width, int height, uint32_t budget_us) |
One block through e: the job built from r with e->done_ctx as its user_data, submitted and waited for. The copy function of a gfx_turn_ops_t calls it. | |
| uint32_t | gfx_turn_stray_dones (void) |
| Done callbacks that came with a NULL context since start-up. | |
Variables | |
| static atomic_bool | s_shown |
| What the panel shows (gfx_turn_shown()): written by the task that flips, read by the touch task. | |
| atomic_uint | gfx_turn_stray |
| Done callbacks that came with a NULL context; gfx_turn.c. | |
Screen rotation 180° in the flush. See include/gfx_turn.h.
SPDX-License-Identifier: MIT
|
static |
Fall back for this frame: logical into fb as drawn.
| t | the state |
| logical | the logical buffer |
| fb | the frame buffer |
| why | the reason |
| void gfx_turn_begin | ( | gfx_turn_t * | t, |
| const gfx_canvas_t * | logical ) |
Start a frame: drawing turned, the damage record bound to logical, empty and attached; NORMAL, no record attached.
| t | the state |
| logical | the canvas the frame is drawn on |
| bool gfx_turn_drawing | ( | const gfx_turn_t * | t | ) |
Whether the frame being drawn goes into a logical buffer.
| t | the state |
| gfx_turn_copy_t gfx_turn_engine_copy | ( | const gfx_turn_engine_t * | e, |
| const gfx_color_t * | src, | ||
| gfx_color_t * | dst, | ||
| gfx_rect_t | r, | ||
| int | width, | ||
| int | height, | ||
| uint32_t | budget_us ) |
One block through e: the job built from r with e->done_ctx as its user_data, submitted and waited for. The copy function of a gfx_turn_ops_t calls it.
| e | the engine |
| src | the logical buffer |
| dst | the frame buffer of the same index |
| r | the block, in src's coordinates |
| width | both pictures' width, pixels |
| height | their height, rows |
| budget_us | the longest wait, us |
e, its done_ctx or a callback is missing or the engine refuses the job; GFX_TURN_COPY_TIMEOUT when the done callback does not come in time | void gfx_turn_fail | ( | gfx_turn_t * | t, |
| gfx_turn_fail_t | why ) |
Fall back to NORMAL until the next start.
| t | the state |
| why | the reason, not GFX_TURN_FAIL_NONE |
| gfx_turn_show_t gfx_turn_flush | ( | gfx_turn_t * | t, |
| const gfx_color_t * | logical, | ||
| gfx_color_t * | fb, | ||
| const gfx_turn_ops_t * | ops ) |
End a frame: copy what it drew into fb, turned.
Detaches the damage record. NORMAL copies nothing. Turned, the record's rectangles, or the whole picture while full flips are left, go through ops within GFX_TURN_BUDGET_US; a copy that times out or fails makes the frame the logical buffer as drawn, unturned, and the state fallen back.
| t | the state |
| logical | the logical buffer the frame was drawn into |
| fb | the frame buffer of the same index |
| ops | the copy engine |
fb now holds | void gfx_turn_init | ( | gfx_turn_t * | t, |
| int | width, | ||
| int | height ) |
NORMAL, nothing failed, for a width x height picture; the shown flag NORMAL too.
| t | the state |
| width | the picture's width, pixels |
| height | its height, rows |
| void gfx_turn_next | ( | gfx_turn_t * | t | ) |
After a flip: take the request for the next frame.
A switch asks the UI for a whole repaint (gfx_turn_take_repaint()), and a switch to 180° copies the whole picture for GFX_TURN_FULL_FLIPS flips. A request for 180° that meets a fallback asks for its alert once.
| t | the state |
| bool gfx_turn_presented | ( | gfx_turn_t * | t, |
| gfx_turn_show_t | show ) |
The frame of the last flush is on the glass: set the shown flag.
| t | the state |
| show | what that flush returned |
| void gfx_turn_request | ( | gfx_turn_t * | t, |
| bool | turned ) |
What the setting asks for; taken at the next gfx_turn_next().
| t | the state |
| turned | true for 180° |
| bool gfx_turn_shown | ( | void | ) |
What the panel shows: the one flag picture and touch turn by. Read from any task.
| uint32_t gfx_turn_stray_dones | ( | void | ) |
Done callbacks that came with a NULL context since start-up.
| bool gfx_turn_take_alert | ( | gfx_turn_t * | t | ) |
Whether the fallback's alert is due; clears it.
| t | the state |
| bool gfx_turn_take_repaint | ( | gfx_turn_t * | t | ) |
Whether the UI must repaint everything before the next frame; clears it.
| t | the state |