45#define GFX_TURN_BUDGET_US 50000u
48#define GFX_TURN_FULL_FLIPS 2u
101 const gfx_color_t *
in;
262 const gfx_color_t *src,
264 int width,
int height,
279 if (user_data == NULL) {
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
Damage: the part of one frame buffer the rasteriser wrote since the last reset, kept as 16-row bands ...
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.
Definition gfx_turn.c:83
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,...
Definition gfx_turn.c:54
bool gfx_turn_take_alert(gfx_turn_t *t)
Whether the fallback's alert is due; clears it.
Definition gfx_turn.c:175
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...
Definition gfx_turn.c:189
bool gfx_turn_shown(void)
What the panel shows: the one flag picture and touch turn by. Read from any task.
Definition gfx_turn.c:184
bool gfx_turn_take_repaint(gfx_turn_t *t)
Whether the UI must repaint everything before the next frame; clears it.
Definition gfx_turn.c:166
void gfx_turn_request(gfx_turn_t *t, bool turned)
What the setting asks for; taken at the next gfx_turn_next().
Definition gfx_turn.c:31
void gfx_turn_next(gfx_turn_t *t)
After a flip: take the request for the next frame.
Definition gfx_turn.c:148
void gfx_turn_fail(gfx_turn_t *t, gfx_turn_fail_t why)
Fall back to NORMAL until the next start.
Definition gfx_turn.c:38
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.
Definition gfx_turn.c:20
atomic_uint gfx_turn_stray
Done callbacks that came with a NULL context; gfx_turn.c.
Definition gfx_turn.c:18
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.
Definition gfx_turn.c:141
bool gfx_turn_drawing(const gfx_turn_t *t)
Whether the frame being drawn goes into a logical buffer.
Definition gfx_turn.c:49
uint32_t gfx_turn_stray_dones(void)
Done callbacks that came with a NULL context since start-up.
Definition gfx_turn.c:218
gfx_turn_fail_t
Why the flush fell back to NORMAL.
Definition gfx_turn.h:58
@ GFX_TURN_FAIL_ERROR
Definition gfx_turn.h:61
@ GFX_TURN_FAIL_TIMEOUT
Definition gfx_turn.h:60
@ GFX_TURN_FAIL_NONE
Definition gfx_turn.h:59
@ GFX_TURN_FAIL_ENGINE
Definition gfx_turn.h:62
gfx_turn_copy_t
How one copy ended.
Definition gfx_turn.h:51
@ GFX_TURN_COPY_DONE
Definition gfx_turn.h:52
@ GFX_TURN_COPY_TIMEOUT
Definition gfx_turn.h:53
@ GFX_TURN_COPY_ERROR
Definition gfx_turn.h:54
static void * gfx_turn_done_ctx(void *user_data)
The done callback's first step: the context it was given, or NULL, counted in gfx_turn_stray_dones(),...
Definition gfx_turn.h:277
gfx_turn_show_t
What a flush leaves in the frame buffer.
Definition gfx_turn.h:66
@ GFX_TURN_SHOW_FALLBACK
Definition gfx_turn.h:69
@ GFX_TURN_SHOW_TURNED
Definition gfx_turn.h:68
@ GFX_TURN_SHOW_NORMAL
Definition gfx_turn.h:67
What one buffer has had written since gfx_damage_reset().
Definition gfx_damage.h:44
An engine that takes a job, ends it later in an interrupt that calls its done callback with the job's...
Definition gfx_turn.h:118
bool(*) wait(void *engine, uint32_t budget_us)
Wait for the job's done callback.
Definition gfx_turn.h:132
bool(*) submit(void *engine, const gfx_turn_job_t *job)
Start job.
Definition gfx_turn.h:125
void * done_ctx
Definition gfx_turn.h:134
void * engine
Definition gfx_turn.h:133
One block as the copy engine takes it: where it is read, where it lands turned, and the context the e...
Definition gfx_turn.h:100
gfx_rect_t src
Definition gfx_turn.h:105
const gfx_color_t * in
Definition gfx_turn.h:101
int16_t width
Definition gfx_turn.h:103
void * user_data
Definition gfx_turn.h:108
int16_t dst_x
Definition gfx_turn.h:106
int16_t dst_y
Definition gfx_turn.h:107
int16_t height
Definition gfx_turn.h:104
gfx_color_t * out
Definition gfx_turn.h:102
The copy engine.
Definition gfx_turn.h:73
gfx_turn_copy_t(*) copy(void *ctx, const gfx_color_t *src, gfx_color_t *dst, gfx_rect_t r, uint32_t budget_us)
Copy block r of src into dst, turned by 180°, and wait for it.
Definition gfx_turn.h:84
uint32_t(*) now_us(void *ctx)
The time, us; differences wrap.
Definition gfx_turn.h:92
void * ctx
Definition gfx_turn.h:93
The rotation's state.
Definition gfx_turn.h:139
bool failed
Definition gfx_turn.h:145
uint8_t full_left
Definition gfx_turn.h:150
bool alerted
Definition gfx_turn.h:147
bool alert
Definition gfx_turn.h:149
int16_t width
Definition gfx_turn.h:141
gfx_damage_t damage
Definition gfx_turn.h:140
uint32_t copy_us
Definition gfx_turn.h:153
uint16_t rects
Definition gfx_turn.h:151
bool drawing
Definition gfx_turn.h:144
bool requested
Definition gfx_turn.h:143
bool repaint
Definition gfx_turn.h:148
gfx_turn_fail_t why
Definition gfx_turn.h:146
int16_t height
Definition gfx_turn.h:142
uint32_t pixels
Definition gfx_turn.h:152