sculpt: move event_filter to static system

By moving the event_filter and the numlock_remap_rom from the drivers
subsystem to the static system, the filtering can be applied to drivers
hosted in the runtime and drivers hosted in the drivers subsystem.

This is a preparatory step for moving the USB host and HID drivers to
the runtime.

Issue #5150
This commit is contained in:
Norman Feske 2024-03-19 17:23:41 +01:00 committed by Christian Helmuth
parent 06c4b0248b
commit 3580bb6e17
9 changed files with 69 additions and 116 deletions

View File

@ -49,3 +49,4 @@ _/src/fs_tool
_/src/text_area
_/src/sandbox
_/src/shim
_/src/event_filter

View File

@ -271,7 +271,10 @@ install_config {
<policy label="clipboard -> focus" report="nitpicker -> focus"/>
<policy label="drivers -> capslock" report="global_keys_handler -> capslock"/>
<policy label="runtime -> capslock" report="global_keys_handler -> capslock"/>
<policy label="runtime -> numlock" report="global_keys_handler -> numlock"/>
<policy label="drivers -> numlock" report="global_keys_handler -> numlock"/>
<policy label="numlock_remap_rom -> numlock" report="global_keys_handler -> numlock"/>
<policy label="event_filter -> capslock" report="global_keys_handler -> capslock"/>
<policy label="runtime -> clicked" report="nitpicker -> clicked"/>
<policy label="leitzentrale -> manager -> nitpicker_focus" report="nitpicker -> focus"/>
<policy label="leitzentrale -> manager -> nitpicker_hover" report="nitpicker -> hover"/>
@ -403,16 +406,10 @@ install_config {
<child name="config_fs_rom" label="drivers"/> </service>
<service name="ROM" label_last="capslock">
<child name="report_rom" label="drivers -> capslock"/> </service>
<service name="ROM" label_last="event_filter.config">
<child name="config_fs_rom" label="managed/event_filter"/> </service>
<service name="ROM" label_prefix="event_filter -> keyboard/">
<child name="config_fs_rom"/> </service>
<service name="ROM" label_last="fb_drv.config">
<child name="config_fs_rom" label="managed/fb_drv"/> </service>
<service name="ROM" label_last="gpu_drv.config">
<child name="config_fs_rom" label="gpu_drv"/> </service>
<service name="ROM" label_last="numlock_remap.config">
<child name="config_fs_rom" label="numlock_remap"/> </service>
<service name="ROM" label_last="usb_policy">
<child name="config_fs_rom" label="usb"/> </service>
<service name="ROM" label_last="system">
@ -421,10 +418,11 @@ install_config {
<child name="config_fs_rom" label="managed/modem"/> </service>
<service name="ROM" label_last="audio.config">
<child name="config_fs_rom" label="managed/audio"/> </service>
<service name="ROM" label_last="numlock"> <child name="report_rom"/> </service>
<service name="ROM" label_last="numlock">
<child name="report_rom" label="drivers -> numlock"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Capture"> <child name="nitpicker"/> </service>
<service name="Event"> <child name="nitpicker"/> </service>
<service name="Event"> <child name="event_filter"/> </service>
<service name="Report"> <child name="fs_report"/> </service>
<any-service> <parent/> </any-service>
</route>
@ -457,6 +455,38 @@ install_config {
</route>
</start>
<!-- toggle key mappings depending on the numlock state -->
<start name="numlock_remap_rom">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<route>
<service name="ROM" label="config">
<child name="config_fs_rom" label="numlock_remap"/> </service>
<service name="ROM" label="numlock"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="event_filter" caps="120">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Event"/> </provides>
<route>
<service name="ROM" label="config">
<child name="config_fs_rom" label="managed/event_filter"/> </service>
<service name="ROM" label_prefix="keyboard/">
<child name="config_fs_rom"/> </service>
<service name="ROM" label="numlock.remap"> <child name="numlock_remap_rom"/> </service>
<service name="ROM" label="capslock"> <child name="report_rom"/> </service>
<service name="ROM"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Event"> <child name="nitpicker"/> </service>
</route>
</start>
<!-- override user focus when leitzentrale is active -->
<start name="nit_focus" priority="-1">
<binary name="rom_filter"/>
@ -619,6 +649,8 @@ install_config {
<child name="report_fs_rom"/> </service>
<service name="ROM" label="capslock">
<child name="report_rom"/> </service>
<service name="ROM" label="numlock">
<child name="report_rom"/> </service>
<service name="ROM" label="clicked">
<child name="report_rom"/> </service>
<service name="File_system" label="config">
@ -659,8 +691,8 @@ install_config {
<service name="Report"> <child name="fs_report"/> </service>
<service name="LOG" label="unlogged"> <parent/> </service>
} [log_route] [nic_driver_routes] {
<service name="Event" label="global"> <child name="nitpicker"/> </service>
<service name="Event" label="leitzentrale"> <child name="leitzentrale"/> </service>
<service name="Event" label="leitzentrale"> <child name="leitzentrale"/> </service>
<service name="Event"> <child name="event_filter"/> </service>
<service name="Capture" label="global"> <child name="nitpicker"/> </service>
<service name="Capture" label="leitzentrale"> <child name="leitzentrale"/> </service>
<service name="Pin_state"> <child name="drivers"/> </service>

View File

@ -12,37 +12,9 @@
<start name="fb_sdl" caps="100" ld="no">
<resource name="RAM" quantum="32M"/>
<route>
<service name="Event"> <child name="event_filter" label="sdl"/> </service>
<service name="Event"> <parent label="sdl"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<!-- toggle key mappings depending on the numlock state -->
<start name="numlock_remap_rom" caps="100">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="numlock_remap.config"/> </service>
<service name="ROM" label="numlock"> <parent label="numlock"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="event_filter" caps="120">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Event"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="event_filter.config"/> </service>
<service name="ROM" label="numlock.remap"> <child name="numlock_remap_rom"/> </service>
<service name="ROM" label="capslock"> <parent label="capslock"/> </service>
<service name="ROM"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
<service name="Event"> <parent/> </service>
</route>
</start>
</config>

View File

@ -183,7 +183,7 @@
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
<service name="Event"> <child name="event_filter" label="usb"/> </service>
<service name="Event"> <parent label="usb"/> </service>
<service name="Usb"> <child name="usb_drv"/> </service>
</route>
</start>
@ -193,7 +193,7 @@
<config capslock_led="rom" numlock_led="rom" system="yes"/>
<route>
<service name="Platform"> <child name="platform_drv"/> </service>
<service name="Event"> <child name="event_filter" label="ps2"/> </service>
<service name="Event"> <parent label="ps2"/> </service>
<service name="ROM" label="capslock"> <parent label="capslock"/> </service>
<service name="ROM" label="numlock"> <parent label="numlock"/> </service>
<service name="ROM" label="system"> <parent label="system"/> </service>
@ -205,34 +205,6 @@
</route>
</start>
<!-- toggle key mappings depending on the numlock state -->
<start name="numlock_remap_rom">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="numlock_remap.config"/> </service>
<service name="ROM" label="numlock"> <parent label="numlock"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="event_filter" caps="120">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Event"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="event_filter.config"/> </service>
<service name="ROM" label="numlock.remap"> <child name="numlock_remap_rom"/> </service>
<service name="ROM" label="capslock"> <parent label="capslock"/> </service>
<service name="ROM"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
<service name="Event"> <parent/> </service>
</route>
</start>
<start name="driver_manager">
<resource name="RAM" quantum="1M"/>
<route>

View File

@ -13,39 +13,11 @@
<start name="fb_sdl" caps="100" ld="no">
<resource name="RAM" quantum="10M"/>
<route>
<service name="Event"> <child name="event_filter" label="sdl"/> </service>
<service name="Event"> <parent label="sdl"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<!-- toggle key mappings depending on the numlock state -->
<start name="numlock_remap_rom" caps="100">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="numlock_remap.config"/> </service>
<service name="ROM" label="numlock"> <parent label="numlock"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="event_filter" caps="120">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Event"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="event_filter.config"/> </service>
<service name="ROM" label="numlock.remap"> <child name="numlock_remap_rom"/> </service>
<service name="ROM" label="capslock"> <parent label="capslock"/> </service>
<service name="ROM"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
<service name="Event"> <parent/> </service>
</route>
</start>
<start name="modem" caps="120">
<binary name="dummy_modem"/>
<resource name="RAM" quantum="1M"/>

View File

@ -8,8 +8,8 @@
<input name="sdl"/>
</merge>
</output>
<policy label="ps2" input="ps2"/>
<policy label="usb" input="usb"/>
<policy label="touch" input="touch"/>
<policy label="sdl" input="sdl"/>
<policy label="drivers -> ps2" input="ps2"/>
<policy label="drivers -> usb" input="usb"/>
<policy label="drivers -> touch" input="touch"/>
<policy label="drivers -> sdl" input="sdl"/>
</config>

View File

@ -35,6 +35,6 @@
<include rom="special.chargen"/>
</chargen>
</output>
<policy label="ps2" input="ps2"/>
<policy label="usb" input="usb"/>
<policy label="drivers -> ps2" input="ps2"/>
<policy label="drivers -> usb_hid" input="usb"/>
</config>

View File

@ -1,9 +1,13 @@
<config>
<output>
<touch-key>
<input name="sdl"/>
<tap xpos="0" ypos="400" width="25" height="600" key="KEY_DASHBOARD"/>
</touch-key>
<merge>
<touch-key>
<input name="drivers"/>
<tap xpos="0" ypos="400" width="25" height="600" key="KEY_DASHBOARD"/>
</touch-key>
<input name="runtime"/>
</merge>
</output>
<policy label="sdl" input="sdl"/>
<policy label_prefix="drivers -> " input="drivers"/>
<policy label_prefix="runtime -> " input="runtime"/>
</config>

View File

@ -2189,15 +2189,15 @@ void Sculpt::Main::_generate_event_filter_config(Xml_generator &xml)
});
});
auto gen_policy = [&] (auto label) {
xml.node("policy", [&] () {
auto gen_policy = [&] (auto label, auto input) {
xml.node("policy", [&] {
xml.attribute("label", label);
xml.attribute("input", label); }); };
xml.attribute("input", input); }); };
gen_policy("ps2");
gen_policy("usb");
gen_policy("touch");
gen_policy("sdl");
gen_policy("drivers -> ps2", "ps2");
gen_policy("drivers -> usb", "usb");
gen_policy("drivers -> touch", "touch");
gen_policy("drivers -> sdl", "sdl");
}