Change pixel format to 32 bits per pixel

Until now, Genode's framebuffer session interface was based on the
RGB565 pixel format. This patch changes the pixel format to 32-bit
XRGB where the X part is ignored. It adapts all graphical applications
and device drivers accordingly.

The patch also adjusts the users of the drivers_interactive packages,
assigning 64 MiB RAM and 1500 caps to the drivers subsystem, which is
sufficient for covering high resolutions at 32 bits per pixel and to
accommodate multi-component USB HID input stacks.

Fixes #3784
This commit is contained in:
Norman Feske
2020-06-16 15:46:59 +02:00
parent 6119e03081
commit ef741ef80d
112 changed files with 500 additions and 696 deletions

View File

@ -35,7 +35,7 @@ class Background_animator : public Scout::Tick
{
private:
Framebuffer_window<Scout::Pixel_rgb565> &_fb_win;
Framebuffer_window<Scout::Pixel_rgb888> &_fb_win;
int _bg_offset = 0;
@ -44,7 +44,7 @@ class Background_animator : public Scout::Tick
/**
* Constructor
*/
Background_animator(Framebuffer_window<Scout::Pixel_rgb565> &fb_win)
Background_animator(Framebuffer_window<Scout::Pixel_rgb888> &fb_win)
: _fb_win(fb_win) { schedule(20); }
/**
@ -169,7 +169,7 @@ class Liquid_fb::Main : public Scout::Event_handler
(init_window_content(_env.ram(), _env.rm(), _heap, _input_session_component,
config_fb_width, config_fb_height, config_alpha), true);
Framebuffer_window<Pixel_rgb565>
Framebuffer_window<Pixel_rgb888>
_fb_win { _graphics_backend, window_content(),
_initial_position, _initial_size, _max_size,
config_title.string(), config_alpha,

View File

@ -18,7 +18,7 @@
#include <framebuffer_session/framebuffer_session.h>
#include <input/root.h>
#include <nitpicker_gfx/texture_painter.h>
#include <os/pixel_rgb565.h>
#include <os/pixel_rgb888.h>
#include <os/static_root.h>
#include <timer_session/connection.h>
@ -26,7 +26,7 @@
#include "services.h"
typedef Genode::Texture<Genode::Pixel_rgb565> Texture_rgb565;
typedef Genode::Texture<Genode::Pixel_rgb888> Texture_rgb888;
class Window_content : public Scout::Element
@ -81,17 +81,17 @@ class Window_content : public Scout::Element
Genode::Allocator &alloc;
unsigned w, h;
Genode::Attached_ram_dataspace ds;
Genode::Pixel_rgb565 *pixel;
Genode::Pixel_rgb888 *pixel;
unsigned char *alpha;
Genode::Texture<Genode::Pixel_rgb565> texture;
Genode::Texture<Genode::Pixel_rgb888> texture;
Fb_texture(Genode::Ram_allocator &ram, Genode::Region_map &local_rm,
Genode::Allocator &alloc,
unsigned w, unsigned h, bool config_alpha)
:
alloc(alloc), w(w), h(h),
ds(ram, local_rm, w*h*sizeof(Genode::Pixel_rgb565)),
pixel(ds.local_addr<Genode::Pixel_rgb565>()),
ds(ram, local_rm, w*h*sizeof(Genode::Pixel_rgb888)),
pixel(ds.local_addr<Genode::Pixel_rgb888>()),
alpha((unsigned char *)alloc.alloc(w*h)),
texture(pixel, alpha, Scout::Area(w, h))
{
@ -250,8 +250,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
Mode mode() const override
{
return Mode(_window_content.mode_size().w(),
_window_content.mode_size().h(), Mode::RGB565);
return Mode { .area = _window_content.mode_size() };
}
void mode_sigh(Genode::Signal_context_capability sigh) override {

View File

@ -21,7 +21,7 @@
#include <gui_session/connection.h>
#include <timer_session/connection.h>
#include <input/event.h>
#include <os/pixel_rgb565.h>
#include <os/pixel_rgb888.h>
/*
* Nitpicker's graphics backend
@ -409,8 +409,7 @@ struct Nitlog::Main
void _init_gui_buffer()
{
_gui.buffer(Framebuffer::Mode(_win_w, _win_h,
Framebuffer::Mode::RGB565), false);
_gui.buffer(Framebuffer::Mode { .area = { _win_w, _win_h } }, false);
}
bool const _gui_buffer_initialized = (_init_gui_buffer(), true);
@ -420,7 +419,7 @@ struct Nitlog::Main
/* create log window */
Attached_dataspace _fb_ds { _env.rm(), _gui.framebuffer()->dataspace() };
Canvas<Pixel_rgb565> _canvas { _fb_ds.local_addr<Pixel_rgb565>(),
Canvas<Pixel_rgb888> _canvas { _fb_ds.local_addr<Pixel_rgb888>(),
::Area(_win_w, _win_h) };
Log_window _log_window { _canvas, _font };