intel_fb: reinit capture session on mode change

The current version of the driver leaves the screen in a black state
after a mode change, e.g., when connecting an external display.
With this patch, the framebuffer content is fetched for the entire
screen after a mode change. Thanks to Sebastian Sumpf for investigating.

Issue #3878
This commit is contained in:
Norman Feske 2020-09-15 10:39:05 +02:00
parent 2075b119ac
commit 951409f14b

View File

@ -80,7 +80,7 @@ class Framebuffer::Driver
* Capture
*/
Capture::Connection _capture { _env };
Constructible<Capture::Connection> _capture { };
Constructible<Capture::Connection::Screen> _captured_screen { };
@ -159,7 +159,14 @@ class Framebuffer::Driver
Area const size { _lx_config._lx.width, _lx_config._lx.height };
_captured_screen.construct(_capture, _env.rm(), size);
if (_captured_screen.constructed()) {
_capture.destruct();
_captured_screen.destruct();
}
_capture.construct(_env);
_captured_screen.construct(*_capture, _env.rm(), size);
_capture_timer.trigger_periodic(10*1000);
}