Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an iterator over XFB rows #25

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

linkmauve
Copy link
Collaborator

This emits slices of u16, and allows users to not use unsafe for drawing.

This is based on #21, since it wouldn’t build on current nightly otherwise.

libstd’s runtime changed the prototype of lang = "start" in
ddee45e1d7fd34563c13513d974f792fae41a2f7 to support changing the SIGPIPE
behaviour on Linux, so this function now takes a third argument on every
platform.

Additionally, it now supports user_main() returning any Termination, so
we don’t need a transmute() any longer. :)
@linkmauve linkmauve marked this pull request as ready for review April 23, 2023 14:47
This fixes the build on current nightly (since 2023-04-22).
This emits slices of u16, and allows users to not use unsafe for
drawing.

/// A struct representing the eXternal FrameBuffer, or XFB. It represents the image that will be
/// sent to the screen, in YUYV format. It must be allocated as contiguous physical memory.
pub struct Xfb {
data: Pin<Box<[u8]>>,
data: Box<[u16]>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data needs to be pinned for the duration of the use of the XFB due to mmio usage. Rust doesn't confirm that the pointer wont move.

Copy link
Collaborator

@ProfElements ProfElements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides one small issue it all looks awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants