mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 06:33:31 +00:00
Simplify Framebuffer::Session interface
This patch removes the 'Framebuffer::Session::release()' function from the interface to make the mode-change protocol consistent with the way the Rom_session interface handles ROM-module changes. That is, the client acknowledges the release of its current dataspace by requesting a new dataspace via the 'Framebuffer::Session::dataspace()' function. Fixes #1057
This commit is contained in:
parent
a61e278cec
commit
6525ec5951
@ -287,8 +287,6 @@ namespace Framebuffer
|
||||
return _window_content.fb_ds_cap();
|
||||
}
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const
|
||||
{
|
||||
return Mode(_window_content.mode_size().w(),
|
||||
|
@ -64,12 +64,6 @@ namespace Framebuffer {
|
||||
}
|
||||
|
||||
|
||||
void Session_component::release()
|
||||
{
|
||||
_framebuffer.release();
|
||||
}
|
||||
|
||||
|
||||
Mode Session_component::mode() const
|
||||
{
|
||||
return _framebuffer.mode();
|
||||
|
@ -46,7 +46,6 @@ namespace Framebuffer {
|
||||
int max_height = 0);
|
||||
|
||||
Genode::Dataspace_capability dataspace();
|
||||
void release();
|
||||
Mode mode() const;
|
||||
void mode_sigh(Genode::Signal_context_capability sigh_cap);
|
||||
void refresh(int x, int y, int w, int h);
|
||||
|
@ -99,8 +99,6 @@ class Window_slave_policy : public Genode::Slave_policy
|
||||
if (_framebuffer)
|
||||
Genode::env()->rm_session()->detach(_framebuffer);
|
||||
|
||||
session_client.release();
|
||||
|
||||
Dataspace_capability framebuffer_ds = session_client.dataspace();
|
||||
if (framebuffer_ds.valid()) {
|
||||
_framebuffer = Genode::env()->rm_session()->attach(framebuffer_ds);
|
||||
|
@ -27,8 +27,6 @@ namespace Framebuffer {
|
||||
Genode::Dataspace_capability dataspace() {
|
||||
return call<Rpc_dataspace>(); }
|
||||
|
||||
void release() { call<Rpc_release>(); }
|
||||
|
||||
Mode mode() const { return call<Rpc_mode>(); }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability sigh) {
|
||||
|
@ -70,21 +70,18 @@ namespace Framebuffer {
|
||||
|
||||
/**
|
||||
* Request dataspace representing the logical frame buffer
|
||||
*
|
||||
* By calling this function, the framebuffer client enables the server
|
||||
* to reallocate the framebuffer dataspace (e.g., on mode changes).
|
||||
* Hence, prior calling this function, the client should make sure to
|
||||
* have detached the previously requested dataspace from its local
|
||||
* address space.
|
||||
*/
|
||||
virtual Genode::Dataspace_capability dataspace() = 0;
|
||||
|
||||
/**
|
||||
* Release framebuffer, free dataspace
|
||||
*
|
||||
* By calling this function, the framebuffer client enables the server
|
||||
* to reallocate the framebuffer dataspace on mode changes. Prior
|
||||
* calling this function, the client should have detached the dataspace
|
||||
* from its local address space.
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
|
||||
/**
|
||||
* Request current display-mode properties
|
||||
* Request display-mode properties of the framebuffer ready to be
|
||||
* obtained via the 'dataspace()' function
|
||||
*/
|
||||
virtual Mode mode() const = 0;
|
||||
|
||||
@ -95,11 +92,9 @@ namespace Framebuffer {
|
||||
* fly. For example, a virtual framebuffer presented in a window may
|
||||
* get resized according to the window dimensions. By installing a
|
||||
* signal handler for mode changes, the framebuffer client can respond
|
||||
* to such changes. From the client's perspective, the original mode
|
||||
* stays in effect until the client calls 'release()'. After having
|
||||
* released the framebuffer, the new mode can be obtained using the
|
||||
* 'mode()' function and a new framebuffer dataspace can be requested
|
||||
* by calling 'dataspace()'.
|
||||
* to such changes. The new mode can be obtained using the 'mode()'
|
||||
* function. However, from the client's perspective, the original mode
|
||||
* stays in effect until the it calls 'dataspace()' again.
|
||||
*/
|
||||
virtual void mode_sigh(Genode::Signal_context_capability sigh) = 0;
|
||||
|
||||
@ -116,13 +111,11 @@ namespace Framebuffer {
|
||||
*********************/
|
||||
|
||||
GENODE_RPC(Rpc_dataspace, Genode::Dataspace_capability, dataspace);
|
||||
GENODE_RPC(Rpc_release, void, release);
|
||||
GENODE_RPC(Rpc_mode, Mode, mode);
|
||||
GENODE_RPC(Rpc_refresh, void, refresh, int, int, int, int);
|
||||
GENODE_RPC(Rpc_mode_sigh, void, mode_sigh, Genode::Signal_context_capability);
|
||||
|
||||
GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_release, Rpc_mode,
|
||||
Rpc_mode_sigh, Rpc_refresh);
|
||||
GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_mode, Rpc_mode_sigh, Rpc_refresh);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,6 @@ namespace Framebuffer {
|
||||
Genode::Dataspace_capability dataspace() {
|
||||
return call<Rpc_dataspace>(); }
|
||||
|
||||
void release() { call<Rpc_release>(); }
|
||||
|
||||
Mode mode() const { return call<Rpc_mode>(); }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability sigh) {
|
||||
|
@ -90,8 +90,6 @@ class Framebuffer::Session_component
|
||||
|
||||
Dataspace_capability dataspace() { return _ds; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const
|
||||
{
|
||||
return Mode(_width, _height, _convert_format(_format));
|
||||
|
@ -69,7 +69,6 @@ class Framebuffer::Session_component :
|
||||
**************************************/
|
||||
|
||||
Dataspace_capability dataspace() { return _buffered ? _bb_ds : _fb_ds; }
|
||||
void release() { }
|
||||
Mode mode() const { return _mode; }
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
||||
|
@ -77,8 +77,6 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Framebuffer::Se
|
||||
|
||||
Dataspace_capability dataspace() { return _ds; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const
|
||||
{
|
||||
return Mode(_width,
|
||||
|
@ -157,8 +157,6 @@ namespace Framebuffer
|
||||
|
||||
Genode::Dataspace_capability dataspace() { return _fb_ds_cap; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const { return Mode(SCR_WIDTH, SCR_HEIGHT, Mode::RGB565); }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
@ -47,8 +47,6 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Framebuffer::Se
|
||||
|
||||
Dataspace_capability dataspace() { return _fb_mem.cap(); }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const
|
||||
{
|
||||
return Mode(_width, _height, Mode::RGB565);
|
||||
|
@ -61,8 +61,6 @@ namespace Framebuffer {
|
||||
|
||||
Genode::Dataspace_capability dataspace() { return fb_ds_cap; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const { return _mode; }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
@ -369,8 +369,6 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
return _buffer ? _buffer->ds_cap() : Genode::Ram_dataspace_capability();
|
||||
}
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() const
|
||||
{
|
||||
return _mode;
|
||||
|
@ -64,12 +64,6 @@ namespace Framebuffer {
|
||||
}
|
||||
|
||||
|
||||
void Session_component::release()
|
||||
{
|
||||
_framebuffer.release();
|
||||
}
|
||||
|
||||
|
||||
Mode Session_component::mode() const
|
||||
{
|
||||
return _framebuffer.mode();
|
||||
|
@ -46,7 +46,6 @@ namespace Framebuffer {
|
||||
int max_height = 0);
|
||||
|
||||
Genode::Dataspace_capability dataspace();
|
||||
void release();
|
||||
Mode mode() const;
|
||||
void mode_sigh(Genode::Signal_context_capability sigh_cap);
|
||||
void refresh(int x, int y, int w, int h);
|
||||
|
Loading…
Reference in New Issue
Block a user