genode/repos/libports/src/drivers/framebuffer/vesa
Norman Feske 4d442bca30 Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.

Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.

This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-31 13:16:07 +02:00
..
include Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
framebuffer.cc Streamline exception types 2017-05-31 13:16:07 +02:00
hw_emul.cc Streamline exception types 2017-05-31 13:16:07 +02:00
ifx86emu.cc Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
main.cc Streamline exception types 2017-05-31 13:16:07 +02:00
README Move repositories to 'repos/' subdirectory 2014-05-14 16:08:00 +02:00
target.mk Adapt VESA framebuffer driver to component API 2017-01-13 13:06:55 +01:00

This driver for x86 VBE 2.0 flat framebuffers was implemented by Sebastian
Sumpf.


Config arguments
~~~~~~~~~~~~~~~~

By default, the driver sets up a resolution of 1024x768 at 16 bit color
depth. This behaviour can be overridden by supplying the following
arguments via Genode's config mechanism:

! <config width="1024"
!         height="768"
!         depth="16"
!         buffered="no" />

The 'depth' attribute is specified in bits per pixel. If setting the
'buffered' attribute to 'yes', the VESA driver hands out a plain
memory buffer to its client and flushes the pixels to the physical
frame buffer each time, 'refresh' is called by the client. Buffered
output should be used if the client tends to read from the frame
buffer (i.e., the client performs output with alpha channel).

Note that only VESA modes but no arbitrary combination of values are
supported. To find out which graphics modes exist on your platform,
you might use the 'vbeprobe' command of the GRUB boot loader. Also,
the driver will print a list of supported modes if the specified
values are invalid.

As an alternative to letting the VESA driver set up a screen mode, the
driver is able to reuse an already initialized mode, which becomes useful
if the VESA mode is already initialized by the boot loader. If the screen
is initialized that way, the 'preinit' attribute of the 'config' node can
be set to '"yes"' to prevent the driver from changing the mode. This way,
the driver will just query the current mode and make the already
initialized framebuffer available to its client.


Options and usage from clients
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Example:

  ! #include <framebuffer_session/connection.h>
  !
  ! ...
  !
  ! /* create session to frame-buffer service */
  ! Framebuffer::Connection framebuffer(1024, 768, Framebuffer::Session::RGB565);
  !
  ! /* retrieve frame buffer dataspace */
  ! Dataspace_capability fb_ds_cap = framebuffer.dataspace();
  !
  ! /* map dataspace to local address space */
  ! void *local_addr = env()->rm_session()->attach(fb_ds_cap);

:Session-creation arguments:

  :'fb_width': resolution width in pixel

  :'fb_height': resolution height in pixel

  :'fb_mode ': bits per pixel

:Supported modes:

  '640x480', '800x600', '1024x786', '1280x1024' at 15, 16, 24, 32 bits per pixel
  Buffered output is only supported for modes using 16 bits per pixel.