mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 07:38:28 +00:00
Add mode_sigh and release to framebuffer::Session
The 'mode_sigh' function allows the client to receive notifications about server-side display-mode changes. To respond to such a signal, the client can use the new 'release' function, which acknowledges the mode change at the server and frees the original framebuffer dataspace. Via a subsequent call of 'dataspace', a framebuffer dataspace corresponding to the new mode can be obtained. Related to issue #11.
This commit is contained in:
@ -45,17 +45,18 @@ namespace Framebuffer {
|
||||
|
||||
Dataspace_capability dataspace() { return Framebuffer_drv::hw_framebuffer(); }
|
||||
|
||||
void info(int *out_w, int *out_h, Mode *out_mode)
|
||||
{
|
||||
*out_w = scr_width;
|
||||
*out_h = scr_height;
|
||||
void release() { }
|
||||
|
||||
switch (scr_mode) {
|
||||
case 16: *out_mode = RGB565; break;
|
||||
default: *out_mode = INVALID;
|
||||
}
|
||||
Mode mode()
|
||||
{
|
||||
if (scr_mode != 16)
|
||||
return Mode(); /* invalid mode */
|
||||
|
||||
return Mode(scr_width, scr_height, Mode::RGB565);
|
||||
}
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability sigh) { }
|
||||
|
||||
void refresh(int x, int y, int w, int h)
|
||||
{
|
||||
#if 0
|
||||
|
@ -165,8 +165,12 @@ namespace Framebuffer
|
||||
|
||||
Genode::Dataspace_capability dataspace() { return _fb_ds_cap; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() { return Mode(SCR_WIDTH, SCR_HEIGHT, Mode::RGB565); }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
||||
void refresh(int x, int y, int w, int h) { }
|
||||
};
|
||||
|
||||
|
@ -61,8 +61,12 @@ namespace Framebuffer {
|
||||
|
||||
Genode::Dataspace_capability dataspace() { return fb_ds_cap; }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode() { return _mode; }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
||||
void refresh(int x, int y, int w, int h)
|
||||
{
|
||||
/* clip refresh area to screen boundaries */
|
||||
|
@ -150,12 +150,16 @@ namespace Framebuffer {
|
||||
return _buffered ? Dataspace_capability(_bb_ds)
|
||||
: Dataspace_capability(_fb_ds); }
|
||||
|
||||
void release() { }
|
||||
|
||||
Mode mode()
|
||||
{
|
||||
return Mode(_scr_width, _scr_height,
|
||||
_scr_mode == 16 ? Mode::RGB565 : Mode::INVALID);
|
||||
}
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability) { }
|
||||
|
||||
/* not implemented */
|
||||
void refresh(int x, int y, int w, int h)
|
||||
{
|
||||
|
Reference in New Issue
Block a user