Commit graph

51 commits

Author SHA1 Message Date
bunnie
e240ca6499 refactor the hardware boot screen
- remove a blanking operation. this makes the transision from
loader to runtime almost imperceptably smoother
- add the ability to summon the logo screen earlier in the process

Note that only GAM can call GFX, so, it's alright to expose that
API, since GAM should gate-keep and prevent abuse of that function.
2022-11-06 03:10:00 +08:00
bunnie
4e40ae6c5d move from target selectors to feature selectors for back-ends
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.

The downsides are:

- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.

- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
2022-10-02 02:56:44 +08:00
bunnie
148bf71a94 modify the fb pop routine so it doesn't overwrite the status bar
this eliminates a small glitch in the time display/security infos
whenever transitioning between foreground/background contexts
2022-07-05 03:24:15 +08:00
bunnie
147ec8594c add stash/pop of FB; fix suspend/resume buffering
The `ManagedMem` thing for the suspend/resume crate is simply
a disaster. It tries to be fancy and Rusty and really it just fails
in non-obvious ways. This is one of the places where it simply
does not pay to make things seem so simple.

Why? because in reality, memory is complicated. It comes in pages.
There's initialization. There's caching. There's volatility.
I haven't encountered a single situation where the assumptions
of page-alignment and memory layout have really lined up well enough
for this primitive to make sense. The "idea" was hey, since
you allocate a peripheral MemoryRegion, why not just use its attributes
as a marker to a suspend/resume thing that automatically handled
stashing that MemoryRegion to a backing store inside RAM? Seems
simple right? wrong. Every time I've tried to use it, it's failed
in non-obvious ways.

In this most recent incarnation, it turns out that for whatever
reason, it seems to be just stashing about the first 4-8k of the
framebuffer to the SR backup region, and then somehow grabbing
a future(?) copy of the memory? or maybe just a wrong copy? I don't
know. The code seems simple enough but it goes through some
traits and some type transformations and then there's some unsafe
code to make it volatile and it doesn't work.

Instead, we just use a damn [u32; FB_SIZE] slice to store the
frame buffer. This is so obvious and easy. The only price is
you have an "ugly" `fb[..FB_SIZE].copy_from_slice(&self.srfb)`
line instead of an "elegant" `srfb.suspend()` invocation.
Stashing into it is a bit uglier, because we have to cast the
slice to an unsafe pointer in order to access the `write_volatile()`
method. But, it works! It. Just. Works. And you can see what's going
on. Really, I should stop trying to be fancy and just be readable.

OK anyways, that was that rant. This commit also adds some
calls that allow us to re-use the suspend/resume frame buffer during
"normal" times as a stash/pop for the application image. This is
nice because the memory is normally idle/overhead when not
in suspend, so now we're repurposing some already-allocated memory
to accelerate some drawing operations, and it also makes, crucially,
a multi-step blocking modal dialog interaction less cosmetically
jarring, because the application thread can be fully blocked and
not responding to redraw commands but the stash/pop mechanism
creates the illusion of "everything is moving along".
2022-07-05 02:44:13 +08:00
bunnie
7353c3ab9c add guru meditations 2022-04-10 04:42:02 +08:00
bunnie
04d074de1b fix hosted mode build 2022-03-29 22:55:27 +08:00
bunnie
1455ea6d8b clean up the suspend/resume path for the screen and enforce redraw 2022-03-29 22:50:25 +08:00
Alex Tibbles
f6030fe213
build fix for 5452fae33c 2022-03-28 17:01:25 -04:00
bunnie
5452fae33c harmonize blitstr2 and graphics-server to an i16 pixel representation
previously blitstr2 is using usize for x/y coords, which means that
for layout purposes points could not go to the top or left boundary
without causing arithmetic overflow. Of course, you want to render
everything on-screen, but, as we have multi-line text with overflow
possibility, it's reasonable to be able to use negative coordinates
to locate text boxes that flow into the visible region.

This of course means that occassionally you can come out with
things like "negative widths", but even then, there can be reasonable
uses for this as an intermediate in calculations that ultimately
arrive at a positive result.
2022-03-28 23:17:18 +08:00
Blake Smith
77b5e7a2bb During sleep, clear the rest of the screen, to avoid
any secrets being persistently visible on the display.
2022-03-20 15:35:02 -05:00
bunnie
4df39797c1 fix issue #101 based on @xobs changes 2022-02-15 17:36:53 +08:00
bunnie
32c3f03609 prevent double-injections on windows 2022-02-10 03:04:05 +08:00
bunnie
feec219070 fix bs/del/enter on posix platforms 2022-02-10 02:59:47 +08:00
bunnie
fd5c6568d1 trim out some excess redraw calls that are slowing down boot 2022-02-05 18:55:46 +08:00
bunnie
a7c9027d05 make the COM reset no longer open loop; unblock as soon as EC responds 2022-02-05 15:44:47 +08:00
bunnie
2db96e17b0 modify minifb integration to use host keymaps for most printable characters
this allows e.g. dvorak key maps to work while still picking up
all of the special keys that don't correspond to to any unicode
characters
2022-01-25 23:03:57 +08:00
bunnie
2b46f21ae8 remove dependency on blitstr v1 entirely 2022-01-23 04:08:32 +08:00
bunnie
7277b7bc1d start to refactor out the old blitstr v1 apis 2022-01-21 15:01:56 +08:00
bunnie
a46c07b4be initial attempt to integrate blitstr2
this just grafts in the new crate, while leaving the old crate
unscathed. once this is somewhat functional we'll excise the old
crate and reformat the loader for the "hard binary" image of
the fonts.
2022-01-19 03:29:53 +08:00
bunnie
1ed606fa7d very rudimentary pddb dumper for debugging.
yah, I know. :-/

