Commit graph

438 commits

Author SHA1 Message Date
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
bunnie
921be1cf8b add bounds checking to a TextView string length
Before xous-ipc's fixed-length string guaranteed this thing
fit into a single page. Now, we can send potentially unbounded
amounts of text between servers.

I don't think it makes sense to send more than a few k of text to
render on the screen at once, given our screen sizes, so I've added
a patch that truncates the text to the previous length that things
would truncate to.

The behavior is the same as before, except that you will
over-allocate memory on the heap in the sending process
as you shove more string data into a TextView than can be rendered.
Previously, the TextView would just truncate the data and discard
the data.

The truncation happens at the point where you try to hand the
record off to another process, so, one could in theory try
to make this recoverable by adding a layer that splits the
textview into more manageable chunks or pages the data, but that
is an exercise for another day.
2024-09-23 17:35:27 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
bunnie
1b0fa6e04b regex search/replace instances of xous_ipc::String to String 2024-09-22 14:24:49 +08:00
bunnie
311154e231 absorb version bump 2024-06-27 00:26:12 +08:00
bunnie
8414f08aae autoformat the logo file 2024-06-16 02:10:27 +08:00
bunnie
fe6fad2847 change the boot logo in the graphics server 2024-06-16 01:52:28 +08:00
bunnie
782e94aa65 add mappings for additional fonts in cramium target 2024-06-13 22:06:04 +08:00
bunnie
5f05e15105 add backing storage
this is used to accelerate menu foreground/background as well
as susres
2024-06-13 22:05:20 +08:00
bunnie
a360f3ee52 bump xous pins for RawTrng API 2024-06-13 15:49:35 +08:00
bunnie
73b075716b add cramium panic display support 2024-05-31 20:44:46 +08:00
bunnie
a40466b7b4 heap-allocate the framebuffer
this will make memory utilization a bit more efficient than
a heap-allocated page where a portion is wasted
2024-05-31 20:43:53 +08:00
bunnie
fba2736fff fix typo 2024-05-31 20:43:44 +08:00
bunnie
ea5e57bbc9 add cramium's version of the panic handler 2024-05-31 20:42:54 +08:00
bunnie
b175ffaddf add Precursor's panic handler 2024-05-31 20:42:33 +08:00
bunnie
4e347c3ad6 split panic handler into hardware-specific versions 2024-05-31 20:42:11 +08:00
bunnie
35e7cf3a5b bump xous dep revs 2024-05-29 02:07:06 +08:00
bunnie
c7036c1309 fix cram-soc impl for graphics 2024-05-28 23:04:16 +08:00
bunnie
34cfc7db5b temporarily allow more graphics server connections
this is for early testing and debug -- there's a note to
revert this in the console log once we're done with that.
2024-05-23 14:51:11 +08:00
bunnie
65caa55407 bump to minifb 0.26.0
solves #538
2024-05-12 12:32:45 +08:00
bunnie
52e5d21e6f work around white screen issue on Windows 11 (#538)
This is the work-around suggested at

https://github.com/emoon/rust_minifb/issues/351

until a new release is tagged.
2024-05-10 00:33:59 +08:00
bunnie
9e66c1bee2 commit the version bump 2024-05-07 01:03:05 +08:00
bunnie
d5b9036531 allow for alternate pin mapping on graphics server
use the SPIM port that is broken for QSPI for the display...
2024-05-06 02:29:34 +08:00
bunnie
7af47ec260 cleanup warnings, remove dead code 2024-04-29 04:07:08 +08:00
bunnie
f86b51a3b2 cleanup warning 2024-04-29 04:06:52 +08:00
bunnie
36534b4e3a frequency now confirmed 2024-04-28 02:42:18 +08:00
bunnie
c57debcf1c adjust location of fontmap to match latest build 2024-04-28 02:41:58 +08:00
bunnie
799d1554ae chore: CI fixes 2024-04-09 18:51:36 +08:00
bunnie
d6b33159a5 stage version pin bump 2024-04-01 15:46:26 +08:00
bunnie
699004e7b0 bump xous pins 2024-02-06 14:49:10 +08:00
bunnie
fdf10f369e fix default font settings
there's something....weird....going on in the initializers
here and ... something about configurations not being
applicable to expressions??

i'm a little confused, but, the original work-around I had to
this isuse somehow side-effected things in some way that I didn't
expect. this reverts those side effects.
2024-01-30 00:02:42 +08:00
bunnie
d0bf87d2e7 remove default feature that was used for configuring vscode 2024-01-29 03:47:48 +08:00
bunnie
fb7fccce6b susres not yet active in cramium target, make opcode conditional 2024-01-29 03:39:11 +08:00
bunnie
d58ef8c1df improve debug output on graphics-server 2024-01-29 03:38:43 +08:00
bunnie
1c9e2e16e7 add generated fontmap file 2024-01-29 03:38:01 +08:00
bunnie
39fb11457f cjk is not in the small font set, substitute Tall for that target 2024-01-29 03:37:25 +08:00
bunnie
f06ceea5e1 bug fixes to frame buffer driver for cramium target
now works, and works pretty well.
2024-01-29 03:34:41 +08:00
bunnie
13041ad043 add cramium-soc target for fonts 2024-01-29 03:33:20 +08:00
bunnie
ce78a24e10 add small font directory for loader 2024-01-29 03:32:54 +08:00
bunnie
2cb295ccf0 add switches for smaller memory targets for the loader side 2024-01-29 03:32:12 +08:00
bunnie
c20f6af52d add small and regular font options
doesn't break the mapping, makes code porting easier because
the character resolution macros don't require adjustment.
2024-01-29 03:31:29 +08:00
bunnie
be8c78a0db add font_map target for cramium 2024-01-28 02:17:31 +08:00
bunnie
70708671fe flesh out the SPIM driver back-end for the graphics driver 2024-01-28 02:16:28 +08:00
bunnie
334495aaec add target hooks to font generation (part I)
a "small" memory target is created, which maps only a subset
of fonts to memory for targets that have extremely limited amounts
of on-chip storage.

the main thing I'm not happy about with this change is that the
origin offset of the font table is hard-coded into the template,
but also, I'm not quite sure if there's a better way to do this
that doesn't make things unnecessarily complicated. The origin
offset *is* target specific, and the templates already
reference targets specifically in the config lists...so if this
were to be made more generic, the path you'd end up on is something
like parsing link.x files out of various configurations which seems
like an extreme amount of work for a constant that rarely changes.

So, it's a footgun, but one where mending the foot is several times
less effort than putting a safety on the footgun.
2024-01-28 02:11:09 +08:00
bunnie
9f8cfde417 update toml's to reflect baremetal->std change 2024-01-27 16:53:35 +08:00
bunnie
c7c384bb85 intermediate work checkin before swapping to sigchat branch 2024-01-26 22:51:13 +08:00
bunnie
13122663f3 intermediate progress, have to switch branch 2024-01-26 01:21:06 +08:00
bunnie
f23e2ee3de start fleshing out a gfx driver for the cramium target
far from complete, lots of warnings, but a good start.
most of the io setup and FB manipulation is done.

The main thing left is to puzzle through the UDMA block and
setup the SPIM accordingly.
2024-01-23 04:01:20 +08:00
bunnie
0267a56989 format Cargo.tomls
because apparently cargo fmt doesn't format Cargo.toml files???
2024-01-15 00:14:39 +08:00
bunnie
454ecac95a fix rustfmt::skip warning
turns out, stackoverflow has out of date info. woohoo!
2024-01-14 23:12:52 +08:00
bunnie
f1e04f189c format services/graphics-server 2024-01-14 22:13:56 +08:00
bunnie
3d6ba05c95 ok...@generated is useless, let's try a different approach.
@generated "marker" needs to be a naked comment on a line by
itself. I'm not quite sure how this is meant to be used, tbh.
2024-01-14 22:01:03 +08:00
bunnie
ee6190a12a prepare for format 2024-01-14 21:51:11 +08:00
Sean Cross
409b50b85e blitstr2: regenerate files after template changes
Regenerate the font files after adjusting the template to generate files
that will not get changed by rustfmt.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:13:16 +08:00
Sean Cross
22546710df blitstr2: codegen: generate rustfmt-compatible code
Generate code that can be put through rustfmt without being altered.
This removes an issue where the font tables can be rearraged by simply
running `rustfmt` on the repository.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:12:26 +08:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
8f549b3031 pick a more "happens to be aesthetic" setting for the XOR op defacing
XOR op should not be usable to create fake security boxes

but it also looks really ugly to have it defaced.

This small tweak makes the XOR function look decent for the initial
purpose of the function (chat status bar wait indicator).

Eventually, this will be a controversial decision, but I'll kick
that down the road.
2023-10-28 22:48:52 +08:00
bunnie
e2594a3000 fix visibility of default font 2023-10-20 00:39:03 +08:00
bunnie
006530a1f5 make the default style for the text box something API-level accessible
this allows other functions to lay out based on the default style
without having to guess it.
2023-10-19 22:39:06 +08:00
bunnie
4e93e903a3 didn't mean to check in this flag 2023-10-19 17:45:09 +08:00
bunnie
64346522b3 make the vertical stripe smaller relative to the overall height
this ratio should be enough to spoil the XOR effect for any
forging application but small enough that it's not as visually distracting.
2023-10-18 15:08:05 +08:00
bunnie
50ef03e319 alternate XOR pattern for busy-bar
this it to avoid abusing the primitive to create inverted text
(for secure UI elements only). It does degrade from the aesthetics
of a busy bar but it is a computationally efficient way to patch
around the concern.
2023-10-18 14:13:25 +08:00
bunnie
2d13e7c2a7 implement an underlying graphics primitive for a busy bar animation
This is just the TextView primitive with a "state" variable added
that controls how far the strips should march across the screen.

Users can specify with or without a bounding box.

The exact location of the text within the bar depends on the
BoundingBox option picked.

The primitive computes the total region to animate based upon
the typesetting engine's output. Thus it is not recommended
to "compress" the amount of whitespace allocated to the animation,
because it can cause the animation to have artifacts due to
whitespace overflow of typesetting.
2023-10-16 14:25:47 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
9f57ad96fd
Merge pull request #408 from nworbnhoj/chat
mtxchat app and chat library
2023-09-19 19:09:56 +08:00
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
Sean Cross
5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
nworbnhoj
a7d3b34563 Merge branch 'main' into chat 2023-09-08 13:48:45 +10:00
nworbnhoj
6362ff9e4d capture typesetting overflow in ComposedType and pass thru to gam.post_textview() 2023-08-26 03:42:05 +10:00
bunnie
53469a68d0 publish package updates, sync to release tag 2023-08-08 14:35:49 +08:00
bunnie
b127cd093f bump version pins for change to xous-rs 2023-08-03 13:29:39 +08:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
dee4871f91 fix truncated "l" in some cases on wide fonts
minimum width should not be truncated to 0 during layout!
2023-07-06 16:15:49 +08:00
bunnie
17fb590d9a fix typsetter overflow check
got the axes inverted. oops.
2023-07-05 15:38:49 +08:00
bunnie
b2c64eb61a aesthetic cleanup; change default font for all modals
I decided to go back on the idea of not changing the modals
and now all modals use the new larger font as well.

This creates issue #396, which I will deal with later once
I have the time to do some more testing. I'm pretty sure
some other dialog boxes are broken now too.
2023-07-05 15:13:38 +08:00
bunnie
4454dffe4e generate loader files for the new font
also sort the font files in alphabetical order now,
instead of relying on arbitrary ordering of os.listdir() :P
2023-07-05 14:44:30 +08:00
bunnie
2f54ae39d4 Merge branch 'fonts' into main 2023-07-05 13:47:26 +08:00
bunnie
dfffa48715 move default system font to gam/src/lib.rs SYSTEM_STYLE
default system font can be statically changed by modifying
the SYSTEM_STYLE constant.

This of course will lead to a request for a dynamically
configurable preference for font size. However, early
on it was decided this is a bad idea. Here's why.

We don't provide for dynamic system-wide font selection
because this adds a lot of complexity to what would otherwise
be static code: this is a deliberate choice to improve code
density and performance. If the system font were dynamically
adjustable, then every character rendered we would potentially
have to query the PDDB for the current system font setting.

The impact of this could be mitigated by caching values but
then what happens when you actually change the font? now
you need a registry to fire messages off to all dependent
crates with cached values to flush their caches and redraw
(or you punt and force a reboot if you change font sizes,
but still, you're creating a dependency on a lot of plumbing
for even the simplest crates).

Plus, with a static font selection, the compiler can take constants
like the font height and compose them with other fitting
parameters into optimized load/stores of borders and spacings
for the static case; if you make it dynamic, all those multiplies,
adds and divides now get pulled into the main rendering loop
and are recomputed all the time. For example, if you have a static
const list of items that need to be rendered, even if the code to
compute the height of the list is written as a for loop, the compiler
will know the list is constant, and the font height is constant,
and it can condense that all into a single number at compile time,
eliminating all the code for the for loop.

If you leave the option open to change that, that entire piece
of code has to be generated and executed even though in practice
nobody changes the parameter.
2023-07-05 13:39:11 +08:00
bunnie
ec3fc70a66 rework the font rendering engine and style macros to support Tall
this reworks the necessary routines on the font rendering engine
and within the style selection macros to support the new Tall font.
2023-07-05 13:37:41 +08:00
bunnie
aab25f2d53 add Tall font face and support for 32x32 bitmaps
Thanks to @samblenny for getting the ball rolling on this.

This commit adds a "tall" font face which is somewhere in betwee
the Regular size (12 pts) and 2x Small size (18 pts). This is
a compromise between text density and readability that has been
missing for some time from the UI.

The 32x32 glyph support is "hacked in", in that an extra flag
has been added to support this special case, rather than either
(a) making the library more generic (e.g. supporting 8x, 16x, 32x, 64x
glyphs) or (b) adding more metadata to the font libraries so that
the bitmap pattern is automatically associated with the font (right
now the parameters are set by hand in blitstr2/fonts.rs).

This is a violation of the "zero, one, many" principle in coding,
but I'm waiving that because (a) 64x glyphs don't make sense on
our system...you're not going to be creating posters and headlines
on this device (ha ha I say this today, tomorrow I will get a PR
for a poster editor app that absolutely needs 64x glyphs) and (b)
the font subsystem is, at least for now, a fairly mature and
well-tested code base so a minor futzing seems more appropriate
than ripping everything out.

The point at which things should be greatly refactored is when
we consider supporting right-to-left scripts or scripts that
require complex ligatures. But I think for now the system as
writ covers 80% of humanity's language needs acceptably
(but not perfectly).
2023-07-05 12:43:44 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
ae1adbfedd fix template to match manual patch-ups on config flags 2023-07-04 10:32:15 +08:00
bunnie
22e0e06625 check in inital artifacts, but leave the system inert
more hacking is necessary before we can really run these scripts
2023-07-04 10:29:43 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
Jean-Pierre De Jesus DIAZ
2af737b57e
xous-rs: move LANG variable to locales
This change is made with the intention of making the xous-rs crate a bit
more freestanding without depending on the xtask build system.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-06-15 18:23:12 +02:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
Sean Cross
6eb6fae061 graphics-server: apply macos patch to fix build
This fixes the build of `graphics-server` on macos.
This is recommended by @bunnie in
https://github.com/betrusted-io/xous-core/issues/373#issuecomment-1526015174

Signed-off-by: Sean Cross <sean@xobs.io>
2023-04-28 00:05:28 +07:00
bunnie
9022fe6827 revert change to patch over macos 2023-04-28 00:31:48 +08:00
yvt
8504b6fc6b fix(graphics-server): convert "never" types
Fixes build failure due to a type mismatch between `Never` and `!`
in `claim_main_thread`.
2023-04-28 01:23:49 +09:00
bunnie
0522cf9c93
Merge pull request #374 from yvt/patch/fix-minifb-on-main-thread
graphics-server: Run `minifb` event loop on main thread
2023-04-28 00:05:23 +08:00
yvt
c9fd805da2 fix(graphics-server): run minifb event loop on main thread
Fixes crashes on macOS.

Some operating systems and GUI frameworks, in particular Cocoa, don't
allow creating an event loop from a thread other than the main thread
(TID 1) and will abort a program on violation.
2023-04-28 00:43:39 +09:00