From 951409f14b19c243408799fc432c193306881b42 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 15 Sep 2020 10:39:05 +0200 Subject: [PATCH] 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 --- .../src/drivers/framebuffer/intel/include/driver.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/include/driver.h b/repos/dde_linux/src/drivers/framebuffer/intel/include/driver.h index 797877cc20..ac7eb2a8df 100644 --- a/repos/dde_linux/src/drivers/framebuffer/intel/include/driver.h +++ b/repos/dde_linux/src/drivers/framebuffer/intel/include/driver.h @@ -80,7 +80,7 @@ class Framebuffer::Driver * Capture */ - Capture::Connection _capture { _env }; + Constructible _capture { }; Constructible _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); }