anyways.
2021-11-12 22:57:37 +08:00
bunnie
bdbaba027b improve drawing performance
the trailing update after every event seems redundant now that
the gam is cleaned up

also fix a bug that causes overflow text on tl fitted text
to overflow the drawing region
2021-09-18 02:21:12 +08:00
bunnie
9aef2eb7b4 fix dirty rectangles on resume 2021-09-16 03:53:04 +08:00
bunnie
4882016d08 add a graphics test routine for OQC
invoked via the GAM, callable exactly once per boot for up
to 60 seconds.
2021-09-16 01:00:22 +08:00
Sean Cross
88b63916e4 graphics-server: run rustfmt
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 22:52:06 +08:00
Sean Cross
2a77c38a6a minifb: remove fps limiter
The fps limiter ends up blocking the whole system due to how it limits
the framerate.

If we want to put in a proper rate limiter, we should move the Server
into a different thread and keep just the framebuffer on the main
thread.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-16 22:51:13 +08:00
bunnie
ccc577f8d7 clean up the update flow 2021-08-16 02:46:54 +08:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
00be94d913 devboot mode support 2021-07-03 21:08:39 +08:00
bunnie
f4fbe84b78 improve redraw performance on menu
it helps to actually redraw the menu instead of relying
upon status updates to redo the Ux.
2021-06-20 00:44:59 +08:00
bunnie
c0d4cbe81d make the menu object more generic; demo with emoji selection 2021-06-19 04:44:21 +08:00
bunnie
2b5ba61552 add some useful messages on boot for the hosted mode users 2021-06-19 01:05:42 +08:00
bunnie
aa967a5a17 quiet up hosted mode build warnings 2021-06-18 22:37:08 +08:00
bunnie
0ca2f58c6e add a note to indicate if we're in cold sleep
it's not terribly aesthetic right now, but we can fix that later.
2021-05-02 03:36:54 +08:00
bunnie
b17753ce8b retrofit the rest of the servers for suspend/resume
we can now do suspend/resume in the xous chat!
2021-05-02 01:38:44 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
470b5c6440 finalize API refactor for xous-names 2021-03-30 02:13:23 +08:00
bunnie
0950467a37 Merge branch 'hardware' of https://github.com/betrusted-io/xous-core into hardware 2021-03-13 18:15:37 +08:00
bunnie
5c1940a019 change the name of the window 2021-03-13 18:15:30 +08:00
Sean Cross
e1890b1717 graphics-server: buffer keypresses
Buffer keypresses so that keys are not lost. This improves
responsiveness, although there are still kernel plumbing issues.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-03-13 18:01:12 +08:00
bunnie
63159e50db wire up some function keys in hosted mode, add some fun glyphs for testing 2021-03-10 01:58:38 +08:00
bunnie
547dbbfe6b fix carriage return emulation and handling 2021-03-06 03:26:13 +08:00
bunnie
0cc1f9f5fb it doesn't look that impressive, but there's a lot of plumbing now. 2021-03-06 01:10:18 +08:00
bunnie
0dc40f4185 attempt to separate fontmaps and loader out of kernel 2021-02-27 02:12:19 +08:00
bunnie
72b8d6a3de add keyboard input emulation in hosted mode 2021-01-13 23:17:09 +08:00
bunnie
95cbf42cf2 refactor frame buffer to use double buffering 2021-01-13 04:39:04 +08:00
bunnie
2958858a3a refactor to use UTRA for control registers 2021-01-13 01:17:43 +08:00
Sean Cross
147100fa38 graphics-server: minifb: use iterators for drawing the screen
This removes the bounds checks that were being performed, and goes for a
pure iterator approach.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-07 20:30:42 +08:00
bunnie
ec675eefb4 cleanup warnings 2021-01-05 04:45:23 +08:00
Sean Cross
7b50d00eb8 repo: run cargo fmt
This reformats line endings to be consistent, and reinforces the
contents of `.gitattributes`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-01-03 18:31:51 +08:00
Sean Cross
7607b0f9ee graphics-server: remove embedded-graphics from backends
Use native drawing for these platforms.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-10-30 10:21:06 +08:00