mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-10 21:01:49 +00:00
intel_fb: support forced virtual framebuffer size
This commit is contained in:
parent
02d7b401fe
commit
c63f7725be
@ -120,6 +120,16 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
|
||||
Genode::Xml_node config() { return _config.xml(); }
|
||||
|
||||
int force_width_from_config()
|
||||
{
|
||||
return _config.xml().attribute_value<unsigned>("force_width", 0);
|
||||
}
|
||||
|
||||
int force_height_from_config()
|
||||
{
|
||||
return _config.xml().attribute_value<unsigned>("force_height", 0);
|
||||
}
|
||||
|
||||
|
||||
/***********************************
|
||||
** Framebuffer session interface **
|
||||
|
@ -187,6 +187,12 @@ void Framebuffer::Driver::update_mode()
|
||||
_preferred_mode(c)); });
|
||||
}
|
||||
|
||||
/* force virtual framebuffer size if requested */
|
||||
if (int w = _session.force_width_from_config())
|
||||
_config._lx.width = min(_config._lx.width, w);
|
||||
if (int h = _session.force_height_from_config())
|
||||
_config._lx.height = min(_config._lx.height, h);
|
||||
|
||||
if (old._lx.addr) Lx::iounmap(old._lx.addr);
|
||||
/* drm_crtc.h in drm_framebuffer_funcs definition: use drm_fb_remove */
|
||||
if (old._lx.lx_fb) drm_framebuffer_remove(old._lx.lx_fb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user