Merge lp:~vanvugt/mir/set-logical-size into lp:mir
- set-logical-size
- Merge into development-branch
Proposed by
Daniel van Vugt
Status: | Superseded |
---|---|
Proposed branch: | lp:~vanvugt/mir/set-logical-size |
Merge into: | lp:mir |
Diff against target: |
779 lines (+247/-20) 28 files modified
include/client/mir_toolkit/mir_display_configuration.h (+14/-0) include/platform/mir/graphics/display_configuration.h (+12/-0) src/client/display_configuration_api.cpp (+13/-0) src/client/symbols.map (+6/-1) src/platform/graphics/display_configuration.cpp (+35/-3) src/platform/graphics/overlapping_output_grouping.cpp (+2/-2) src/platform/symbols.map (+7/-0) src/platforms/android/server/display.cpp (+2/-2) src/platforms/android/server/display_configuration.cpp (+1/-0) src/platforms/android/server/fb_device.cpp (+1/-0) src/platforms/android/server/hwc_blanking_control.cpp (+1/-0) src/platforms/eglstream-kms/server/display.cpp (+1/-1) src/platforms/mesa/server/kms/display.cpp (+5/-9) src/platforms/mesa/server/x11/graphics/display.cpp (+3/-1) src/platforms/mesa/server/x11/graphics/display_configuration.cpp (+1/-0) src/server/frontend/session_mediator.cpp (+6/-0) src/server/graphics/nested/nested_display_configuration.cpp (+3/-1) src/server/graphics/offscreen/display_configuration.cpp (+1/-0) tests/acceptance-tests/test_latency.cpp (+1/-0) tests/acceptance-tests/test_new_display_configuration.cpp (+55/-0) tests/mir_test/display_config_matchers.cpp (+3/-0) tests/mir_test_doubles/stub_display_configuration.cpp (+4/-0) tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+1/-0) tests/unit-tests/graphics/test_display_configuration.cpp (+48/-0) tests/unit-tests/graphics/test_overlapping_output_grouping.cpp (+1/-0) tests/unit-tests/platforms/mesa/kms/test_cursor.cpp (+3/-0) tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp (+9/-0) tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp (+8/-0) |
To merge this branch: | bzr merge lp:~vanvugt/mir/set-logical-size |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir development team | Pending | ||
Review via email: mp+322511@code.launchpad.net |
This proposal has been superseded by a proposal from 2017-04-13.
Commit message
Add the ability to set the logical size/resolution of an output,
independently of its physical resolution.
That's another big step in LP: #1639226, almost done.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'include/client/mir_toolkit/mir_display_configuration.h' | |||
2 | --- include/client/mir_toolkit/mir_display_configuration.h 2017-02-17 08:46:05 +0000 | |||
3 | +++ include/client/mir_toolkit/mir_display_configuration.h 2017-04-13 08:26:06 +0000 | |||
4 | @@ -333,6 +333,20 @@ | |||
5 | 333 | unsigned int mir_output_get_logical_height(MirOutput const* output); | 333 | unsigned int mir_output_get_logical_height(MirOutput const* output); |
6 | 334 | 334 | ||
7 | 335 | /** | 335 | /** |
8 | 336 | * Set the logical size of the virtual display space occupied by an output. | ||
9 | 337 | * By default this is the dimensions of the output's current mode, but you | ||
10 | 338 | * can now set it to an arbitrary size and the compositor will scale | ||
11 | 339 | * accordingly. | ||
12 | 340 | * | ||
13 | 341 | * \param [in] output The output to modify | ||
14 | 342 | * \param [in] w The width in logical view area pixels, or zero to | ||
15 | 343 | * revert to the current display mode dimensions. | ||
16 | 344 | * \param [in] h The height in logical view area pixels, or zero to | ||
17 | 345 | * revert to the current display mode dimensions. | ||
18 | 346 | */ | ||
19 | 347 | void mir_output_set_logical_size(MirOutput* output, unsigned w, unsigned h); | ||
20 | 348 | |||
21 | 349 | /** | ||
22 | 336 | * Set the coordinates of the top-left point of the output in the virtual | 350 | * Set the coordinates of the top-left point of the output in the virtual |
23 | 337 | * display space. | 351 | * display space. |
24 | 338 | * | 352 | * |
25 | 339 | 353 | ||
26 | === modified file 'include/platform/mir/graphics/display_configuration.h' | |||
27 | --- include/platform/mir/graphics/display_configuration.h 2017-01-18 02:29:37 +0000 | |||
28 | +++ include/platform/mir/graphics/display_configuration.h 2017-04-13 08:26:06 +0000 | |||
29 | @@ -24,8 +24,11 @@ | |||
30 | 24 | #include "mir/geometry/rectangle.h" | 24 | #include "mir/geometry/rectangle.h" |
31 | 25 | #include "mir/geometry/point.h" | 25 | #include "mir/geometry/point.h" |
32 | 26 | #include "mir/graphics/gamma_curves.h" | 26 | #include "mir/graphics/gamma_curves.h" |
33 | 27 | #include "mir/optional_value.h" | ||
34 | 27 | #include "mir_toolkit/common.h" | 28 | #include "mir_toolkit/common.h" |
35 | 28 | 29 | ||
36 | 30 | #include <glm/glm.hpp> | ||
37 | 31 | |||
38 | 29 | #include <functional> | 32 | #include <functional> |
39 | 30 | #include <vector> | 33 | #include <vector> |
40 | 31 | #include <memory> | 34 | #include <memory> |
41 | @@ -130,10 +133,18 @@ | |||
42 | 130 | /** EDID of the display, if non-empty */ | 133 | /** EDID of the display, if non-empty */ |
43 | 131 | std::vector<uint8_t> edid; | 134 | std::vector<uint8_t> edid; |
44 | 132 | 135 | ||
45 | 136 | mir::optional_value<geometry::Size> custom_logical_size; | ||
46 | 137 | |||
47 | 133 | /** The logical rectangle occupied by the output, based on its position, | 138 | /** The logical rectangle occupied by the output, based on its position, |
48 | 134 | current mode and orientation (rotation) */ | 139 | current mode and orientation (rotation) */ |
49 | 135 | geometry::Rectangle extents() const; | 140 | geometry::Rectangle extents() const; |
50 | 136 | bool valid() const; | 141 | bool valid() const; |
51 | 142 | |||
52 | 143 | /** | ||
53 | 144 | * The transformation required to map this output's logical view area | ||
54 | 145 | * (returned by extents()) on to the output's current mode. | ||
55 | 146 | */ | ||
56 | 147 | glm::mat2 transformation() const; | ||
57 | 137 | }; | 148 | }; |
58 | 138 | 149 | ||
59 | 139 | /** | 150 | /** |
60 | @@ -162,6 +173,7 @@ | |||
61 | 162 | GammaCurves& gamma; | 173 | GammaCurves& gamma; |
62 | 163 | MirOutputGammaSupported const& gamma_supported; | 174 | MirOutputGammaSupported const& gamma_supported; |
63 | 164 | std::vector<uint8_t const> const& edid; | 175 | std::vector<uint8_t const> const& edid; |
64 | 176 | mir::optional_value<geometry::Size>& custom_logical_size; | ||
65 | 165 | 177 | ||
66 | 166 | UserDisplayConfigurationOutput(DisplayConfigurationOutput& master); | 178 | UserDisplayConfigurationOutput(DisplayConfigurationOutput& master); |
67 | 167 | geometry::Rectangle extents() const; | 179 | geometry::Rectangle extents() const; |
68 | 168 | 180 | ||
69 | === modified file 'src/client/display_configuration_api.cpp' | |||
70 | --- src/client/display_configuration_api.cpp 2017-02-17 08:46:05 +0000 | |||
71 | +++ src/client/display_configuration_api.cpp 2017-04-13 08:26:06 +0000 | |||
72 | @@ -261,6 +261,19 @@ | |||
73 | 261 | return output->logical_height(); | 261 | return output->logical_height(); |
74 | 262 | } | 262 | } |
75 | 263 | 263 | ||
76 | 264 | void mir_output_set_logical_size(MirOutput* output, unsigned w, unsigned h) | ||
77 | 265 | { | ||
78 | 266 | if (w) | ||
79 | 267 | output->set_logical_width(w); | ||
80 | 268 | else | ||
81 | 269 | output->clear_logical_width(); | ||
82 | 270 | |||
83 | 271 | if (h) | ||
84 | 272 | output->set_logical_height(h); | ||
85 | 273 | else | ||
86 | 274 | output->clear_logical_height(); | ||
87 | 275 | } | ||
88 | 276 | |||
89 | 264 | void mir_output_set_position(MirOutput* output, int x, int y) | 277 | void mir_output_set_position(MirOutput* output, int x, int y) |
90 | 265 | { | 278 | { |
91 | 266 | output->set_position_x(x); | 279 | output->set_position_x(x); |
92 | 267 | 280 | ||
93 | === modified file 'src/client/symbols.map' | |||
94 | --- src/client/symbols.map 2017-04-13 04:26:20 +0000 | |||
95 | +++ src/client/symbols.map 2017-04-13 08:26:06 +0000 | |||
96 | @@ -579,7 +579,7 @@ | |||
97 | 579 | }; | 579 | }; |
98 | 580 | } MIR_CLIENT_DETAIL_0.26.1; | 580 | } MIR_CLIENT_DETAIL_0.26.1; |
99 | 581 | 581 | ||
101 | 582 | MIR_CLIENT_0.27 { # New functions in Mir 0.27 or 1.0 | 582 | MIR_CLIENT_0.27 { # New functions in Mir 0.27 |
102 | 583 | global: | 583 | global: |
103 | 584 | mir_connection_apply_session_input_config; | 584 | mir_connection_apply_session_input_config; |
104 | 585 | mir_connection_set_base_input_config; | 585 | mir_connection_set_base_input_config; |
105 | @@ -611,3 +611,8 @@ | |||
106 | 611 | mir_touchscreen_config_set_mapping_mode; | 611 | mir_touchscreen_config_set_mapping_mode; |
107 | 612 | mir_touchscreen_config_set_output_id; | 612 | mir_touchscreen_config_set_output_id; |
108 | 613 | } MIR_CLIENT_0.26.1; | 613 | } MIR_CLIENT_0.26.1; |
109 | 614 | |||
110 | 615 | MIR_CLIENT_0.28 { # New functions in Mir 0.28 | ||
111 | 616 | global: | ||
112 | 617 | mir_output_set_logical_size; | ||
113 | 618 | } MIR_CLIENT_0.27; | ||
114 | 614 | 619 | ||
115 | === modified file 'src/platform/graphics/display_configuration.cpp' | |||
116 | --- src/platform/graphics/display_configuration.cpp 2017-01-18 02:29:37 +0000 | |||
117 | +++ src/platform/graphics/display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
118 | @@ -18,6 +18,7 @@ | |||
119 | 18 | 18 | ||
120 | 19 | #include "mir/graphics/display_configuration.h" | 19 | #include "mir/graphics/display_configuration.h" |
121 | 20 | #include "mir/output_type_names.h" | 20 | #include "mir/output_type_names.h" |
122 | 21 | #include "mir/graphics/transformation.h" | ||
123 | 21 | 22 | ||
124 | 22 | #include <ostream> | 23 | #include <ostream> |
125 | 23 | #include <algorithm> | 24 | #include <algorithm> |
126 | @@ -243,7 +244,28 @@ | |||
127 | 243 | 244 | ||
128 | 244 | mir::geometry::Rectangle mg::DisplayConfigurationOutput::extents() const | 245 | mir::geometry::Rectangle mg::DisplayConfigurationOutput::extents() const |
129 | 245 | { | 246 | { |
131 | 246 | return extents_of(modes, current_mode_index, orientation, top_left); | 247 | return custom_logical_size.is_set() ? |
132 | 248 | mir::geometry::Rectangle(top_left, custom_logical_size.value()) : | ||
133 | 249 | extents_of(modes, current_mode_index, orientation, top_left); | ||
134 | 250 | } | ||
135 | 251 | |||
136 | 252 | glm::mat2 mg::DisplayConfigurationOutput::transformation() const | ||
137 | 253 | { | ||
138 | 254 | auto rot = mg::transformation(orientation); | ||
139 | 255 | |||
140 | 256 | if (!custom_logical_size.is_set()) | ||
141 | 257 | return rot; | ||
142 | 258 | |||
143 | 259 | auto const& physical_size = extents_of(modes, current_mode_index, | ||
144 | 260 | orientation, top_left).size; | ||
145 | 261 | auto const& logical_size = custom_logical_size.value(); | ||
146 | 262 | |||
147 | 263 | float scale_x = static_cast<float>(physical_size.width.as_int()) / | ||
148 | 264 | logical_size.width.as_int(); | ||
149 | 265 | float scale_y = static_cast<float>(physical_size.height.as_int()) / | ||
150 | 266 | logical_size.height.as_int(); | ||
151 | 267 | |||
152 | 268 | return glm::mat2(scale_x, 0, 0, scale_y) * rot; | ||
153 | 247 | } | 269 | } |
154 | 248 | 270 | ||
155 | 249 | bool mg::DisplayConfigurationOutput::valid() const | 271 | bool mg::DisplayConfigurationOutput::valid() const |
156 | @@ -260,6 +282,13 @@ | |||
157 | 260 | if (current_mode_index >= nmodes) | 282 | if (current_mode_index >= nmodes) |
158 | 261 | return false; | 283 | return false; |
159 | 262 | 284 | ||
160 | 285 | if (custom_logical_size.is_set()) | ||
161 | 286 | { | ||
162 | 287 | auto const& logical_size = custom_logical_size.value(); | ||
163 | 288 | if (!logical_size.width.as_int() || !logical_size.height.as_int()) | ||
164 | 289 | return false; | ||
165 | 290 | } | ||
166 | 291 | |||
167 | 263 | return true; | 292 | return true; |
168 | 264 | } | 293 | } |
169 | 265 | 294 | ||
170 | @@ -297,13 +326,16 @@ | |||
171 | 297 | subpixel_arrangement(master.subpixel_arrangement), | 326 | subpixel_arrangement(master.subpixel_arrangement), |
172 | 298 | gamma(master.gamma), | 327 | gamma(master.gamma), |
173 | 299 | gamma_supported(master.gamma_supported), | 328 | gamma_supported(master.gamma_supported), |
175 | 300 | edid(*reinterpret_cast<std::vector<uint8_t const>*>(&master.edid)) | 329 | edid(*reinterpret_cast<std::vector<uint8_t const>*>(&master.edid)), |
176 | 330 | custom_logical_size(master.custom_logical_size) | ||
177 | 301 | { | 331 | { |
178 | 302 | } | 332 | } |
179 | 303 | 333 | ||
180 | 304 | mir::geometry::Rectangle mg::UserDisplayConfigurationOutput::extents() const | 334 | mir::geometry::Rectangle mg::UserDisplayConfigurationOutput::extents() const |
181 | 305 | { | 335 | { |
183 | 306 | return extents_of(modes, current_mode_index, orientation, top_left); | 336 | return custom_logical_size.is_set() ? |
184 | 337 | mir::geometry::Rectangle(top_left, custom_logical_size.value()) : | ||
185 | 338 | extents_of(modes, current_mode_index, orientation, top_left); | ||
186 | 307 | } | 339 | } |
187 | 308 | 340 | ||
188 | 309 | 341 | ||
189 | 310 | 342 | ||
190 | === modified file 'src/platform/graphics/overlapping_output_grouping.cpp' | |||
191 | --- src/platform/graphics/overlapping_output_grouping.cpp 2015-02-22 07:46:25 +0000 | |||
192 | +++ src/platform/graphics/overlapping_output_grouping.cpp 2017-04-13 08:26:06 +0000 | |||
193 | @@ -112,11 +112,11 @@ | |||
194 | 112 | { | 112 | { |
195 | 113 | /* | 113 | /* |
196 | 114 | * Prevent grouping of outputs when they have differing | 114 | * Prevent grouping of outputs when they have differing |
198 | 115 | * orientations. It's safer to assume the hardware can't | 115 | * transformations. It's safer to assume the hardware can't |
199 | 116 | * handle it for now... until proven otherwise. | 116 | * handle it for now... until proven otherwise. |
200 | 117 | */ | 117 | */ |
201 | 118 | if (conf_o.extents().overlaps(rect_output) && | 118 | if (conf_o.extents().overlaps(rect_output) && |
203 | 119 | conf_o.orientation == conf_output.orientation) | 119 | conf_o.transformation() == conf_output.transformation()) |
204 | 120 | found_overlap = true; | 120 | found_overlap = true; |
205 | 121 | }); | 121 | }); |
206 | 122 | 122 | ||
207 | 123 | 123 | ||
208 | === modified file 'src/platform/symbols.map' | |||
209 | --- src/platform/symbols.map 2017-04-05 03:11:28 +0000 | |||
210 | +++ src/platform/symbols.map 2017-04-13 08:26:06 +0000 | |||
211 | @@ -159,3 +159,10 @@ | |||
212 | 159 | }; | 159 | }; |
213 | 160 | local: *; | 160 | local: *; |
214 | 161 | }; | 161 | }; |
215 | 162 | |||
216 | 163 | MIRPLATFORM_0.28 { | ||
217 | 164 | global: | ||
218 | 165 | extern "C++" { | ||
219 | 166 | mir::graphics::DisplayConfigurationOutput::transformation*; | ||
220 | 167 | }; | ||
221 | 168 | } MIRPLATFORM_0.27; | ||
222 | 162 | 169 | ||
223 | === modified file 'src/platforms/android/server/display.cpp' | |||
224 | --- src/platforms/android/server/display.cpp 2017-04-05 03:11:28 +0000 | |||
225 | +++ src/platforms/android/server/display.cpp 2017-04-13 08:26:06 +0000 | |||
226 | @@ -133,7 +133,7 @@ | |||
227 | 133 | native_window, | 133 | native_window, |
228 | 134 | gl_context, | 134 | gl_context, |
229 | 135 | *gl_program_factory, | 135 | *gl_program_factory, |
231 | 136 | mg::transformation(config.orientation), | 136 | config.transformation(), |
232 | 137 | config.extents(), | 137 | config.extents(), |
233 | 138 | overlay_option)); | 138 | overlay_option)); |
234 | 139 | } | 139 | } |
235 | @@ -398,7 +398,7 @@ | |||
236 | 398 | config[output.id].scale = output.scale; | 398 | config[output.id].scale = output.scale; |
237 | 399 | config[output.id].top_left = output.top_left; | 399 | config[output.id].top_left = output.top_left; |
238 | 400 | 400 | ||
240 | 401 | auto const& transform = mg::transformation(output.orientation); | 401 | auto const& transform = output.transformation(); |
241 | 402 | 402 | ||
242 | 403 | if (config.primary().id == output.id) | 403 | if (config.primary().id == output.id) |
243 | 404 | { | 404 | { |
244 | 405 | 405 | ||
245 | === modified file 'src/platforms/android/server/display_configuration.cpp' | |||
246 | --- src/platforms/android/server/display_configuration.cpp 2017-01-18 02:29:37 +0000 | |||
247 | +++ src/platforms/android/server/display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
248 | @@ -69,6 +69,7 @@ | |||
249 | 69 | subpixel_arrangement, | 69 | subpixel_arrangement, |
250 | 70 | {}, | 70 | {}, |
251 | 71 | mir_output_gamma_unsupported, | 71 | mir_output_gamma_unsupported, |
252 | 72 | {}, | ||
253 | 72 | {} | 73 | {} |
254 | 73 | }; | 74 | }; |
255 | 74 | } | 75 | } |
256 | 75 | 76 | ||
257 | === modified file 'src/platforms/android/server/fb_device.cpp' | |||
258 | --- src/platforms/android/server/fb_device.cpp 2017-01-18 02:29:37 +0000 | |||
259 | +++ src/platforms/android/server/fb_device.cpp 2017-04-13 08:26:06 +0000 | |||
260 | @@ -92,6 +92,7 @@ | |||
261 | 92 | mir_subpixel_arrangement_unknown, | 92 | mir_subpixel_arrangement_unknown, |
262 | 93 | {}, | 93 | {}, |
263 | 94 | mir_output_gamma_unsupported, | 94 | mir_output_gamma_unsupported, |
264 | 95 | {}, | ||
265 | 95 | {} | 96 | {} |
266 | 96 | }; | 97 | }; |
267 | 97 | } | 98 | } |
268 | 98 | 99 | ||
269 | === modified file 'src/platforms/android/server/hwc_blanking_control.cpp' | |||
270 | --- src/platforms/android/server/hwc_blanking_control.cpp 2017-01-18 02:29:37 +0000 | |||
271 | +++ src/platforms/android/server/hwc_blanking_control.cpp 2017-04-13 08:26:06 +0000 | |||
272 | @@ -179,6 +179,7 @@ | |||
273 | 179 | mir_subpixel_arrangement_unknown, | 179 | mir_subpixel_arrangement_unknown, |
274 | 180 | {}, | 180 | {}, |
275 | 181 | mir_output_gamma_unsupported, | 181 | mir_output_gamma_unsupported, |
276 | 182 | {}, | ||
277 | 182 | {} | 183 | {} |
278 | 183 | }; | 184 | }; |
279 | 184 | } | 185 | } |
280 | 185 | 186 | ||
281 | === modified file 'src/platforms/eglstream-kms/server/display.cpp' | |||
282 | --- src/platforms/eglstream-kms/server/display.cpp 2017-04-05 03:11:28 +0000 | |||
283 | +++ src/platforms/eglstream-kms/server/display.cpp 2017-04-13 08:26:06 +0000 | |||
284 | @@ -126,7 +126,7 @@ | |||
285 | 126 | ctx{create_context(dpy, config, ctx)}, | 126 | ctx{create_context(dpy, config, ctx)}, |
286 | 127 | layer{output.output_layer()}, | 127 | layer{output.output_layer()}, |
287 | 128 | view_area_{output.extents()}, | 128 | view_area_{output.extents()}, |
289 | 129 | transform{mg::transformation(output.orientation)} | 129 | transform{output.transformation()} |
290 | 130 | { | 130 | { |
291 | 131 | EGLint const stream_attribs[] = { | 131 | EGLint const stream_attribs[] = { |
292 | 132 | EGL_STREAM_FIFO_LENGTH_KHR, 1, | 132 | EGL_STREAM_FIFO_LENGTH_KHR, 1, |
293 | 133 | 133 | ||
294 | === modified file 'src/platforms/mesa/server/kms/display.cpp' | |||
295 | --- src/platforms/mesa/server/kms/display.cpp 2017-04-05 03:11:28 +0000 | |||
296 | +++ src/platforms/mesa/server/kms/display.cpp 2017-04-13 08:26:06 +0000 | |||
297 | @@ -521,7 +521,7 @@ | |||
298 | 521 | auto bounding_rect = group.bounding_rectangle(); | 521 | auto bounding_rect = group.bounding_rectangle(); |
299 | 522 | // Each vector<KMSOutput> is a single GPU memory domain | 522 | // Each vector<KMSOutput> is a single GPU memory domain |
300 | 523 | std::vector<std::vector<std::shared_ptr<KMSOutput>>> kms_output_groups; | 523 | std::vector<std::vector<std::shared_ptr<KMSOutput>>> kms_output_groups; |
302 | 524 | MirOrientation orientation = mir_orientation_normal; | 524 | glm::mat2 transformation; |
303 | 525 | 525 | ||
304 | 526 | group.for_each_output( | 526 | group.for_each_output( |
305 | 527 | [&](DisplayConfigurationOutput const& conf_output) | 527 | [&](DisplayConfigurationOutput const& conf_output) |
306 | @@ -539,16 +539,12 @@ | |||
307 | 539 | } | 539 | } |
308 | 540 | 540 | ||
309 | 541 | /* | 541 | /* |
314 | 542 | * Presently OverlappingOutputGroup guarantees all grouped | 542 | * Presently OverlappingOutputGroup guarantees all grouped |
315 | 543 | * outputs have the same orientation. | 543 | * outputs have the same transformation. |
316 | 544 | */ | 544 | */ |
317 | 545 | orientation = conf_output.orientation; | 545 | transformation = conf_output.transformation(); |
318 | 546 | }); | 546 | }); |
319 | 547 | 547 | ||
320 | 548 | // TODO in future outputs should emit transformation instead of | ||
321 | 549 | // orientation | ||
322 | 550 | auto const transformation = mg::transformation(orientation); | ||
323 | 551 | |||
324 | 552 | if (comp) | 548 | if (comp) |
325 | 553 | { | 549 | { |
326 | 554 | display_buffers[group_idx++]->set_transformation(transformation, | 550 | display_buffers[group_idx++]->set_transformation(transformation, |
327 | 555 | 551 | ||
328 | === modified file 'src/platforms/mesa/server/x11/graphics/display.cpp' | |||
329 | --- src/platforms/mesa/server/x11/graphics/display.cpp 2017-04-05 03:11:28 +0000 | |||
330 | +++ src/platforms/mesa/server/x11/graphics/display.cpp 2017-04-13 08:26:06 +0000 | |||
331 | @@ -289,12 +289,14 @@ | |||
332 | 289 | std::logic_error("Invalid or inconsistent display configuration")); | 289 | std::logic_error("Invalid or inconsistent display configuration")); |
333 | 290 | } | 290 | } |
334 | 291 | 291 | ||
335 | 292 | glm::mat2 trans; | ||
336 | 292 | MirOrientation o = mir_orientation_normal; | 293 | MirOrientation o = mir_orientation_normal; |
337 | 293 | float new_scale = scale; | 294 | float new_scale = scale; |
338 | 294 | geom::Rectangle logical_area; | 295 | geom::Rectangle logical_area; |
339 | 295 | 296 | ||
340 | 296 | new_configuration.for_each_output([&](DisplayConfigurationOutput const& conf_output) | 297 | new_configuration.for_each_output([&](DisplayConfigurationOutput const& conf_output) |
341 | 297 | { | 298 | { |
342 | 299 | trans = conf_output.transformation(); | ||
343 | 298 | o = conf_output.orientation; | 300 | o = conf_output.orientation; |
344 | 299 | new_scale = conf_output.scale; | 301 | new_scale = conf_output.scale; |
345 | 300 | logical_area = conf_output.extents(); | 302 | logical_area = conf_output.extents(); |
346 | @@ -302,7 +304,7 @@ | |||
347 | 302 | 304 | ||
348 | 303 | orientation = o; | 305 | orientation = o; |
349 | 304 | display_buffer->set_view_area(logical_area); | 306 | display_buffer->set_view_area(logical_area); |
351 | 305 | display_buffer->set_transformation(mg::transformation(orientation)); | 307 | display_buffer->set_transformation(trans); |
352 | 306 | scale = new_scale; | 308 | scale = new_scale; |
353 | 307 | } | 309 | } |
354 | 308 | 310 | ||
355 | 309 | 311 | ||
356 | === modified file 'src/platforms/mesa/server/x11/graphics/display_configuration.cpp' | |||
357 | --- src/platforms/mesa/server/x11/graphics/display_configuration.cpp 2017-01-18 02:29:37 +0000 | |||
358 | +++ src/platforms/mesa/server/x11/graphics/display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
359 | @@ -48,6 +48,7 @@ | |||
360 | 48 | mir_subpixel_arrangement_unknown, | 48 | mir_subpixel_arrangement_unknown, |
361 | 49 | {}, | 49 | {}, |
362 | 50 | mir_output_gamma_unsupported, | 50 | mir_output_gamma_unsupported, |
363 | 51 | {}, | ||
364 | 51 | {}}, | 52 | {}}, |
365 | 52 | card{mg::DisplayConfigurationCardId{0}, 1} | 53 | card{mg::DisplayConfigurationCardId{0}, 1} |
366 | 53 | { | 54 | { |
367 | 54 | 55 | ||
368 | === modified file 'src/server/frontend/session_mediator.cpp' | |||
369 | --- src/server/frontend/session_mediator.cpp 2017-04-13 04:26:20 +0000 | |||
370 | +++ src/server/frontend/session_mediator.cpp 2017-04-13 08:26:06 +0000 | |||
371 | @@ -1273,6 +1273,12 @@ | |||
372 | 1273 | dest.gamma = {convert_string_to_gamma_curve(src.gamma_red()), | 1273 | dest.gamma = {convert_string_to_gamma_curve(src.gamma_red()), |
373 | 1274 | convert_string_to_gamma_curve(src.gamma_green()), | 1274 | convert_string_to_gamma_curve(src.gamma_green()), |
374 | 1275 | convert_string_to_gamma_curve(src.gamma_blue())}; | 1275 | convert_string_to_gamma_curve(src.gamma_blue())}; |
375 | 1276 | |||
376 | 1277 | if (src.has_logical_width() && src.has_logical_height()) | ||
377 | 1278 | { | ||
378 | 1279 | dest.custom_logical_size = {src.logical_width(), | ||
379 | 1280 | src.logical_height()}; | ||
380 | 1281 | } | ||
381 | 1276 | }); | 1282 | }); |
382 | 1277 | 1283 | ||
383 | 1278 | return config; | 1284 | return config; |
384 | 1279 | 1285 | ||
385 | === modified file 'src/server/graphics/nested/nested_display_configuration.cpp' | |||
386 | --- src/server/graphics/nested/nested_display_configuration.cpp 2017-03-13 09:09:22 +0000 | |||
387 | +++ src/server/graphics/nested/nested_display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
388 | @@ -133,7 +133,9 @@ | |||
389 | 133 | local_config.subpixel_arrangement, | 133 | local_config.subpixel_arrangement, |
390 | 134 | local_config.gamma, | 134 | local_config.gamma, |
391 | 135 | local_config.gamma_supported, | 135 | local_config.gamma_supported, |
393 | 136 | std::move(edid) | 136 | std::move(edid), |
394 | 137 | geometry::Size{mir_output_get_logical_width(output), | ||
395 | 138 | mir_output_get_logical_height(output)} | ||
396 | 137 | }; | 139 | }; |
397 | 138 | } | 140 | } |
398 | 139 | 141 | ||
399 | 140 | 142 | ||
400 | === modified file 'src/server/graphics/offscreen/display_configuration.cpp' | |||
401 | --- src/server/graphics/offscreen/display_configuration.cpp 2017-03-09 12:47:27 +0000 | |||
402 | +++ src/server/graphics/offscreen/display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
403 | @@ -40,6 +40,7 @@ | |||
404 | 40 | mir_subpixel_arrangement_unknown, | 40 | mir_subpixel_arrangement_unknown, |
405 | 41 | {}, | 41 | {}, |
406 | 42 | mir_output_gamma_unsupported, | 42 | mir_output_gamma_unsupported, |
407 | 43 | {}, | ||
408 | 43 | {}}, | 44 | {}}, |
409 | 44 | card{mg::DisplayConfigurationCardId{0}, 1} | 45 | card{mg::DisplayConfigurationCardId{0}, 1} |
410 | 45 | { | 46 | { |
411 | 46 | 47 | ||
412 | === modified file 'tests/acceptance-tests/test_latency.cpp' | |||
413 | --- tests/acceptance-tests/test_latency.cpp 2017-04-11 14:13:20 +0000 | |||
414 | +++ tests/acceptance-tests/test_latency.cpp 2017-04-13 08:26:06 +0000 | |||
415 | @@ -255,6 +255,7 @@ | |||
416 | 255 | mir_subpixel_arrangement_unknown, | 255 | mir_subpixel_arrangement_unknown, |
417 | 256 | {}, | 256 | {}, |
418 | 257 | mir_output_gamma_unsupported, | 257 | mir_output_gamma_unsupported, |
419 | 258 | {}, | ||
420 | 258 | {} | 259 | {} |
421 | 259 | }; | 260 | }; |
422 | 260 | outputs.push_back(output); | 261 | outputs.push_back(output); |
423 | 261 | 262 | ||
424 | === modified file 'tests/acceptance-tests/test_new_display_configuration.cpp' | |||
425 | --- tests/acceptance-tests/test_new_display_configuration.cpp 2017-04-13 04:26:20 +0000 | |||
426 | +++ tests/acceptance-tests/test_new_display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
427 | @@ -934,6 +934,61 @@ | |||
428 | 934 | client.disconnect(); | 934 | client.disconnect(); |
429 | 935 | } | 935 | } |
430 | 936 | 936 | ||
431 | 937 | TEST_F(DisplayConfigurationTest, client_can_set_logical_size) | ||
432 | 938 | { | ||
433 | 939 | DisplayClient client{new_connection()}; | ||
434 | 940 | |||
435 | 941 | client.connect(); | ||
436 | 942 | |||
437 | 943 | auto client_config = client.get_base_config(); | ||
438 | 944 | int num_outputs = mir_display_config_get_num_outputs(client_config.get()); | ||
439 | 945 | |||
440 | 946 | for (int i = 0; i < num_outputs; ++i) | ||
441 | 947 | { | ||
442 | 948 | auto output = | ||
443 | 949 | mir_display_config_get_mutable_output(client_config.get(), i); | ||
444 | 950 | mir_output_set_logical_size(output, (i+1)*123, (i+3)*345); | ||
445 | 951 | } | ||
446 | 952 | |||
447 | 953 | DisplayConfigMatchingContext context; | ||
448 | 954 | context.matcher = [c = client_config.get()](MirDisplayConfig* conf) | ||
449 | 955 | { | ||
450 | 956 | EXPECT_THAT(conf, mt::DisplayConfigMatches(c)); | ||
451 | 957 | }; | ||
452 | 958 | |||
453 | 959 | mir_connection_set_display_config_change_callback( | ||
454 | 960 | client.connection, | ||
455 | 961 | &new_display_config_matches, | ||
456 | 962 | &context); | ||
457 | 963 | |||
458 | 964 | mir_connection_preview_base_display_configuration(client.connection, | ||
459 | 965 | client_config.get(), 10); | ||
460 | 966 | |||
461 | 967 | EXPECT_TRUE(context.done.wait_for(std::chrono::seconds(30))); | ||
462 | 968 | |||
463 | 969 | mir_connection_confirm_base_display_configuration(client.connection, | ||
464 | 970 | client_config.get()); | ||
465 | 971 | |||
466 | 972 | std::shared_ptr<mg::DisplayConfiguration> current_config = | ||
467 | 973 | server.the_display()->configuration(); | ||
468 | 974 | |||
469 | 975 | int j = 0; | ||
470 | 976 | current_config->for_each_output( | ||
471 | 977 | [&j](mg::UserDisplayConfigurationOutput& output) mutable | ||
472 | 978 | { | ||
473 | 979 | ASSERT_TRUE(output.custom_logical_size.is_set()); | ||
474 | 980 | auto const& size = output.custom_logical_size.value(); | ||
475 | 981 | int w = size.width.as_int(); | ||
476 | 982 | int h = size.height.as_int(); | ||
477 | 983 | EXPECT_EQ((j+1)*123, w); | ||
478 | 984 | EXPECT_EQ((j+3)*345, h); | ||
479 | 985 | ++j; | ||
480 | 986 | }); | ||
481 | 987 | |||
482 | 988 | EXPECT_TRUE(j); | ||
483 | 989 | |||
484 | 990 | client.disconnect(); | ||
485 | 991 | } | ||
486 | 937 | 992 | ||
487 | 938 | TEST_F(DisplayConfigurationTest, client_sees_server_set_form_factor) | 993 | TEST_F(DisplayConfigurationTest, client_sees_server_set_form_factor) |
488 | 939 | { | 994 | { |
489 | 940 | 995 | ||
490 | === modified file 'tests/mir_test/display_config_matchers.cpp' | |||
491 | --- tests/mir_test/display_config_matchers.cpp 2017-01-27 04:57:53 +0000 | |||
492 | +++ tests/mir_test/display_config_matchers.cpp 2017-04-13 08:26:06 +0000 | |||
493 | @@ -75,6 +75,7 @@ | |||
494 | 75 | mir_subpixel_arrangement_unknown, | 75 | mir_subpixel_arrangement_unknown, |
495 | 76 | {}, | 76 | {}, |
496 | 77 | mir_output_gamma_unsupported, | 77 | mir_output_gamma_unsupported, |
497 | 78 | {}, | ||
498 | 78 | {} | 79 | {} |
499 | 79 | }; | 80 | }; |
500 | 80 | 81 | ||
501 | @@ -134,6 +135,7 @@ | |||
502 | 134 | mir_subpixel_arrangement_unknown, | 135 | mir_subpixel_arrangement_unknown, |
503 | 135 | {}, | 136 | {}, |
504 | 136 | mir_output_gamma_unsupported, | 137 | mir_output_gamma_unsupported, |
505 | 138 | {}, | ||
506 | 137 | {} | 139 | {} |
507 | 138 | }; | 140 | }; |
508 | 139 | 141 | ||
509 | @@ -192,6 +194,7 @@ | |||
510 | 192 | mir_subpixel_arrangement_unknown, | 194 | mir_subpixel_arrangement_unknown, |
511 | 193 | {}, | 195 | {}, |
512 | 194 | mir_output_gamma_unsupported, | 196 | mir_output_gamma_unsupported, |
513 | 197 | {}, | ||
514 | 195 | {} | 198 | {} |
515 | 196 | }; | 199 | }; |
516 | 197 | 200 | ||
517 | 198 | 201 | ||
518 | === modified file 'tests/mir_test_doubles/stub_display_configuration.cpp' | |||
519 | --- tests/mir_test_doubles/stub_display_configuration.cpp 2017-01-18 02:29:37 +0000 | |||
520 | +++ tests/mir_test_doubles/stub_display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
521 | @@ -93,6 +93,7 @@ | |||
522 | 93 | subpixel_arrangement, | 93 | subpixel_arrangement, |
523 | 94 | {}, | 94 | {}, |
524 | 95 | mir_output_gamma_unsupported, | 95 | mir_output_gamma_unsupported, |
525 | 96 | {}, | ||
526 | 96 | {} | 97 | {} |
527 | 97 | } | 98 | } |
528 | 98 | { | 99 | { |
529 | @@ -122,6 +123,7 @@ | |||
530 | 122 | mir_subpixel_arrangement_unknown, | 123 | mir_subpixel_arrangement_unknown, |
531 | 123 | {}, | 124 | {}, |
532 | 124 | mir_output_gamma_unsupported, | 125 | mir_output_gamma_unsupported, |
533 | 126 | {}, | ||
534 | 125 | {} | 127 | {} |
535 | 126 | } | 128 | } |
536 | 127 | { | 129 | { |
537 | @@ -225,6 +227,7 @@ | |||
538 | 225 | mir_subpixel_arrangement_unknown, | 227 | mir_subpixel_arrangement_unknown, |
539 | 226 | {}, | 228 | {}, |
540 | 227 | mir_output_gamma_unsupported, | 229 | mir_output_gamma_unsupported, |
541 | 230 | {}, | ||
542 | 228 | {} | 231 | {} |
543 | 229 | }; | 232 | }; |
544 | 230 | 233 | ||
545 | @@ -252,6 +255,7 @@ | |||
546 | 252 | mir_subpixel_arrangement_unknown, | 255 | mir_subpixel_arrangement_unknown, |
547 | 253 | {}, | 256 | {}, |
548 | 254 | mir_output_gamma_unsupported, | 257 | mir_output_gamma_unsupported, |
549 | 258 | {}, | ||
550 | 255 | {} | 259 | {} |
551 | 256 | }; | 260 | }; |
552 | 257 | 261 | ||
553 | 258 | 262 | ||
554 | === modified file 'tests/unit-tests/graphics/test_default_display_configuration_policy.cpp' | |||
555 | --- tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2017-01-30 05:18:36 +0000 | |||
556 | +++ tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2017-04-13 08:26:06 +0000 | |||
557 | @@ -65,6 +65,7 @@ | |||
558 | 65 | mir_subpixel_arrangement_unknown, | 65 | mir_subpixel_arrangement_unknown, |
559 | 66 | {}, | 66 | {}, |
560 | 67 | mir_output_gamma_unsupported, | 67 | mir_output_gamma_unsupported, |
561 | 68 | {}, | ||
562 | 68 | {} | 69 | {} |
563 | 69 | }; | 70 | }; |
564 | 70 | } | 71 | } |
565 | 71 | 72 | ||
566 | === modified file 'tests/unit-tests/graphics/test_display_configuration.cpp' | |||
567 | --- tests/unit-tests/graphics/test_display_configuration.cpp 2017-01-18 02:29:37 +0000 | |||
568 | +++ tests/unit-tests/graphics/test_display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
569 | @@ -53,6 +53,7 @@ | |||
570 | 53 | mir_subpixel_arrangement_unknown, | 53 | mir_subpixel_arrangement_unknown, |
571 | 54 | {}, | 54 | {}, |
572 | 55 | mir_output_gamma_unsupported, | 55 | mir_output_gamma_unsupported, |
573 | 56 | {}, | ||
574 | 56 | {} | 57 | {} |
575 | 57 | }; | 58 | }; |
576 | 58 | 59 | ||
577 | @@ -286,6 +287,36 @@ | |||
578 | 286 | EXPECT_EQ(out.modes[out.current_mode_index].size, out.extents().size); | 287 | EXPECT_EQ(out.modes[out.current_mode_index].size, out.extents().size); |
579 | 287 | } | 288 | } |
580 | 288 | 289 | ||
581 | 290 | TEST(DisplayConfiguration, output_extents_are_customizable) | ||
582 | 291 | { | ||
583 | 292 | mg::DisplayConfigurationOutput out = tmpl_output; | ||
584 | 293 | |||
585 | 294 | geom::Size const custom_size{1234, 9876}; | ||
586 | 295 | out.custom_logical_size = custom_size; | ||
587 | 296 | |||
588 | 297 | EXPECT_EQ(custom_size, out.extents().size); | ||
589 | 298 | } | ||
590 | 299 | |||
591 | 300 | TEST(DisplayConfiguration, custom_size_causes_scaling) | ||
592 | 301 | { | ||
593 | 302 | mg::DisplayConfigurationOutput out = tmpl_output; | ||
594 | 303 | |||
595 | 304 | auto const& physical_size = out.modes[out.current_mode_index].size; | ||
596 | 305 | |||
597 | 306 | geom::Size const logical_size{1234, 9876}; | ||
598 | 307 | out.custom_logical_size = logical_size; | ||
599 | 308 | |||
600 | 309 | auto const& observed = out.transformation(); | ||
601 | 310 | glm::mat2 const expected{static_cast<float>(physical_size.width.as_int()) / | ||
602 | 311 | logical_size.width.as_int(), | ||
603 | 312 | 0, | ||
604 | 313 | 0, | ||
605 | 314 | static_cast<float>(physical_size.height.as_int()) / | ||
606 | 315 | logical_size.height.as_int()}; | ||
607 | 316 | |||
608 | 317 | EXPECT_EQ(expected, observed); | ||
609 | 318 | } | ||
610 | 319 | |||
611 | 289 | TEST(DisplayConfiguration, output_extents_rotates_with_orientation) | 320 | TEST(DisplayConfiguration, output_extents_rotates_with_orientation) |
612 | 290 | { | 321 | { |
613 | 291 | mg::DisplayConfigurationOutput out = tmpl_output; | 322 | mg::DisplayConfigurationOutput out = tmpl_output; |
614 | @@ -329,6 +360,23 @@ | |||
615 | 329 | EXPECT_FALSE(out.valid()); | 360 | EXPECT_FALSE(out.valid()); |
616 | 330 | } | 361 | } |
617 | 331 | 362 | ||
618 | 363 | TEST(DisplayConfiguration, only_nonzero_custom_sizes_are_valid) | ||
619 | 364 | { | ||
620 | 365 | mg::DisplayConfigurationOutput out = tmpl_output; | ||
621 | 366 | |||
622 | 367 | out.custom_logical_size = {12, 34}; | ||
623 | 368 | EXPECT_TRUE(out.valid()); | ||
624 | 369 | |||
625 | 370 | out.custom_logical_size = {0, 56}; | ||
626 | 371 | EXPECT_FALSE(out.valid()); | ||
627 | 372 | |||
628 | 373 | out.custom_logical_size = {78, 0}; | ||
629 | 374 | EXPECT_FALSE(out.valid()); | ||
630 | 375 | |||
631 | 376 | out.custom_logical_size = {0, 0}; | ||
632 | 377 | EXPECT_FALSE(out.valid()); | ||
633 | 378 | } | ||
634 | 379 | |||
635 | 332 | TEST(DisplayConfiguration, unsupported_format_invalid) | 380 | TEST(DisplayConfiguration, unsupported_format_invalid) |
636 | 333 | { | 381 | { |
637 | 334 | mg::DisplayConfigurationOutput out = tmpl_output; | 382 | mg::DisplayConfigurationOutput out = tmpl_output; |
638 | 335 | 383 | ||
639 | === modified file 'tests/unit-tests/graphics/test_overlapping_output_grouping.cpp' | |||
640 | --- tests/unit-tests/graphics/test_overlapping_output_grouping.cpp 2017-01-18 02:29:37 +0000 | |||
641 | +++ tests/unit-tests/graphics/test_overlapping_output_grouping.cpp 2017-04-13 08:26:06 +0000 | |||
642 | @@ -100,6 +100,7 @@ | |||
643 | 100 | mir_subpixel_arrangement_unknown, | 100 | mir_subpixel_arrangement_unknown, |
644 | 101 | {}, | 101 | {}, |
645 | 102 | mir_output_gamma_unsupported, | 102 | mir_output_gamma_unsupported, |
646 | 103 | {}, | ||
647 | 103 | {} | 104 | {} |
648 | 104 | }; | 105 | }; |
649 | 105 | 106 | ||
650 | 106 | 107 | ||
651 | === modified file 'tests/unit-tests/platforms/mesa/kms/test_cursor.cpp' | |||
652 | --- tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-03-10 10:20:24 +0000 | |||
653 | +++ tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-04-13 08:26:06 +0000 | |||
654 | @@ -121,6 +121,7 @@ | |||
655 | 121 | mir_subpixel_arrangement_unknown, | 121 | mir_subpixel_arrangement_unknown, |
656 | 122 | {}, | 122 | {}, |
657 | 123 | mir_output_gamma_unsupported, | 123 | mir_output_gamma_unsupported, |
658 | 124 | {}, | ||
659 | 124 | {} | 125 | {} |
660 | 125 | }, | 126 | }, |
661 | 126 | { | 127 | { |
662 | @@ -146,6 +147,7 @@ | |||
663 | 146 | mir_subpixel_arrangement_unknown, | 147 | mir_subpixel_arrangement_unknown, |
664 | 147 | {}, | 148 | {}, |
665 | 148 | mir_output_gamma_unsupported, | 149 | mir_output_gamma_unsupported, |
666 | 150 | {}, | ||
667 | 149 | {} | 151 | {} |
668 | 150 | }, | 152 | }, |
669 | 151 | { | 153 | { |
670 | @@ -171,6 +173,7 @@ | |||
671 | 171 | mir_subpixel_arrangement_unknown, | 173 | mir_subpixel_arrangement_unknown, |
672 | 172 | {}, | 174 | {}, |
673 | 173 | mir_output_gamma_unsupported, | 175 | mir_output_gamma_unsupported, |
674 | 176 | {}, | ||
675 | 174 | {} | 177 | {} |
676 | 175 | }}} | 178 | }}} |
677 | 176 | { | 179 | { |
678 | 177 | 180 | ||
679 | === modified file 'tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp' | |||
680 | --- tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp 2017-04-05 03:11:28 +0000 | |||
681 | +++ tests/unit-tests/platforms/mesa/kms/test_display_configuration.cpp 2017-04-13 08:26:06 +0000 | |||
682 | @@ -300,6 +300,7 @@ | |||
683 | 300 | mir_subpixel_arrangement_unknown, | 300 | mir_subpixel_arrangement_unknown, |
684 | 301 | {}, | 301 | {}, |
685 | 302 | mir_output_gamma_unsupported, | 302 | mir_output_gamma_unsupported, |
686 | 303 | {}, | ||
687 | 303 | {} | 304 | {} |
688 | 304 | }, | 305 | }, |
689 | 305 | { | 306 | { |
690 | @@ -322,6 +323,7 @@ | |||
691 | 322 | mir_subpixel_arrangement_unknown, | 323 | mir_subpixel_arrangement_unknown, |
692 | 323 | {}, | 324 | {}, |
693 | 324 | mir_output_gamma_unsupported, | 325 | mir_output_gamma_unsupported, |
694 | 326 | {}, | ||
695 | 325 | {} | 327 | {} |
696 | 326 | }, | 328 | }, |
697 | 327 | { | 329 | { |
698 | @@ -344,6 +346,7 @@ | |||
699 | 344 | mir_subpixel_arrangement_unknown, | 346 | mir_subpixel_arrangement_unknown, |
700 | 345 | {}, | 347 | {}, |
701 | 346 | mir_output_gamma_unsupported, | 348 | mir_output_gamma_unsupported, |
702 | 349 | {}, | ||
703 | 347 | {} | 350 | {} |
704 | 348 | } | 351 | } |
705 | 349 | }; | 352 | }; |
706 | @@ -577,6 +580,7 @@ | |||
707 | 577 | mir_subpixel_arrangement_unknown, | 580 | mir_subpixel_arrangement_unknown, |
708 | 578 | {}, | 581 | {}, |
709 | 579 | mir_output_gamma_unsupported, | 582 | mir_output_gamma_unsupported, |
710 | 583 | {}, | ||
711 | 580 | {} | 584 | {} |
712 | 581 | }, | 585 | }, |
713 | 582 | { | 586 | { |
714 | @@ -599,6 +603,7 @@ | |||
715 | 599 | mir_subpixel_arrangement_unknown, | 603 | mir_subpixel_arrangement_unknown, |
716 | 600 | {}, | 604 | {}, |
717 | 601 | mir_output_gamma_unsupported, | 605 | mir_output_gamma_unsupported, |
718 | 606 | {}, | ||
719 | 602 | {} | 607 | {} |
720 | 603 | }, | 608 | }, |
721 | 604 | }; | 609 | }; |
722 | @@ -625,6 +630,7 @@ | |||
723 | 625 | mir_subpixel_arrangement_unknown, | 630 | mir_subpixel_arrangement_unknown, |
724 | 626 | {}, | 631 | {}, |
725 | 627 | mir_output_gamma_unsupported, | 632 | mir_output_gamma_unsupported, |
726 | 633 | {}, | ||
727 | 628 | {} | 634 | {} |
728 | 629 | }, | 635 | }, |
729 | 630 | { | 636 | { |
730 | @@ -647,6 +653,7 @@ | |||
731 | 647 | mir_subpixel_arrangement_unknown, | 653 | mir_subpixel_arrangement_unknown, |
732 | 648 | {}, | 654 | {}, |
733 | 649 | mir_output_gamma_unsupported, | 655 | mir_output_gamma_unsupported, |
734 | 656 | {}, | ||
735 | 650 | {} | 657 | {} |
736 | 651 | }, | 658 | }, |
737 | 652 | }; | 659 | }; |
738 | @@ -794,6 +801,7 @@ | |||
739 | 794 | mir_subpixel_arrangement_unknown, | 801 | mir_subpixel_arrangement_unknown, |
740 | 795 | {}, | 802 | {}, |
741 | 796 | mir_output_gamma_unsupported, | 803 | mir_output_gamma_unsupported, |
742 | 804 | {}, | ||
743 | 797 | {} | 805 | {} |
744 | 798 | }, | 806 | }, |
745 | 799 | }; | 807 | }; |
746 | @@ -822,6 +830,7 @@ | |||
747 | 822 | mir_subpixel_arrangement_unknown, | 830 | mir_subpixel_arrangement_unknown, |
748 | 823 | {}, | 831 | {}, |
749 | 824 | mir_output_gamma_unsupported, | 832 | mir_output_gamma_unsupported, |
750 | 833 | {}, | ||
751 | 825 | {} | 834 | {} |
752 | 826 | }, | 835 | }, |
753 | 827 | }; | 836 | }; |
754 | 828 | 837 | ||
755 | === modified file 'tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp' | |||
756 | --- tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-02-17 07:35:08 +0000 | |||
757 | +++ tests/unit-tests/platforms/nested/mir_display_configuration_builder.cpp 2017-04-13 08:26:06 +0000 | |||
758 | @@ -83,6 +83,10 @@ | |||
759 | 83 | output->set_edid(valid_edid, sizeof(valid_edid)); | 83 | output->set_edid(valid_edid, sizeof(valid_edid)); |
760 | 84 | output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb); | 84 | output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb); |
761 | 85 | 85 | ||
762 | 86 | auto const& current_mode = output->mode(output->current_mode()); | ||
763 | 87 | output->set_logical_width(current_mode.horizontal_resolution()); | ||
764 | 88 | output->set_logical_height(current_mode.vertical_resolution()); | ||
765 | 89 | |||
766 | 86 | return std::make_shared<MirDisplayConfig>(conf); | 90 | return std::make_shared<MirDisplayConfig>(conf); |
767 | 87 | } | 91 | } |
768 | 88 | 92 | ||
769 | @@ -123,6 +127,10 @@ | |||
770 | 123 | output->set_orientation(mir_orientation_normal); | 127 | output->set_orientation(mir_orientation_normal); |
771 | 124 | output->set_edid(valid_edid, sizeof(valid_edid)); | 128 | output->set_edid(valid_edid, sizeof(valid_edid)); |
772 | 125 | output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb); | 129 | output->set_subpixel_arrangement(mir_subpixel_arrangement_horizontal_rgb); |
773 | 130 | |||
774 | 131 | auto const& current_mode = output->mode(output->current_mode()); | ||
775 | 132 | output->set_logical_width(current_mode.horizontal_resolution()); | ||
776 | 133 | output->set_logical_height(current_mode.vertical_resolution()); | ||
777 | 126 | } | 134 | } |
778 | 127 | 135 | ||
779 | 128 | return std::make_shared<MirDisplayConfig>(conf); | 136 | return std::make_shared<MirDisplayConfig>(conf); |