diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 5b2999b2a6..8ac6148dc1 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -427,7 +427,7 @@ install_config { - + } [log_route] { @@ -610,7 +610,7 @@ install_config { - + @@ -662,7 +662,7 @@ install_config { - + diff --git a/repos/gems/src/app/phone_manager/main.cc b/repos/gems/src/app/phone_manager/main.cc index 4e0ad0bd54..137699de0c 100644 --- a/repos/gems/src/app/phone_manager/main.cc +++ b/repos/gems/src/app/phone_manager/main.cc @@ -2129,13 +2129,12 @@ void Sculpt::Main::_handle_gui_mode() if (mode.area.count() > 1) _gui_mode_ready = true; - _update_window_layout(); - _screen_size = mode.area; _main_view.min_width = _screen_size.w(); _main_view.min_height = _screen_size.h(); generate_runtime_config(); + _update_window_layout(); } @@ -2399,9 +2398,12 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const }); _drivers.gen_start_nodes(xml); + _dialog_runtime.gen_start_nodes(xml); _storage.gen_runtime_start_nodes(xml); - _touch_keyboard.gen_start_node(xml); + + if (_system.storage_stage) /* touch keyboard not needed at earliest boot stage */ + _touch_keyboard.gen_start_node(xml); /* * Load configuration and update depot config on the sculpt partition diff --git a/repos/gems/src/app/sculpt_manager/deploy.h b/repos/gems/src/app/sculpt_manager/deploy.h index d39da81484..eefe4261ac 100644 --- a/repos/gems/src/app/sculpt_manager/deploy.h +++ b/repos/gems/src/app/sculpt_manager/deploy.h @@ -62,16 +62,18 @@ struct Sculpt::Deploy Arch _arch { }; Child_state cached_depot_rom_state { - _child_states, { .name = "depot_rom", - .priority = Priority::STORAGE, - .initial = { Ram_quota{24*1024*1024}, Cap_quota{200} }, - .max = { Ram_quota{2*1024*1024*1024UL}, { } } } }; + _child_states, { .name = "depot_rom", + .priority = Priority::STORAGE, + .cpu_quota = 0, + .initial = { Ram_quota{24*1024*1024}, Cap_quota{200} }, + .max = { Ram_quota{2*1024*1024*1024UL}, { } } } }; Child_state uncached_depot_rom_state { - _child_states, { .name = "dynamic_depot_rom", - .priority = Priority::STORAGE, - .initial = { Ram_quota{8*1024*1024}, Cap_quota{200} }, - .max = { Ram_quota{2*1024*1024*1024UL}, { } } } }; + _child_states, { .name = "dynamic_depot_rom", + .priority = Priority::STORAGE, + .cpu_quota = 0, + .initial = { Ram_quota{8*1024*1024}, Cap_quota{200} }, + .max = { Ram_quota{2*1024*1024*1024UL}, { } } } }; /* * Report written to '/config/managed/deploy' diff --git a/repos/gems/src/app/sculpt_manager/dialog/distant_runtime.cc b/repos/gems/src/app/sculpt_manager/dialog/distant_runtime.cc index 4899916087..9126cf5727 100644 --- a/repos/gems/src/app/sculpt_manager/dialog/distant_runtime.cc +++ b/repos/gems/src/app/sculpt_manager/dialog/distant_runtime.cc @@ -167,10 +167,15 @@ void Distant_runtime::gen_start_nodes(Xml_generator &xml) const xml.attribute("priority", (int)Priority::LEITZENTRALE); xml.attribute("caps", _caps.value); - xml.node("resource", [&] { - xml.attribute("name", "RAM"); - Number_of_bytes const bytes(_ram.value); - xml.attribute("quantum", String<64>(bytes)); }); + auto resource = [&] (auto const &type, auto const &amount) + { + xml.node("resource", [&] { + xml.attribute("name", type); + xml.attribute("quantum", String<64>(amount)); }); + }; + + resource("RAM", Number_of_bytes(_ram.value)); + resource("CPU", 20); xml.node("binary", [&] { xml.attribute("name", "menu_view"); }); diff --git a/repos/gems/src/app/sculpt_manager/driver/fb.h b/repos/gems/src/app/sculpt_manager/driver/fb.h index f7786d4b9a..800505ada1 100644 --- a/repos/gems/src/app/sculpt_manager/driver/fb.h +++ b/repos/gems/src/app/sculpt_manager/driver/fb.h @@ -137,8 +137,13 @@ struct Sculpt::Fb_driver : private Noncopyable Ram_quota { 8*1024*1024 }, Cap_quota { 110 }); _soc_fb.conditional(board_info.soc.fb && board_info.options.display, - registry, "fb", Priority::MULTIMEDIA, - Ram_quota { 16*1024*1024 }, Cap_quota { 250 }); + registry, Child_state::Attr { + .name = "fb", + .priority = Priority::MULTIMEDIA, + .cpu_quota = 20, + .initial = { Ram_quota { 16*1024*1024 }, + Cap_quota { 250 } }, + .max = { } } ); if (use_boot_fb && !_boot_fb.constructed()) Boot_fb::with_mode(platform, [&] (Boot_fb::Mode mode) { diff --git a/repos/gems/src/app/sculpt_manager/driver/touch.h b/repos/gems/src/app/sculpt_manager/driver/touch.h index f21e7c5fe2..1726fb996a 100644 --- a/repos/gems/src/app/sculpt_manager/driver/touch.h +++ b/repos/gems/src/app/sculpt_manager/driver/touch.h @@ -47,8 +47,13 @@ struct Sculpt::Touch_driver : private Noncopyable void update(Registry ®istry, Board_info const &board_info) { _soc.conditional(board_info.soc.touch && board_info.options.display, - registry, "touch", Priority::MULTIMEDIA, - Ram_quota { 10*1024*1024 }, Cap_quota { 250 }); + registry, Child_state::Attr { + .name = "touch", + .priority = Priority::MULTIMEDIA, + .cpu_quota = 10, + .initial = { Ram_quota { 10*1024*1024 }, + Cap_quota { 250 } }, + .max = { } } ); } }; diff --git a/repos/gems/src/app/sculpt_manager/model/child_state.h b/repos/gems/src/app/sculpt_manager/model/child_state.h index 1628a8c553..b4a613c1d2 100644 --- a/repos/gems/src/app/sculpt_manager/model/child_state.h +++ b/repos/gems/src/app/sculpt_manager/model/child_state.h @@ -34,6 +34,7 @@ struct Sculpt::Child_state : Noncopyable { Start_name name; Priority priority; + unsigned cpu_quota; struct Initial { Ram_quota ram; Cap_quota caps; } initial; struct Max { Ram_quota ram; Cap_quota caps; } max; @@ -71,10 +72,11 @@ struct Sculpt::Child_state : Noncopyable Child_state(Registry ®istry, auto const &name, Priority priority, Ram_quota initial_ram, Cap_quota initial_caps) : - Child_state(registry, { .name = name, - .priority = priority, - .initial = { initial_ram, initial_caps }, - .max = { } }) + Child_state(registry, { .name = name, + .priority = priority, + .cpu_quota = 0, + .initial = { initial_ram, initial_caps }, + .max = { } }) { } void trigger_restart() @@ -98,9 +100,14 @@ struct Sculpt::Child_state : Noncopyable xml.attribute("caps", _cap_quota.value); xml.attribute("priority", (int)_attr.priority); + gen_named_node(xml, "resource", "RAM", [&] { Number_of_bytes const bytes(_ram_quota.value); xml.attribute("quantum", String<64>(bytes)); }); + + if (_attr.cpu_quota) + gen_named_node(xml, "resource", "CPU", [&] { + xml.attribute("quantum", _attr.cpu_quota); }); } /** diff --git a/repos/gems/src/app/sculpt_manager/model/ram_fs_state.h b/repos/gems/src/app/sculpt_manager/model/ram_fs_state.h index 21493e07bf..97312fbf2b 100644 --- a/repos/gems/src/app/sculpt_manager/model/ram_fs_state.h +++ b/repos/gems/src/app/sculpt_manager/model/ram_fs_state.h @@ -34,10 +34,11 @@ struct Sculpt::Ram_fs_state : Child_state, File_system Ram_fs_state(Registry ®istry, Start_name const &name) : - Child_state(registry, { .name = name, - .priority = Priority::LEITZENTRALE, - .initial = { Ram_quota{1024*1024}, Cap_quota{300} }, - .max = { Ram_quota{2*1024*1024*1024UL}, { } } }), + Child_state(registry, { .name = name, + .priority = Priority::LEITZENTRALE, + .cpu_quota = 0, + .initial = { Ram_quota{1024*1024}, Cap_quota{300} }, + .max = { Ram_quota{2*1024*1024*1024UL}, { } } }), File_system(File_system::UNKNOWN) { } };