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:
Norman Feske
2012-01-20 21:34:01 +01:00
parent 9e3ecade16
commit c35207d9c4
8 changed files with 72 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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