Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toerb
flow3r firmware
Commits
359fb894
Commit
359fb894
authored
1 year ago
by
pippin
Committed by
pippin
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
st3m/gfx: make empty drawlists skip render and blit
parent
f8c0cb9b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/st3m/st3m_gfx.c
+15
-2
15 additions, 2 deletions
components/st3m/st3m_gfx.c
components/st3m/st3m_gfx.h
+4
-2
4 additions, 2 deletions
components/st3m/st3m_gfx.h
python_payload/st3m/reactor.py
+3
-1
3 additions, 1 deletion
python_payload/st3m/reactor.py
with
22 additions
and
5 deletions
components/st3m/st3m_gfx.c
+
15
−
2
View file @
359fb894
...
...
@@ -81,7 +81,8 @@ static void st3m_gfx_crtc_task(void *_arg) {
st3m_counter_timer_sample
(
&
blit_read_time
,
end
-
start
);
start
=
esp_timer_get_time
();
flow3r_bsp_display_send_fb
(
framebuffer_descs
[
descno
].
buffer
);
if
(
!
framebuffer_descs
[
descno
].
empty
)
flow3r_bsp_display_send_fb
(
framebuffer_descs
[
descno
].
buffer
);
end
=
esp_timer_get_time
();
st3m_counter_timer_sample
(
&
blit_work_time
,
end
-
start
);
...
...
@@ -131,7 +132,19 @@ static void st3m_gfx_rast_task(void *_arg) {
// Render drawctx into fbctx.
start
=
esp_timer_get_time
();
ctx_render_ctx
(
draw
->
ctx
,
fb
->
ctx
);
int
count
=
0
;
const
CtxEntry
*
drawlist
=
ctx_get_drawlist
(
draw
->
ctx
,
&
count
);
// XXX maybe we should just rely on count < 4 meaning empty,
// this is after-all a time critical path
if
((
count
==
4
&&
(
drawlist
[
0
].
code
==
CTX_SAVE
)
&&
(
drawlist
[
1
].
code
==
CTX_SAVE
))
||
count
<=
2
)
{
fb
->
empty
=
1
;
}
else
{
fb
->
empty
=
0
;
ctx_render_ctx
(
draw
->
ctx
,
fb
->
ctx
);
}
ctx_drawlist_clear
(
draw
->
ctx
);
end
=
esp_timer_get_time
();
st3m_counter_timer_sample
(
&
rast_work_time
,
end
-
start
);
...
...
This diff is collapsed.
Click to expand it.
components/st3m/st3m_gfx.h
+
4
−
2
View file @
359fb894
...
...
@@ -18,6 +18,8 @@
typedef
struct
{
// The numeric ID of this descriptor.
int
num
;
// set when the drawlist was empty
int
empty
;
// SPIRAM buffer.
uint16_t
buffer
[
240
*
240
];
Ctx
*
ctx
;
...
...
@@ -50,7 +52,7 @@ uint8_t st3m_gfx_drawctx_pipe_full(void);
// Flush any in-flight pipelined work, resetting the free ctx/framebuffer queues
// to their initial state. This should be called if there has been any drawlist
// ctx dropped (ie. drawctx_free_get was called but then drawctx_pipe_put
// wasn't, for exaple if Micropython restarted).
// wasn't, for exa
m
ple if Micropython restarted).
//
// This causes a graphical disturbance and shouldn't be called during normal
// operation.
...
...
@@ -74,4 +76,4 @@ void st3m_gfx_splash(const char *text);
// Draw the flow3r multi-coloured logo at coordinates x,y and with given
// dimension (approx. bounding box size).
void
st3m_gfx_flow3r_logo
(
Ctx
*
ctx
,
float
x
,
float
y
,
float
dim
);
\ No newline at end of file
void
st3m_gfx_flow3r_logo
(
Ctx
*
ctx
,
float
x
,
float
y
,
float
dim
);
This diff is collapsed.
Click to expand it.
python_payload/st3m/reactor.py
+
3
−
1
View file @
359fb894
...
...
@@ -40,7 +40,9 @@ class Responder(ABCBase):
coordinates are +/- 120 in both X and Y (positive numbers towards up and
right), with 0,0 being the middle of the screen.
The Reactor will then rasterize and blit the result.
The Reactor will then rasterize and blit the result. If no ctx drawing
commands are issued, it is interpreted as a wish to keep the display
contents as-is, and cpu time is not spent on rasterization and blitting.
The code must not sleep or block during this callback, as that will
impact the system tickrate and framerate.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment