Merge lp:~alan-griffiths/mir/fix-1463873 into lp:mir
- fix-1463873
- Merge into development-branch
Status: | Merged |
---|---|
Merged at revision: | 3119 |
Proposed branch: | lp:~alan-griffiths/mir/fix-1463873 |
Merge into: | lp:mir |
Diff against target: |
199 lines (+28/-18) 7 files modified
src/platforms/android/server/display.cpp (+1/-1) src/platforms/android/server/display_configuration.cpp (+1/-1) src/platforms/android/server/display_name.h (+11/-1) src/platforms/android/server/fb_device.cpp (+1/-1) src/platforms/android/server/hwc_blanking_control.cpp (+1/-1) src/platforms/android/server/real_hwc_wrapper.cpp (+12/-12) tests/include/mir/test/doubles/stub_display_builder.h (+1/-1) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/fix-1463873 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Kevin DuBois (community) | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Alberto Aguirre (community) | Approve | ||
Review via email: mp+277552@code.launchpad.net |
Commit message
platforms/android: Don't conflate the display numbering in HWC with the output numbering in Mir (as one is zero based and the other one based).
Description of the change
platforms/android: Don't conflate the display numbering in HWC with the output numbering in Mir (as one is zero based and the other one based).
This enables nested servers to specify the outputs on which to create fullscreen surfaces.
PS Jenkins bot (ps-jenkins) wrote : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good. I would also like for Kevin to take a look before we merge.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3105
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3106
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
None: http://
SUCCESS: http://
deb: http://
None: http://
FAILURE: http://
None: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
Preview Diff
1 | === modified file 'src/platforms/android/server/display.cpp' | |||
2 | --- src/platforms/android/server/display.cpp 2015-10-07 15:32:10 +0000 | |||
3 | +++ src/platforms/android/server/display.cpp 2015-11-19 10:44:11 +0000 | |||
4 | @@ -287,7 +287,7 @@ | |||
5 | 287 | 287 | ||
6 | 288 | void mga::Display::on_vsync(DisplayName name) const | 288 | void mga::Display::on_vsync(DisplayName name) const |
7 | 289 | { | 289 | { |
9 | 290 | display_report->report_vsync(name); | 290 | display_report->report_vsync(as_output_id(name).as_value()); |
10 | 291 | } | 291 | } |
11 | 292 | 292 | ||
12 | 293 | void mga::Display::register_configuration_change_handler( | 293 | void mga::Display::register_configuration_change_handler( |
13 | 294 | 294 | ||
14 | === modified file 'src/platforms/android/server/display_configuration.cpp' | |||
15 | --- src/platforms/android/server/display_configuration.cpp 2015-10-30 11:07:02 +0000 | |||
16 | +++ src/platforms/android/server/display_configuration.cpp 2015-11-19 10:44:11 +0000 | |||
17 | @@ -100,7 +100,7 @@ | |||
18 | 100 | 100 | ||
19 | 101 | mg::DisplayConfigurationOutput& mga::DisplayConfiguration::operator[](mg::DisplayConfigurationOutputId const& disp_id) | 101 | mg::DisplayConfigurationOutput& mga::DisplayConfiguration::operator[](mg::DisplayConfigurationOutputId const& disp_id) |
20 | 102 | { | 102 | { |
22 | 103 | auto id = disp_id.as_value(); | 103 | auto id = disp_id.as_value() - 1; |
23 | 104 | if (id != primary_id && id != external_id) | 104 | if (id != primary_id && id != external_id) |
24 | 105 | BOOST_THROW_EXCEPTION(std::invalid_argument("invalid display id")); | 105 | BOOST_THROW_EXCEPTION(std::invalid_argument("invalid display id")); |
25 | 106 | return configurations[id]; | 106 | return configurations[id]; |
26 | 107 | 107 | ||
27 | === modified file 'src/platforms/android/server/display_name.h' | |||
28 | --- src/platforms/android/server/display_name.h 2015-01-22 09:00:14 +0000 | |||
29 | +++ src/platforms/android/server/display_name.h 2015-11-19 10:44:11 +0000 | |||
30 | @@ -19,6 +19,7 @@ | |||
31 | 19 | #ifndef MIR_GRAPHICS_ANDROID_DISPLAY_NAME_H_ | 19 | #ifndef MIR_GRAPHICS_ANDROID_DISPLAY_NAME_H_ |
32 | 20 | #define MIR_GRAPHICS_ANDROID_DISPLAY_NAME_H_ | 20 | #define MIR_GRAPHICS_ANDROID_DISPLAY_NAME_H_ |
33 | 21 | 21 | ||
34 | 22 | #include "mir/graphics/display_configuration.h" | ||
35 | 22 | #include <hardware/hwcomposer.h> | 23 | #include <hardware/hwcomposer.h> |
36 | 23 | 24 | ||
37 | 24 | namespace mir | 25 | namespace mir |
38 | @@ -28,13 +29,22 @@ | |||
39 | 28 | namespace android | 29 | namespace android |
40 | 29 | { | 30 | { |
41 | 30 | 31 | ||
43 | 31 | enum DisplayName | 32 | enum class DisplayName |
44 | 32 | { | 33 | { |
45 | 33 | primary = HWC_DISPLAY_PRIMARY, | 34 | primary = HWC_DISPLAY_PRIMARY, |
46 | 34 | external = HWC_DISPLAY_EXTERNAL, | 35 | external = HWC_DISPLAY_EXTERNAL, |
47 | 35 | virt = HWC_DISPLAY_VIRTUAL | 36 | virt = HWC_DISPLAY_VIRTUAL |
48 | 36 | }; | 37 | }; |
49 | 37 | 38 | ||
50 | 39 | inline auto as_output_id(DisplayName name) -> DisplayConfigurationOutputId | ||
51 | 40 | { | ||
52 | 41 | return DisplayConfigurationOutputId{1 + static_cast<int>(name)}; | ||
53 | 42 | } | ||
54 | 43 | |||
55 | 44 | inline auto as_hwc_display(DisplayName name) -> int | ||
56 | 45 | { | ||
57 | 46 | return static_cast<int>(name); | ||
58 | 47 | } | ||
59 | 38 | } | 48 | } |
60 | 39 | } | 49 | } |
61 | 40 | } | 50 | } |
62 | 41 | 51 | ||
63 | === modified file 'src/platforms/android/server/fb_device.cpp' | |||
64 | --- src/platforms/android/server/fb_device.cpp 2015-10-07 12:07:00 +0000 | |||
65 | +++ src/platforms/android/server/fb_device.cpp 2015-11-19 10:44:11 +0000 | |||
66 | @@ -58,7 +58,7 @@ | |||
67 | 58 | auto const connected = (display_name == DisplayName::primary); | 58 | auto const connected = (display_name == DisplayName::primary); |
68 | 59 | 59 | ||
69 | 60 | return { | 60 | return { |
71 | 61 | static_cast<mg::DisplayConfigurationOutputId>(display_name), | 61 | as_output_id(display_name), |
72 | 62 | mg::DisplayConfigurationCardId{0}, | 62 | mg::DisplayConfigurationCardId{0}, |
73 | 63 | mg::DisplayConfigurationOutputType::lvds, | 63 | mg::DisplayConfigurationOutputType::lvds, |
74 | 64 | std::vector<MirPixelFormat>{mga::to_mir_format(fb_device->format)}, | 64 | std::vector<MirPixelFormat>{mga::to_mir_format(fb_device->format)}, |
75 | 65 | 65 | ||
76 | === modified file 'src/platforms/android/server/hwc_blanking_control.cpp' | |||
77 | --- src/platforms/android/server/hwc_blanking_control.cpp 2015-10-02 04:27:34 +0000 | |||
78 | +++ src/platforms/android/server/hwc_blanking_control.cpp 2015-11-19 10:44:11 +0000 | |||
79 | @@ -139,7 +139,7 @@ | |||
80 | 139 | } | 139 | } |
81 | 140 | 140 | ||
82 | 141 | return { | 141 | return { |
84 | 142 | static_cast<mg::DisplayConfigurationOutputId>(name), | 142 | as_output_id(name), |
85 | 143 | mg::DisplayConfigurationCardId{0}, | 143 | mg::DisplayConfigurationCardId{0}, |
86 | 144 | type, | 144 | type, |
87 | 145 | {display_format}, | 145 | {display_format}, |
88 | 146 | 146 | ||
89 | === modified file 'src/platforms/android/server/real_hwc_wrapper.cpp' | |||
90 | --- src/platforms/android/server/real_hwc_wrapper.cpp 2015-10-07 02:34:05 +0000 | |||
91 | +++ src/platforms/android/server/real_hwc_wrapper.cpp 2015-11-19 10:44:11 +0000 | |||
92 | @@ -138,7 +138,7 @@ | |||
93 | 138 | 138 | ||
94 | 139 | void mga::RealHwcWrapper::vsync_signal_on(DisplayName display_name) const | 139 | void mga::RealHwcWrapper::vsync_signal_on(DisplayName display_name) const |
95 | 140 | { | 140 | { |
97 | 141 | if (auto rc = hwc_device->eventControl(hwc_device.get(), display_name, HWC_EVENT_VSYNC, 1)) | 141 | if (auto rc = hwc_device->eventControl(hwc_device.get(), as_hwc_display(display_name), HWC_EVENT_VSYNC, 1)) |
98 | 142 | { | 142 | { |
99 | 143 | std::stringstream ss; | 143 | std::stringstream ss; |
100 | 144 | ss << "error turning vsync signal on. rc = " << std::hex << rc; | 144 | ss << "error turning vsync signal on. rc = " << std::hex << rc; |
101 | @@ -149,7 +149,7 @@ | |||
102 | 149 | 149 | ||
103 | 150 | void mga::RealHwcWrapper::vsync_signal_off(DisplayName display_name) const | 150 | void mga::RealHwcWrapper::vsync_signal_off(DisplayName display_name) const |
104 | 151 | { | 151 | { |
106 | 152 | if (auto rc = hwc_device->eventControl(hwc_device.get(), display_name, HWC_EVENT_VSYNC, 0)) | 152 | if (auto rc = hwc_device->eventControl(hwc_device.get(), as_hwc_display(display_name), HWC_EVENT_VSYNC, 0)) |
107 | 153 | { | 153 | { |
108 | 154 | std::stringstream ss; | 154 | std::stringstream ss; |
109 | 155 | ss << "error turning vsync signal off. rc = " << std::hex << rc; | 155 | ss << "error turning vsync signal off. rc = " << std::hex << rc; |
110 | @@ -160,7 +160,7 @@ | |||
111 | 160 | 160 | ||
112 | 161 | void mga::RealHwcWrapper::display_on(DisplayName display_name) const | 161 | void mga::RealHwcWrapper::display_on(DisplayName display_name) const |
113 | 162 | { | 162 | { |
115 | 163 | if (auto rc = hwc_device->blank(hwc_device.get(), display_name, 0)) | 163 | if (auto rc = hwc_device->blank(hwc_device.get(), as_hwc_display(display_name), 0)) |
116 | 164 | { | 164 | { |
117 | 165 | std::stringstream ss; | 165 | std::stringstream ss; |
118 | 166 | ss << "error turning display on. rc = " << std::hex << rc; | 166 | ss << "error turning display on. rc = " << std::hex << rc; |
119 | @@ -171,7 +171,7 @@ | |||
120 | 171 | 171 | ||
121 | 172 | void mga::RealHwcWrapper::display_off(DisplayName display_name) const | 172 | void mga::RealHwcWrapper::display_off(DisplayName display_name) const |
122 | 173 | { | 173 | { |
124 | 174 | if (auto rc = hwc_device->blank(hwc_device.get(), display_name, 1)) | 174 | if (auto rc = hwc_device->blank(hwc_device.get(), as_hwc_display(display_name), 1)) |
125 | 175 | { | 175 | { |
126 | 176 | std::stringstream ss; | 176 | std::stringstream ss; |
127 | 177 | ss << "error turning display off. rc = " << std::hex << rc; | 177 | ss << "error turning display off. rc = " << std::hex << rc; |
128 | @@ -249,7 +249,7 @@ | |||
129 | 249 | static size_t const max_configs = 16; | 249 | static size_t const max_configs = 16; |
130 | 250 | size_t num_configs = max_configs; | 250 | size_t num_configs = max_configs; |
131 | 251 | static uint32_t display_config[max_configs] = {}; | 251 | static uint32_t display_config[max_configs] = {}; |
133 | 252 | if (hwc_device->getDisplayConfigs(hwc_device.get(), display_name, display_config, &num_configs)) | 252 | if (hwc_device->getDisplayConfigs(hwc_device.get(), as_hwc_display(display_name), display_config, &num_configs)) |
134 | 253 | return {}; | 253 | return {}; |
135 | 254 | 254 | ||
136 | 255 | auto i = 0u; | 255 | auto i = 0u; |
137 | @@ -263,12 +263,12 @@ | |||
138 | 263 | DisplayName display_name, ConfigId config, uint32_t const* attributes, int32_t* values) const | 263 | DisplayName display_name, ConfigId config, uint32_t const* attributes, int32_t* values) const |
139 | 264 | { | 264 | { |
140 | 265 | return hwc_device->getDisplayAttributes( | 265 | return hwc_device->getDisplayAttributes( |
142 | 266 | hwc_device.get(), display_name, config.as_value(), attributes, values); | 266 | hwc_device.get(), as_hwc_display(display_name), config.as_value(), attributes, values); |
143 | 267 | } | 267 | } |
144 | 268 | 268 | ||
145 | 269 | void mga::RealHwcWrapper::power_mode(DisplayName display_name, PowerMode mode) const | 269 | void mga::RealHwcWrapper::power_mode(DisplayName display_name, PowerMode mode) const |
146 | 270 | { | 270 | { |
148 | 271 | if (auto rc = hwc_device->setPowerMode(hwc_device.get(), display_name, static_cast<int>(mode))) | 271 | if (auto rc = hwc_device->setPowerMode(hwc_device.get(), as_hwc_display(display_name), static_cast<int>(mode))) |
149 | 272 | { | 272 | { |
150 | 273 | std::stringstream ss; | 273 | std::stringstream ss; |
151 | 274 | ss << "error setting power mode. rc = " << std::hex << rc; | 274 | ss << "error setting power mode. rc = " << std::hex << rc; |
152 | @@ -280,16 +280,16 @@ | |||
153 | 280 | bool mga::RealHwcWrapper::has_active_config(DisplayName display_name) const | 280 | bool mga::RealHwcWrapper::has_active_config(DisplayName display_name) const |
154 | 281 | { | 281 | { |
155 | 282 | int const no_active_config = -1; | 282 | int const no_active_config = -1; |
157 | 283 | return hwc_device->getActiveConfig(hwc_device.get(), display_name) != no_active_config; | 283 | return hwc_device->getActiveConfig(hwc_device.get(), as_hwc_display(display_name)) != no_active_config; |
158 | 284 | } | 284 | } |
159 | 285 | 285 | ||
160 | 286 | mga::ConfigId mga::RealHwcWrapper::active_config_for(DisplayName display_name) const | 286 | mga::ConfigId mga::RealHwcWrapper::active_config_for(DisplayName display_name) const |
161 | 287 | { | 287 | { |
163 | 288 | int id = hwc_device->getActiveConfig(hwc_device.get(), display_name); | 288 | int id = hwc_device->getActiveConfig(hwc_device.get(), as_hwc_display(display_name)); |
164 | 289 | if (id == -1) | 289 | if (id == -1) |
165 | 290 | { | 290 | { |
166 | 291 | std::stringstream ss; | 291 | std::stringstream ss; |
168 | 292 | ss << "No active configuration for display: " << display_name; | 292 | ss << "No active configuration for display: " << as_hwc_display(display_name); |
169 | 293 | BOOST_THROW_EXCEPTION(std::runtime_error(ss.str())); | 293 | BOOST_THROW_EXCEPTION(std::runtime_error(ss.str())); |
170 | 294 | } | 294 | } |
171 | 295 | return mga::ConfigId{static_cast<uint32_t>(id)}; | 295 | return mga::ConfigId{static_cast<uint32_t>(id)}; |
172 | @@ -297,7 +297,7 @@ | |||
173 | 297 | 297 | ||
174 | 298 | void mga::RealHwcWrapper::set_active_config(DisplayName display_name, ConfigId id) const | 298 | void mga::RealHwcWrapper::set_active_config(DisplayName display_name, ConfigId id) const |
175 | 299 | { | 299 | { |
177 | 300 | int rc = hwc_device->setActiveConfig(hwc_device.get(), display_name, id.as_value()); | 300 | int rc = hwc_device->setActiveConfig(hwc_device.get(), as_hwc_display(display_name), id.as_value()); |
178 | 301 | if (rc < 0) | 301 | if (rc < 0) |
179 | 302 | BOOST_THROW_EXCEPTION(std::system_error(rc, std::system_category(), "unable to set active display config")); | 302 | BOOST_THROW_EXCEPTION(std::system_error(rc, std::system_category(), "unable to set active display config")); |
180 | 303 | } | 303 | } |
181 | @@ -305,5 +305,5 @@ | |||
182 | 305 | bool mga::RealHwcWrapper::display_connected(DisplayName display_name) const | 305 | bool mga::RealHwcWrapper::display_connected(DisplayName display_name) const |
183 | 306 | { | 306 | { |
184 | 307 | size_t num_configs = 0; | 307 | size_t num_configs = 0; |
186 | 308 | return hwc_device->getDisplayConfigs(hwc_device.get(), display_name, nullptr, &num_configs) == 0; | 308 | return hwc_device->getDisplayConfigs(hwc_device.get(), as_hwc_display(display_name), nullptr, &num_configs) == 0; |
187 | 309 | } | 309 | } |
188 | 310 | 310 | ||
189 | === modified file 'tests/include/mir/test/doubles/stub_display_builder.h' | |||
190 | --- tests/include/mir/test/doubles/stub_display_builder.h 2015-07-27 07:24:50 +0000 | |||
191 | +++ tests/include/mir/test/doubles/stub_display_builder.h 2015-11-19 10:44:11 +0000 | |||
192 | @@ -70,7 +70,7 @@ | |||
193 | 70 | { | 70 | { |
194 | 71 | bool connected{name == graphics::android::DisplayName::primary}; | 71 | bool connected{name == graphics::android::DisplayName::primary}; |
195 | 72 | auto config = StubDisplayConfig({{connected, connected}}).outputs[0]; | 72 | auto config = StubDisplayConfig({{connected, connected}}).outputs[0]; |
197 | 73 | config.id = static_cast<graphics::DisplayConfigurationOutputId>(name); | 73 | config.id = as_output_id(name); |
198 | 74 | return config; | 74 | return config; |
199 | 75 | } | 75 | } |
200 | 76 | 76 |
FAILED: Continuous integration, rev:3104 jenkins. qa.ubuntu. com/job/ mir-ci/ 5553/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/4880/ console jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/3787 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/4822/ console jenkins. qa.ubuntu. com/job/ mir-mediumtests -wily-touch/ 780/console jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1707 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1707/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 780 jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 780/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 4823/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- wily-armhf/ 781/console
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/5553/ rebuild
http://