Skip to content

Commit e240ca6

Browse files
committed
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.
1 parent 7eecf2b commit e240ca6

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

services/graphics-server/src/api.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ pub(crate) enum Opcode {
119119
/// SuspendResume callback
120120
SuspendResume,
121121

122+
/// draw the boot logo (for continuity as apps initialize)
123+
DrawBootLogo,
124+
122125
Quit,
123126
}
124127

services/graphics-server/src/backend/betrusted.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ impl XousDisplay {
6868
display
6969
.susres
7070
.push(RegOrField::Field(utra::memlcd::PRESCALER_PRESCALER), None);
71-
display.sync_clear();
7271

7372
/*
7473
use log::{error, info};
@@ -255,6 +254,7 @@ impl XousDisplay {
255254

256255
/// "synchronous clear" -- must be called on init, so that the state of the LCD
257256
/// internal memory is consistent with the state of the frame buffer
257+
/*
258258
fn sync_clear(&mut self) {
259259
let framebuffer = self.fb.as_mut_ptr() as *mut u32;
260260
for words in 0..FB_SIZE {
@@ -267,6 +267,7 @@ impl XousDisplay {
267267
self.update_all(); // because we force an all update here
268268
while self.busy() {}
269269
}
270+
*/
270271

271272
fn busy(&self) -> bool {
272273
self.csr.rf(utra::memlcd::BUSY_BUSY) == 1

services/graphics-server/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ impl Gfx {
108108
.map(|_| ())
109109
}
110110

111+
pub fn draw_boot_logo(&self) -> Result<(), xous::Error> {
112+
send_message(
113+
self.conn,
114+
Message::new_scalar(Opcode::DrawBootLogo.to_usize().unwrap(), 0, 0, 0, 0),
115+
)
116+
.map(|_| ())
117+
}
118+
111119
pub fn screen_size(&self) -> Result<Point, xous::Error> {
112120
let response = send_message(
113121
self.conn,

services/graphics-server/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fn wrapped_main() -> ! {
112112
log::info!("my PID is {}", xous::process::id());
113113

114114
let mut display = XousDisplay::new();
115+
draw_boot_logo(&mut display); // bring this up as soon as possible
115116
let fontregion = map_fonts();
116117

117118
// install the graphical panic handler. It won't catch really early panics, or panics in this crate,
@@ -139,8 +140,6 @@ fn wrapped_main() -> ! {
139140
.register_name(api::SERVER_NAME_GFX, Some(1))
140141
.expect("can't register server");
141142

142-
draw_boot_logo(&mut display);
143-
144143
let screen_clip = Rectangle::new(Point::new(0, 0), display.screen_size());
145144

146145
display.redraw();
@@ -459,6 +458,11 @@ fn wrapped_main() -> ! {
459458
display.update();
460459
display.redraw();
461460
}),
461+
Some(Opcode::DrawBootLogo) => msg_scalar_unpack!(msg, _, _, _, _, {
462+
display.blit_screen(&poweron::LOGO_MAP);
463+
display.update();
464+
display.redraw();
465+
}),
462466
Some(Opcode::Devboot) => msg_scalar_unpack!(msg, ena, _, _, _, {
463467
if ena != 0 {
464468
display.set_devboot(true);

0 commit comments

Comments
 (0)