mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 15:43:56 +00:00
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:
@ -18,7 +18,7 @@
|
||||
#include <base/attached_ram_dataspace.h>
|
||||
#include <os/texture.h>
|
||||
#include <os/surface.h>
|
||||
#include <os/pixel_rgb565.h>
|
||||
#include <os/pixel_rgb888.h>
|
||||
#include <os/pixel_alpha8.h>
|
||||
#include <os/static_root.h>
|
||||
#include <util/reconstructible.h>
|
||||
@ -50,7 +50,7 @@ namespace Gui_fader {
|
||||
using Genode::Reconstructible;
|
||||
using Genode::Constructible;
|
||||
|
||||
typedef Genode::Pixel_rgb565 Pixel_rgb565;
|
||||
typedef Genode::Pixel_rgb888 Pixel_rgb888;
|
||||
typedef Genode::Pixel_alpha8 Pixel_alpha8;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ class Gui_fader::Src_buffer
|
||||
{
|
||||
private:
|
||||
|
||||
typedef Pixel_rgb565 Pixel;
|
||||
typedef Pixel_rgb888 Pixel;
|
||||
|
||||
bool const _use_alpha;
|
||||
Attached_ram_dataspace _ds;
|
||||
@ -103,11 +103,11 @@ class Gui_fader::Dst_buffer
|
||||
Genode::Attached_dataspace _ds;
|
||||
Area _size;
|
||||
|
||||
Surface<Pixel_rgb565> _pixel_surface { _ds.local_addr<Pixel_rgb565>(), _size };
|
||||
Surface<Pixel_rgb888> _pixel_surface { _ds.local_addr<Pixel_rgb888>(), _size };
|
||||
|
||||
Surface<Pixel_alpha8> _alpha_surface
|
||||
{
|
||||
_ds.local_addr<Pixel_alpha8>() + _size.count()*sizeof(Pixel_rgb565),
|
||||
_ds.local_addr<Pixel_alpha8>() + _size.count()*sizeof(Pixel_rgb888),
|
||||
_size
|
||||
};
|
||||
|
||||
@ -119,12 +119,12 @@ class Gui_fader::Dst_buffer
|
||||
{
|
||||
/* initialize input-mask buffer */
|
||||
unsigned char *input_mask_buffer = _ds.local_addr<unsigned char>()
|
||||
+ _size.count()*(1 + sizeof(Pixel_rgb565));
|
||||
+ _size.count()*(1 + sizeof(Pixel_rgb888));
|
||||
|
||||
Genode::memset(input_mask_buffer, 0xff, _size.count());
|
||||
}
|
||||
|
||||
Surface<Pixel_rgb565> &pixel_surface() { return _pixel_surface; }
|
||||
Surface<Pixel_rgb888> &pixel_surface() { return _pixel_surface; }
|
||||
Surface<Pixel_alpha8> &alpha_surface() { return _alpha_surface; }
|
||||
};
|
||||
|
||||
@ -415,7 +415,7 @@ class Gui_fader::Gui_session_component
|
||||
|
||||
void buffer(Framebuffer::Mode mode, bool use_alpha) override
|
||||
{
|
||||
Area const size(mode.width(), mode.height());
|
||||
Area const size = mode.area;
|
||||
|
||||
_src_buffer.construct(_env, size, use_alpha);
|
||||
|
||||
|
@ -28,7 +28,7 @@ class Terminal::Framebuffer
|
||||
|
||||
Env &_env;
|
||||
|
||||
::Framebuffer::Connection _fb { _env, ::Framebuffer::Mode() };
|
||||
::Framebuffer::Connection _fb { _env, ::Framebuffer::Mode { } };
|
||||
|
||||
Constructible<Attached_dataspace> _ds { };
|
||||
|
||||
@ -47,8 +47,8 @@ class Terminal::Framebuffer
|
||||
_fb.mode_sigh(mode_sigh);
|
||||
}
|
||||
|
||||
unsigned w() const { return _mode.width(); }
|
||||
unsigned h() const { return _mode.height(); }
|
||||
unsigned w() const { return _mode.area.w(); }
|
||||
unsigned h() const { return _mode.area.h(); }
|
||||
|
||||
template <typename PT>
|
||||
PT *pixel() { return _ds->local_addr<PT>(); }
|
||||
@ -64,10 +64,7 @@ class Terminal::Framebuffer
|
||||
*/
|
||||
bool mode_changed() const
|
||||
{
|
||||
::Framebuffer::Mode _new_mode = _fb.mode();
|
||||
|
||||
return _new_mode.width() != _mode.width()
|
||||
|| _new_mode.height() != _mode.height();
|
||||
return _fb.mode().area != _mode.area;
|
||||
}
|
||||
|
||||
void switch_to_new_mode()
|
||||
@ -83,7 +80,7 @@ class Terminal::Framebuffer
|
||||
* the old (possibly too small) dataspace.
|
||||
*/
|
||||
_mode = _fb.mode();
|
||||
if (_mode.width() && _mode.height())
|
||||
if (_mode.area.count() > 0)
|
||||
_ds.construct(_env.rm(), _fb.dataspace());
|
||||
}
|
||||
};
|
||||
|
@ -96,7 +96,7 @@ struct Terminal::Main : Character_consumer
|
||||
|
||||
struct Paste_buffer { char buffer[READ_BUFFER_SIZE]; } _paste_buffer { };
|
||||
|
||||
typedef Pixel_rgb565 PT;
|
||||
typedef Pixel_rgb888 PT;
|
||||
|
||||
Constructible<Text_screen_surface<PT>> _text_screen_surface { };
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#define _TEXT_SCREEN_SURFACE_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <os/pixel_rgb565.h>
|
||||
#include <os/pixel_rgb888.h>
|
||||
|
||||
/* terminal includes */
|
||||
#include <terminal/char_cell_array_character_screen.h>
|
||||
|
@ -980,9 +980,7 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
|
||||
* mode
|
||||
*/
|
||||
if (_resize_requested)
|
||||
return Framebuffer::Mode(_requested_size.w(),
|
||||
_requested_size.h(),
|
||||
real_mode.format());
|
||||
return Framebuffer::Mode { .area = _requested_size };
|
||||
|
||||
/*
|
||||
* If the first top-level view has a defined size, use it
|
||||
@ -990,9 +988,7 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
|
||||
*/
|
||||
if (Top_level_view const *v = _top_level_views.first())
|
||||
if (v->size().valid())
|
||||
return Framebuffer::Mode(v->size().w(),
|
||||
v->size().h(),
|
||||
real_mode.format());
|
||||
return Framebuffer::Mode { .area = v->size() };
|
||||
|
||||
/*
|
||||
* If top-level view has yet been defined, return the real mode.
|
||||
|
Reference in New Issue
Block a user