Mir

Merge lp:~kdub/mir/fix-1345533 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: kevin gunn
Approved revision: no longer in the source branch.
Merged at revision: 1783
Proposed branch: lp:~kdub/mir/fix-1345533
Merge into: lp:mir
Diff against target: 45 lines (+26/-1)
2 files modified
src/platform/graphics/android/hwc_common_device.cpp (+8/-1)
tests/unit-tests/graphics/android/test_hwc_common_device.cpp (+18/-0)
To merge this branch: bzr merge lp:~kdub/mir/fix-1345533
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alberto Aguirre (community) Approve
Review via email: mp+227612@code.launchpad.net

Commit message

android: do not propogate errors when initially turning on the display, as some of the rc's from the driver indicate that the display is already in the state that was requested.

fixes: lp: #1345533

Description of the change

android: do not propogate errors when initially turning on the display, as some of the rc's from the driver indicate that the display is already in the state that was requested.

fixes: lp: #1345533

To post a comment you must log in.
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platform/graphics/android/hwc_common_device.cpp'
2--- src/platform/graphics/android/hwc_common_device.cpp 2014-06-25 22:34:19 +0000
3+++ src/platform/graphics/android/hwc_common_device.cpp 2014-07-21 17:41:31 +0000
4@@ -56,7 +56,14 @@
5
6 hwc_device->register_hooks(&callbacks.hooks);
7
8- turn_screen_on();
9+ try
10+ {
11+ turn_screen_on();
12+ } catch (...)
13+ {
14+ //TODO: log failure here. some drivers will throw if the screen is already on, which
15+ // is not a fatal condition
16+ }
17 }
18
19 mga::HWCCommonDevice::~HWCCommonDevice() noexcept
20
21=== modified file 'tests/unit-tests/graphics/android/test_hwc_common_device.cpp'
22--- tests/unit-tests/graphics/android/test_hwc_common_device.cpp 2014-06-25 22:34:19 +0000
23+++ tests/unit-tests/graphics/android/test_hwc_common_device.cpp 2014-07-21 17:41:31 +0000
24@@ -192,3 +192,21 @@
25 auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_fbdev, this->mock_vsync);
26 EXPECT_FALSE(device->apply_orientation(mir_orientation_left));
27 }
28+
29+TYPED_TEST(HWCCommon, first_unblank_failure_is_not_fatal) //lp:1345533
30+{
31+ ON_CALL(*this->mock_device, display_on())
32+ .WillByDefault(testing::Throw(std::runtime_error("error")));
33+ EXPECT_NO_THROW({
34+ auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_fbdev, this->mock_vsync);
35+ });
36+}
37+
38+TYPED_TEST(HWCCommon, first_vsync_failure_is_not_fatal) //lp:1345533
39+{
40+ ON_CALL(*this->mock_device, vsync_signal_on())
41+ .WillByDefault(testing::Throw(std::runtime_error("error")));
42+ EXPECT_NO_THROW({
43+ auto device = make_hwc_device<TypeParam>(this->mock_device, this->mock_fbdev, this->mock_vsync);
44+ });
45+}

Subscribers

People subscribed via source and target branches