intel_fb: support forced virtual framebuffer size

This commit is contained in:
Christian Helmuth 2016-09-23 21:40:29 +02:00
parent 02d7b401fe
commit c63f7725be
2 changed files with 16 additions and 0 deletions

View File

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

View File

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