sculpt: improve GUI smoothness on PinePhone

- Avoid geometry animation at boot time
- Assign CPU quantum to higher prioritized GUI components
- Defer touch_keyboard start to reduce boot time

Issue #5174
This commit is contained in:
Norman Feske 2024-04-29 17:45:36 +02:00 committed by Christian Helmuth
parent b1df5d890e
commit 50b87957db
8 changed files with 57 additions and 30 deletions

View File

@ -427,7 +427,7 @@ install_config {
<start name="drivers" caps="4850" priority="-1" managing_system="yes">
<resource name="RAM" quantum="200M"/>
<resource name="CPU" quantum="10"/>
<resource name="CPU" quantum="5"/>
<binary name="init"/>
<route>
} [log_route] {
@ -610,7 +610,7 @@ install_config {
<start name="leitzentrale" caps="2400" priority="-1">
<binary name="init"/>
<resource name="RAM" quantum="203M"/>
<resource name="CPU" quantum="35"/>
<resource name="CPU" quantum="10"/>
<affinity xpos="1" width="1"/> <!-- decouple leitzentrale from boot CPU -->
<provides>
<service name="Gui"/>
@ -662,7 +662,7 @@ install_config {
<start name="runtime" caps="50000" priority="-1" managing_system="yes">
<binary name="monitor"/>
<resource name="RAM" quantum="32G"/>
<resource name="CPU" quantum="40"/>
<resource name="CPU" quantum="70"/>
<route>
<service name="ROM" label="config">
<child name="config_fs_rom" label="managed/runtime"/> </service>

View File

@ -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

View File

@ -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'

View File

@ -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"); });

View File

@ -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) {

View File

@ -47,8 +47,13 @@ struct Sculpt::Touch_driver : private Noncopyable
void update(Registry<Child_state> &registry, 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 = { } } );
}
};

View File

@ -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<Child_state> &registry, 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); });
}
/**

View File

@ -34,10 +34,11 @@ struct Sculpt::Ram_fs_state : Child_state, File_system
Ram_fs_state(Registry<Child_state> &registry, 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)
{ }
};