Merge lp:~albaguirre/unity-system-compositor/silo-virtual-output into lp:unity-system-compositor/ubuntu

Proposed by Alberto Aguirre
Status: Rejected
Rejected by: Alberto Aguirre
Proposed branch: lp:~albaguirre/unity-system-compositor/silo-virtual-output
Merge into: lp:unity-system-compositor/ubuntu
Diff against target: 282 lines (+79/-27)
6 files modified
CMakeLists.txt (+2/-2)
debian/changelog (+6/-0)
src/mir_screen.cpp (+59/-17)
src/mir_screen.h (+4/-4)
tests/include/usc/test/mock_display.h (+4/-0)
tests/integration-tests/test_deadlock_lp1491566.cpp (+4/-4)
To merge this branch: bzr merge lp:~albaguirre/unity-system-compositor/silo-virtual-output
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity System Compositor Development Team Pending
Review via email: mp+284992@code.launchpad.net

Commit message

DO NOT MERGE: silo test

Description of the change

DO NOT MERGE: silo test

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

277. By Alberto Aguirre

update version

276. By Alberto Aguirre

merge lp:mir/ubuntu

275. By Alberto Aguirre

mocks: Implement new method added to mir::graphics::Display

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-01-21 17:43:12 +0000
+++ CMakeLists.txt 2016-02-03 23:41:34 +0000
@@ -16,8 +16,8 @@
1616
17project(UnitySystemCompositor)17project(UnitySystemCompositor)
18set(USC_VERSION_MAJOR 0)18set(USC_VERSION_MAJOR 0)
19set(USC_VERSION_MINOR 3)19set(USC_VERSION_MINOR 5)
20set(USC_VERSION_PATCH 1)20set(USC_VERSION_PATCH 0)
21set(USC_VERSION "${USC_VERSION_MAJOR}.${USC_VERSION_MINOR}.${USC_VERSION_PATCH}")21set(USC_VERSION "${USC_VERSION_MAJOR}.${USC_VERSION_MINOR}.${USC_VERSION_PATCH}")
2222
23cmake_minimum_required(VERSION 2.8)23cmake_minimum_required(VERSION 2.8)
2424
=== modified file 'debian/changelog'
--- debian/changelog 2016-01-28 14:20:54 +0000
+++ debian/changelog 2016-02-03 23:41:34 +0000
@@ -1,3 +1,9 @@
1unity-system-compositor (0.5.0) UNRELEASED; urgency=medium
2
3 * Test release server abi break
4
5 -- Alberto Aguirre <alberto.aguirre@canonical.com> Wed, 03 Feb 2016 17:39:47 -0600
6
1unity-system-compositor (0.4.0+16.04.20160128.1-0ubuntu1) xenial; urgency=medium7unity-system-compositor (0.4.0+16.04.20160128.1-0ubuntu1) xenial; urgency=medium
28
3 [ Brandon Schaefer ]9 [ Brandon Schaefer ]
410
=== modified file 'src/mir_screen.cpp'
--- src/mir_screen.cpp 2015-09-30 10:53:54 +0000
+++ src/mir_screen.cpp 2016-02-03 23:41:34 +0000
@@ -24,8 +24,13 @@
24#include <mir/graphics/display.h>24#include <mir/graphics/display.h>
25#include <mir/graphics/display_configuration.h>25#include <mir/graphics/display_configuration.h>
26#include <mir/input/touch_visualizer.h>26#include <mir/input/touch_visualizer.h>
27#include <mir/log.h>
28#include <mir/report_exception.h>
2729
28#include <cstdio>30#include <cstdio>
31#include <sstream>
32
33#include <assert.h>
29#include "screen_hardware.h"34#include "screen_hardware.h"
30#include "power_state_change_reason.h"35#include "power_state_change_reason.h"
31#include "server.h"36#include "server.h"
@@ -33,6 +38,18 @@
33namespace mi = mir::input;38namespace mi = mir::input;
34namespace mg = mir::graphics;39namespace mg = mir::graphics;
3540
41namespace
42{
43void log_exception_in(char const* const func)
44{
45 static char const* const warning_format = "%s failed: %s";
46 std::stringstream buffer;
47
48 mir::report_exception(buffer);
49 mir::log(::mir::logging::Severity::warning, "usc::MirScreen", warning_format, func, buffer.str().c_str());
50}
51}
52
36class usc::MirScreen::LockableCallback : public mir::LockableCallback53class usc::MirScreen::LockableCallback : public mir::LockableCallback
37{54{
38public:55public:
@@ -48,8 +65,7 @@
4865
49 void unlock() override66 void unlock() override
50 {67 {
51 if (guard_lock.owns_lock())68 guard_lock.unlock();
52 guard_lock.unlock();
53 }69 }
54 70
55protected:71protected:
@@ -63,7 +79,11 @@
6379
64 void operator()() override80 void operator()() override
65 {81 {
66 mir_screen->power_off_alarm_notification();82 // We need to hold the lock before calling power_off_alarm_notification_l()
83 // (and not acquire it in that function) as we override the function to
84 // test for deadlock conditions. C.f. test_deadlock_lp1491566.cpp
85 assert(guard_lock.owns_lock());
86 mir_screen->power_off_alarm_notification_l();
67 }87 }
68};88};
6989
@@ -73,7 +93,11 @@
7393
74 void operator()() override94 void operator()() override
75 {95 {
76 mir_screen->dimmer_alarm_notification();96 // We need to hold the lock before calling dimmer_alarm_notification_l()
97 // (and not acquire it in that function) as we override the function to
98 // test for deadlock conditions. C.f. test_deadlock_lp1491566.cpp
99 assert(guard_lock.owns_lock());
100 mir_screen->dimmer_alarm_notification_l();
77 }101 }
78};102};
79103
@@ -106,13 +130,21 @@
106 allow_proximity_to_turn_on_screen{false},130 allow_proximity_to_turn_on_screen{false},
107 turned_on_by_user{true}131 turned_on_by_user{true}
108{132{
109 /*133 try
110 * Make sure the compositor is running as certain conditions can134 {
111 * cause Mir to tear down the compositor threads before we get135 /*
112 * to this point. See bug #1410381.136 * Make sure the compositor is running as certain conditions can
113 */137 * cause Mir to tear down the compositor threads before we get
114 compositor->start();138 * to this point. See bug #1410381.
115 reset_timers_l(PowerStateChangeReason::inactivity);139 */
140 compositor->start();
141 reset_timers_l(PowerStateChangeReason::inactivity);
142 }
143 catch (...)
144 {
145 log_exception_in(__func__);
146 throw;
147 }
116}148}
117149
118usc::MirScreen::~MirScreen() = default;150usc::MirScreen::~MirScreen() = default;
@@ -186,8 +218,9 @@
186}218}
187219
188void usc::MirScreen::set_screen_power_mode_l(MirPowerMode mode, PowerStateChangeReason reason)220void usc::MirScreen::set_screen_power_mode_l(MirPowerMode mode, PowerStateChangeReason reason)
221try
189{222{
190 if (!is_screen_change_allowed(mode, reason))223 if (!is_screen_change_allowed_l(mode, reason))
191 return;224 return;
192225
193 // Notifications don't turn on the screen directly, they rely on proximity events226 // Notifications don't turn on the screen directly, they rely on proximity events
@@ -233,8 +266,13 @@
233 configure_display_l(mode, reason);266 configure_display_l(mode, reason);
234 }267 }
235}268}
269catch (std::exception const&)
270{
271 log_exception_in(__func__);
272}
236273
237void usc::MirScreen::configure_display_l(MirPowerMode mode, PowerStateChangeReason reason)274void usc::MirScreen::configure_display_l(MirPowerMode mode, PowerStateChangeReason reason)
275try
238{276{
239 if (reason != PowerStateChangeReason::proximity)277 if (reason != PowerStateChangeReason::proximity)
240 {278 {
@@ -292,6 +330,10 @@
292 if (!power_on)330 if (!power_on)
293 screen_hardware->allow_suspend();331 screen_hardware->allow_suspend();
294}332}
333catch (std::exception const&)
334{
335 log_exception_in(__func__);
336}
295337
296void usc::MirScreen::cancel_timers_l(PowerStateChangeReason reason)338void usc::MirScreen::cancel_timers_l(PowerStateChangeReason reason)
297{339{
@@ -320,7 +362,7 @@
320 if (!restart_timers)362 if (!restart_timers)
321 return;363 return;
322364
323 auto const timeouts = timeouts_for(reason);365 auto const timeouts = timeouts_for_l(reason);
324 auto const now = clock->now();366 auto const now = clock->now();
325367
326 if (timeouts.power_off_timeout.count() > 0)368 if (timeouts.power_off_timeout.count() > 0)
@@ -362,7 +404,7 @@
362 cancel_timers_l(PowerStateChangeReason::inactivity);404 cancel_timers_l(PowerStateChangeReason::inactivity);
363}405}
364406
365usc::MirScreen::Timeouts usc::MirScreen::timeouts_for(PowerStateChangeReason reason)407usc::MirScreen::Timeouts usc::MirScreen::timeouts_for_l(PowerStateChangeReason reason)
366{408{
367 if (reason == PowerStateChangeReason::notification ||409 if (reason == PowerStateChangeReason::notification ||
368 reason == PowerStateChangeReason::proximity ||410 reason == PowerStateChangeReason::proximity ||
@@ -380,7 +422,7 @@
380 }422 }
381}423}
382424
383bool usc::MirScreen::is_screen_change_allowed(MirPowerMode mode, PowerStateChangeReason reason)425bool usc::MirScreen::is_screen_change_allowed_l(MirPowerMode mode, PowerStateChangeReason reason)
384{426{
385 if (mode == MirPowerMode::mir_power_mode_on &&427 if (mode == MirPowerMode::mir_power_mode_on &&
386 reason == PowerStateChangeReason::proximity &&428 reason == PowerStateChangeReason::proximity &&
@@ -392,13 +434,13 @@
392 return true;434 return true;
393}435}
394436
395void usc::MirScreen::power_off_alarm_notification()437void usc::MirScreen::power_off_alarm_notification_l()
396{438{
397 configure_display_l(MirPowerMode::mir_power_mode_off, PowerStateChangeReason::inactivity);439 configure_display_l(MirPowerMode::mir_power_mode_off, PowerStateChangeReason::inactivity);
398 next_power_off = {};440 next_power_off = {};
399}441}
400442
401void usc::MirScreen::dimmer_alarm_notification()443void usc::MirScreen::dimmer_alarm_notification_l()
402{444{
403 if (current_power_mode != MirPowerMode::mir_power_mode_off)445 if (current_power_mode != MirPowerMode::mir_power_mode_off)
404 screen_hardware->set_dim_backlight();446 screen_hardware->set_dim_backlight();
405447
=== modified file 'src/mir_screen.h'
--- src/mir_screen.h 2015-09-30 10:53:54 +0000
+++ src/mir_screen.h 2016-02-03 23:41:34 +0000
@@ -76,8 +76,8 @@
7676
77protected:77protected:
78 // These are protected virtual because we need to override them in tests78 // These are protected virtual because we need to override them in tests
79 virtual void power_off_alarm_notification();79 virtual void power_off_alarm_notification_l();
80 virtual void dimmer_alarm_notification();80 virtual void dimmer_alarm_notification_l();
8181
82private:82private:
83 enum class ForceResetTimers { no, yes };83 enum class ForceResetTimers { no, yes };
@@ -92,8 +92,8 @@
92 void reset_timers_l(PowerStateChangeReason reason);92 void reset_timers_l(PowerStateChangeReason reason);
93 void reset_timers_ignoring_power_mode_l(PowerStateChangeReason reason, ForceResetTimers force);93 void reset_timers_ignoring_power_mode_l(PowerStateChangeReason reason, ForceResetTimers force);
94 void enable_inactivity_timers_l(bool flag);94 void enable_inactivity_timers_l(bool flag);
95 Timeouts timeouts_for(PowerStateChangeReason reason);95 Timeouts timeouts_for_l(PowerStateChangeReason reason);
96 bool is_screen_change_allowed(MirPowerMode mode, PowerStateChangeReason reason);96 bool is_screen_change_allowed_l(MirPowerMode mode, PowerStateChangeReason reason);
9797
98 void long_press_alarm_notification();98 void long_press_alarm_notification();
9999
100100
=== modified file 'tests/include/usc/test/mock_display.h'
--- tests/include/usc/test/mock_display.h 2015-11-12 12:28:17 +0000
+++ tests/include/usc/test/mock_display.h 2016-02-03 23:41:34 +0000
@@ -20,6 +20,7 @@
20#include "usc/test/stub_display_configuration.h"20#include "usc/test/stub_display_configuration.h"
2121
22#include <mir/graphics/display.h>22#include <mir/graphics/display.h>
23#include <mir/graphics/virtual_output.h>
23#include <gmock/gmock.h>24#include <gmock/gmock.h>
2425
25namespace usc26namespace usc
@@ -60,6 +61,9 @@
6061
61 std::unique_ptr<mir::graphics::GLContext> create_gl_context() override62 std::unique_ptr<mir::graphics::GLContext> create_gl_context() override
62 { return std::unique_ptr<mir::graphics::GLContext>{};};63 { return std::unique_ptr<mir::graphics::GLContext>{};};
64
65 std::unique_ptr<mir::graphics::VirtualOutput> create_virtual_output(int,int) override
66 { return nullptr; }
63};67};
64}68}
65}69}
6670
=== modified file 'tests/integration-tests/test_deadlock_lp1491566.cpp'
--- tests/integration-tests/test_deadlock_lp1491566.cpp 2015-11-12 12:53:39 +0000
+++ tests/integration-tests/test_deadlock_lp1491566.cpp 2016-02-03 23:41:34 +0000
@@ -80,16 +80,16 @@
80public:80public:
81 using usc::MirScreen::MirScreen;81 using usc::MirScreen::MirScreen;
8282
83 void dimmer_alarm_notification() override83 void dimmer_alarm_notification_l() override
84 {84 {
85 before_dimmer_alarm_func();85 before_dimmer_alarm_func();
86 usc::MirScreen::dimmer_alarm_notification();86 usc::MirScreen::dimmer_alarm_notification_l();
87 }87 }
8888
89 void power_off_alarm_notification() override89 void power_off_alarm_notification_l() override
90 {90 {
91 before_power_off_alarm_func();91 before_power_off_alarm_func();
92 usc::MirScreen::power_off_alarm_notification();92 usc::MirScreen::power_off_alarm_notification_l();
93 }93 }
9494
95 std::function<void()> before_dimmer_alarm_func = []{};95 std::function<void()> before_dimmer_alarm_func = []{};

Subscribers

People subscribed via source and target branches