From e69c01aad3a31728a5a661680a49b53bd97dc7fc Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 26 Sep 2024 13:45:45 +0200 Subject: [PATCH] framebuffer_session: add sync_source selection The new Framebuffer::Session::sync_source RPC function allows for the selection of a specific source of sync signals in the presence of multiple capture clients at the GUI server. This patch contains only the extension of the interface. The information is not evaluated by the GUI server yet. Issue #5347 --- .../src/server/liquid_framebuffer/services.cc | 2 ++ repos/gems/src/server/gui_fader/main.cc | 2 ++ repos/os/include/framebuffer_session/client.h | 2 ++ .../framebuffer_session/framebuffer_session.h | 16 +++++++++++++++- repos/os/src/server/gui_fb/main.cc | 2 ++ .../src/server/nitpicker/framebuffer_session.h | 2 ++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/repos/demo/src/server/liquid_framebuffer/services.cc b/repos/demo/src/server/liquid_framebuffer/services.cc index b2c1a3a203..bec5a210c2 100644 --- a/repos/demo/src/server/liquid_framebuffer/services.cc +++ b/repos/demo/src/server/liquid_framebuffer/services.cc @@ -264,6 +264,8 @@ class Framebuffer::Session_component : public Genode::Rpc_object _timer.trigger_periodic(10*1000); } + void sync_source(Session_label const &) override { } + void refresh(Rect rect) override { _window_content.redraw_area(rect.x1(), rect.y1(), rect.w(), rect.h()); diff --git a/repos/gems/src/server/gui_fader/main.cc b/repos/gems/src/server/gui_fader/main.cc index f382d36c74..f9b391077f 100644 --- a/repos/gems/src/server/gui_fader/main.cc +++ b/repos/gems/src/server/gui_fader/main.cc @@ -290,6 +290,8 @@ class Gui_fader::Framebuffer_session_component { _gui.framebuffer.sync_sigh(sigh); } + + void sync_source(Genode::Session_label const &) override { } }; diff --git a/repos/os/include/framebuffer_session/client.h b/repos/os/include/framebuffer_session/client.h index 0e563fb774..b70b93ca3d 100644 --- a/repos/os/include/framebuffer_session/client.h +++ b/repos/os/include/framebuffer_session/client.h @@ -32,6 +32,8 @@ struct Framebuffer::Session_client : Rpc_client void sync_sigh(Signal_context_capability sigh) override { call(sigh); } + void sync_source(Session_label const &source) override { call(source); } + void refresh(Rect rect) override { call(rect); } /** diff --git a/repos/os/include/framebuffer_session/framebuffer_session.h b/repos/os/include/framebuffer_session/framebuffer_session.h index 9b6137fb59..b3dde2ba86 100644 --- a/repos/os/include/framebuffer_session/framebuffer_session.h +++ b/repos/os/include/framebuffer_session/framebuffer_session.h @@ -210,6 +210,19 @@ struct Framebuffer::Session : Genode::Session */ virtual void sync_sigh(Signal_context_capability) = 0; + /** + * Define the preferred source of sync signals + * + * In the presence of multiple capture clients at the GUI server, each + * client captures the GUI at independent refresh rates. Hence, there is + * no single source of sync signals but there can be multiple. From the + * application's perspective, the most adequate sync source may depend on + * the positions of the capture clients at the GUI server and the position + * of the application's view. By specifying a capture client's label as + * 'sync_sigh', the application can take an informed decision. + */ + virtual void sync_source(Session_label const &) = 0; + /********************* ** RPC declaration ** @@ -222,9 +235,10 @@ struct Framebuffer::Session : Genode::Session GENODE_RPC(Rpc_panning, void, panning, Point); GENODE_RPC(Rpc_mode_sigh, void, mode_sigh, Signal_context_capability); GENODE_RPC(Rpc_sync_sigh, void, sync_sigh, Signal_context_capability); + GENODE_RPC(Rpc_sync_source, void, sync_source, Session_label const &); GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_mode, Rpc_mode_sigh, Rpc_refresh, - Rpc_blit, Rpc_panning, Rpc_sync_sigh); + Rpc_blit, Rpc_panning, Rpc_sync_sigh, Rpc_sync_source); }; #endif /* _INCLUDE__FRAMEBUFFER_SESSION__FRAMEBUFFER_SESSION_H_ */ diff --git a/repos/os/src/server/gui_fb/main.cc b/repos/os/src/server/gui_fb/main.cc index f598565e9f..2dda709b04 100644 --- a/repos/os/src/server/gui_fb/main.cc +++ b/repos/os/src/server/gui_fb/main.cc @@ -238,6 +238,8 @@ struct Framebuffer::Session_component : Genode::Rpc_object _gui.framebuffer.sync_sigh(sigh); } + + void sync_source(Session_label const &) override { } }; diff --git a/repos/os/src/server/nitpicker/framebuffer_session.h b/repos/os/src/server/nitpicker/framebuffer_session.h index c38e7f9039..72628a13ff 100644 --- a/repos/os/src/server/nitpicker/framebuffer_session.h +++ b/repos/os/src/server/nitpicker/framebuffer_session.h @@ -113,6 +113,8 @@ class Framebuffer::Session_component : public Rpc_object _sync_sigh = sigh; } + void sync_source(Session_label const &) override { } + void refresh(Rect) override; Blit_result blit(Blit_batch const &) override;