Merge lp:~kdub/mir/hwc12-support into lp:mir
- hwc12-support
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Andreas Pokorny |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1347 |
Proposed branch: | lp:~kdub/mir/hwc12-support |
Merge into: | lp:mir |
Prerequisite: | lp:~kdub/mir/workaround-qcom-display-request |
Diff against target: |
885 lines (+199/-131) 17 files modified
include/test/mir_test_doubles/mock_hwc_composer_device_1.h (+53/-23) src/platform/graphics/android/CMakeLists.txt (+2/-2) src/platform/graphics/android/display_resource_factory.h (+2/-2) src/platform/graphics/android/hwc_device.cpp (+9/-10) src/platform/graphics/android/hwc_device.h (+6/-5) src/platform/graphics/android/hwc_fb_device.cpp (+6/-6) src/platform/graphics/android/hwc_fb_device.h (+5/-5) src/platform/graphics/android/hwc_layerlist.cpp (+11/-5) src/platform/graphics/android/output_builder.cpp (+21/-14) src/platform/graphics/android/resource_factory.cpp (+6/-6) src/platform/graphics/android/resource_factory.h (+2/-2) tests/unit-tests/graphics/android/CMakeLists.txt (+2/-2) tests/unit-tests/graphics/android/test_hwc_common_device.cpp (+7/-7) tests/unit-tests/graphics/android/test_hwc_device.cpp (+38/-15) tests/unit-tests/graphics/android/test_hwc_fb_device.cpp (+12/-12) tests/unit-tests/graphics/android/test_hwc_layerlist.cpp (+7/-2) tests/unit-tests/graphics/android/test_output_builder.cpp (+10/-13) |
To merge this branch: | bzr merge lp:~kdub/mir/hwc12-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andreas Pokorny (community) | Approve | ||
Ricardo Salveti (community) | 4.4 testing | Approve | |
Daniel van Vugt | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+202015@code.launchpad.net |
Commit message
support hwcomposer 1.2 for android 4.4 on nexus 4 (which needs hwc1.2 support). This patch adds hwc1.2 device construction, as well as programs the 'skip' layer in HWC to the buffer properties of the framebuffer.
Description of the change
support hwcomposer 1.2 for android 4.4 on nexus 4 (which needs hwc1.2 support). This patch adds hwc1.2 device construction, as well as programs the 'skip' layer in HWC to the buffer properties of the framebuffer.
fb module, hwc1.0, and {hwc1.1 and later} have significant differences in how they post buffers to the screen, so we have 3 classes, all implementing mga::DisplayDevice.
HWC11Device now supports v1.1 and v1.2, so I renamed it to HwcDevice. I renamed HWC10Device to HwcFbDevice, because the primary difference between the two is that one needs the fb module to work, and the other one doesn't.
For the interested folks, hwc1.2 adds android virtual displays (which I programmed us not to use at the moment)
tested with unity on hwc1.2 on the nexus4 and hwc1.1 on the nex10
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1346
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
On Nexus 4:
bin/mir_
terminate called after throwing an instance of 'boost:
what(): error during hwc set()
and
[ RUN ] AndroidGPUDispl
unknown file: Failure
C++ exception with description "error during hwc set()" thrown in the test body.
[ FAILED ] AndroidGPUDispl
This doesn't happen when using the development-branch.
Kevin DuBois (kdub) wrote : | # |
indeed, the 4.2 image doesn't like this change (4.4 is okay though). Working on fixing...
Kevin DuBois (kdub) wrote : | # |
corrected so that both android 4.2 and 4.4 both work for the nexus 4. also tested rev 1347 with hwc1.1 on the nexus 10.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1347
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
(1) Is the omission of "break" intentional?
32 + case 3:
33 + virtual_prepare = (!!displays[2]);
34 + case 2:
35 + external_prepare = (!!displays[1]);
36 + case 1:
37 + primary_prepare = (!!displays[0]);
38 + save_args(
39 + default:
If so, then approved.
Andreas Pokorny (andreas-pokorny) wrote : | # |
38 + and 75 + duplicate code
If you move the code at the end of the two last case blocks behind the switch you could extract the duplicated code into a method.
Maybe add a size > 3 check above (27 + 52 +)? Not sure on that one though.
Daniel van Vugt (vanvugt) wrote : | # |
Ah. I see the omission of "break" appears to be correct.
And I disagree with Andreas' suggestion. The duplication is minimal, and not sufficiently similar or complex to justify adding a new method.
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://
FAILURE: http://
FAILURE: http://
Daniel van Vugt (vanvugt) wrote : | # |
Tried to land it, but then this:
Text conflict in include/
Text conflict in src/platform/
Text conflict in src/platform/
Text conflict in tests/unit-
Text conflict in tests/unit-
5 conflicts encountered.
Andreas Pokorny (andreas-pokorny) wrote : | # |
> Ah. I see the omission of "break" appears to be correct.
>
> And I disagree with Andreas' suggestion. The duplication is minimal, and not
> sufficiently similar or complex to justify adding a new method.
I agree to your disagreement - but somebody asked for the semantics - so I proposed something that allows adding that through a descriptive method name - which I completely failed to make clear in my comment.
Kevin DuBois (kdub) wrote : | # |
fixing conflicts...
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1348
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Kevin DuBois (kdub) wrote : | # |
> > Ah. I see the omission of "break" appears to be correct.
> >
> > And I disagree with Andreas' suggestion. The duplication is minimal, and not
> > sufficiently similar or complex to justify adding a new method.
>
> I agree to your disagreement - but somebody asked for the semantics - so I
> proposed something that allows adding that through a descriptive method name -
> which I completely failed to make clear in my comment.
I'd rather leave it alone, seeing as its a stub. It might prove beneficial to improve this mock in the future, especially as I improve the management of the hwc structs though.
Daniel van Vugt (vanvugt) : | # |
Daniel van Vugt (vanvugt) wrote : | # |
Seems to work still. Though I couldn't retry the unit tests because of bug 1271434
Ricardo Salveti (rsalveti) wrote : | # |
Tested with a 4.4.2 based image and I'm able to get unity8 to work with it (using hwcomposer 1.2).
Andreas Pokorny (andreas-pokorny) wrote : | # |
fine with me
Preview Diff
1 | === modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h' |
2 | --- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-01-20 16:38:54 +0000 |
3 | +++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-01-21 17:48:17 +0000 |
4 | @@ -38,6 +38,13 @@ |
5 | { |
6 | using namespace testing; |
7 | |
8 | + primary_prepare = false; |
9 | + primary_set = false; |
10 | + external_prepare = false; |
11 | + external_set = false; |
12 | + virtual_prepare = false; |
13 | + virtual_set = false; |
14 | + |
15 | common.version = HWC_DEVICE_API_VERSION_1_1; |
16 | |
17 | registerProcs = hook_registerProcs; |
18 | @@ -69,40 +76,62 @@ |
19 | fb_fence = fence; |
20 | } |
21 | |
22 | - int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays) |
23 | + int save_last_prepare_arguments(struct hwc_composer_device_1 *, size_t size, hwc_display_contents_1_t** displays) |
24 | { |
25 | - hwc_display_contents_1_t* primary_display = *displays; |
26 | - if (!primary_display) |
27 | + if ((size == 0) || (!displays)) |
28 | return -1; |
29 | |
30 | - for(auto i = 0u; i < primary_display->numHwLayers; i++) |
31 | + switch (size) |
32 | { |
33 | - prepare_layerlist.push_back(primary_display->hwLayers[i]); |
34 | - prepare_layerlist.back().visibleRegionScreen = {0, nullptr}; |
35 | + case 3: |
36 | + virtual_prepare = (!!displays[2]); |
37 | + case 2: |
38 | + external_prepare = (!!displays[1]); |
39 | + case 1: |
40 | + primary_prepare = (!!displays[0]); |
41 | + for(auto i = 0u; i < displays[0]->numHwLayers; i++) |
42 | + { |
43 | + prepare_layerlist.push_back(displays[0]->hwLayers[i]); |
44 | + prepare_layerlist.back().visibleRegionScreen = {0, nullptr}; |
45 | + } |
46 | + save_args(&display0_prepare_content, displays); |
47 | + default: |
48 | + break; |
49 | } |
50 | - |
51 | - return save_args(&display0_prepare_content, displays); |
52 | + return 0; |
53 | } |
54 | |
55 | int save_last_set_arguments( |
56 | - struct hwc_composer_device_1 *, size_t, hwc_display_contents_1_t** displays) |
57 | + struct hwc_composer_device_1 *, size_t size, hwc_display_contents_1_t** displays) |
58 | { |
59 | - hwc_display_contents_1_t* primary_display = *displays; |
60 | - if (!primary_display) |
61 | + |
62 | + if ((size == 0) || (!displays)) |
63 | return -1; |
64 | |
65 | - for(auto i = 0u; i < primary_display->numHwLayers; i++) |
66 | - { |
67 | - set_layerlist.push_back(primary_display->hwLayers[i]); |
68 | - set_layerlist.back().visibleRegionScreen = {0, nullptr}; |
69 | - } |
70 | - |
71 | - if (primary_display->numHwLayers >= 2) |
72 | - { |
73 | - primary_display->hwLayers[1].releaseFenceFd = fb_fence; |
74 | - } |
75 | - |
76 | - return save_args(&display0_set_content, displays); |
77 | + switch (size) |
78 | + { |
79 | + case 3: |
80 | + virtual_set = (!!displays[2]); |
81 | + case 2: |
82 | + external_set = (!!displays[1]); |
83 | + case 1: |
84 | + primary_set = (!!displays[0]); |
85 | + for(auto i = 0u; i < displays[0]->numHwLayers; i++) |
86 | + { |
87 | + set_layerlist.push_back(displays[0]->hwLayers[i]); |
88 | + set_layerlist.back().visibleRegionScreen = {0, nullptr}; |
89 | + } |
90 | + |
91 | + if (displays[0]->numHwLayers >= 2) |
92 | + { |
93 | + displays[0]->hwLayers[1].releaseFenceFd = fb_fence; |
94 | + } |
95 | + |
96 | + save_args(&display0_set_content, displays); |
97 | + default: |
98 | + break; |
99 | + } |
100 | + return 0; |
101 | } |
102 | |
103 | static void hook_registerProcs(struct hwc_composer_device_1* mock_hwc, hwc_procs_t const* procs) |
104 | @@ -151,6 +180,7 @@ |
105 | MOCK_METHOD4(getDisplayConfigs_interface, int(struct hwc_composer_device_1*, int, uint32_t*, size_t*)); |
106 | MOCK_METHOD5(getDisplayAttributes_interface, int(struct hwc_composer_device_1*, int, uint32_t, const uint32_t*, int32_t*)); |
107 | |
108 | + bool primary_prepare, primary_set, external_prepare, external_set, virtual_prepare, virtual_set; |
109 | hwc_display_contents_1_t display0_set_content; |
110 | std::vector<hwc_layer_1> set_layerlist; |
111 | std::vector<hwc_layer_1> prepare_layerlist; |
112 | |
113 | === modified file 'src/platform/graphics/android/CMakeLists.txt' |
114 | --- src/platform/graphics/android/CMakeLists.txt 2014-01-13 06:12:33 +0000 |
115 | +++ src/platform/graphics/android/CMakeLists.txt 2014-01-21 17:48:17 +0000 |
116 | @@ -15,8 +15,8 @@ |
117 | display_buffer.cpp |
118 | output_builder.cpp |
119 | hwc_layerlist.cpp |
120 | - hwc10_device.cpp |
121 | - hwc11_device.cpp |
122 | + hwc_fb_device.cpp |
123 | + hwc_device.cpp |
124 | hwc_common_device.cpp |
125 | hwc_vsync.cpp |
126 | android_alloc_adaptor.cpp |
127 | |
128 | === modified file 'src/platform/graphics/android/display_resource_factory.h' |
129 | --- src/platform/graphics/android/display_resource_factory.h 2014-01-13 06:12:33 +0000 |
130 | +++ src/platform/graphics/android/display_resource_factory.h 2014-01-21 17:48:17 +0000 |
131 | @@ -48,9 +48,9 @@ |
132 | |
133 | virtual std::shared_ptr<DisplayDevice> create_fb_device( |
134 | std::shared_ptr<framebuffer_device_t> const& fb_native_device) const = 0; |
135 | - virtual std::shared_ptr<DisplayDevice> create_hwc11_device( |
136 | + virtual std::shared_ptr<DisplayDevice> create_hwc_device( |
137 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device) const = 0; |
138 | - virtual std::shared_ptr<DisplayDevice> create_hwc10_device( |
139 | + virtual std::shared_ptr<DisplayDevice> create_hwc_fb_device( |
140 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device, |
141 | std::shared_ptr<framebuffer_device_t> const& fb_native_device) const = 0; |
142 | |
143 | |
144 | === renamed file 'src/platform/graphics/android/hwc11_device.cpp' => 'src/platform/graphics/android/hwc_device.cpp' |
145 | --- src/platform/graphics/android/hwc11_device.cpp 2014-01-20 16:38:54 +0000 |
146 | +++ src/platform/graphics/android/hwc_device.cpp 2014-01-21 17:48:17 +0000 |
147 | @@ -17,7 +17,7 @@ |
148 | * Kevin DuBois <kevin.dubois@canonical.com> |
149 | */ |
150 | |
151 | -#include "hwc11_device.h" |
152 | +#include "hwc_device.h" |
153 | #include "hwc_layerlist.h" |
154 | #include "hwc_vsync_coordinator.h" |
155 | #include "framebuffer_bundle.h" |
156 | @@ -34,7 +34,7 @@ |
157 | namespace mga=mir::graphics::android; |
158 | namespace geom = mir::geometry; |
159 | |
160 | -mga::HWC11Device::HWC11Device(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
161 | +mga::HwcDevice::HwcDevice(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
162 | std::shared_ptr<HWCVsyncCoordinator> const& coordinator) |
163 | : HWCCommonDevice(hwc_device, coordinator), |
164 | layer_list({mga::CompositionLayer{true}, mga::FramebufferLayer{}}), |
165 | @@ -42,24 +42,23 @@ |
166 | { |
167 | } |
168 | |
169 | -void mga::HWC11Device::prepare_gl() |
170 | +void mga::HwcDevice::prepare_gl() |
171 | { |
172 | //note, although we only have a primary display right now, |
173 | - // set the second display to nullptr, as exynos hwc always derefs displays[1] |
174 | - hwc_display_contents_1_t* displays[HWC_NUM_DISPLAY_TYPES] {layer_list.native_list(), nullptr}; |
175 | - |
176 | + // set the external and virtual displays to null as some drivers check for that |
177 | + hwc_display_contents_1_t* displays[num_displays] {layer_list.native_list(), nullptr, nullptr}; |
178 | if (hwc_device->prepare(hwc_device.get(), 1, displays)) |
179 | { |
180 | BOOST_THROW_EXCEPTION(std::runtime_error("error during hwc prepare()")); |
181 | } |
182 | } |
183 | |
184 | -void mga::HWC11Device::prepare_gl_and_overlays(std::list<Renderable> const&) |
185 | +void mga::HwcDevice::prepare_gl_and_overlays(std::list<Renderable> const&) |
186 | { |
187 | prepare_gl(); |
188 | } |
189 | |
190 | -void mga::HWC11Device::gpu_render(EGLDisplay dpy, EGLSurface sur) |
191 | +void mga::HwcDevice::gpu_render(EGLDisplay dpy, EGLSurface sur) |
192 | { |
193 | if (eglSwapBuffers(dpy, sur) == EGL_FALSE) |
194 | { |
195 | @@ -67,14 +66,14 @@ |
196 | } |
197 | } |
198 | |
199 | -void mga::HWC11Device::post(mg::Buffer const& buffer) |
200 | +void mga::HwcDevice::post(mg::Buffer const& buffer) |
201 | { |
202 | auto lg = lock_unblanked(); |
203 | |
204 | auto native_buffer = buffer.native_buffer_handle(); |
205 | layer_list.set_fb_target(native_buffer); |
206 | |
207 | - hwc_display_contents_1_t* displays[HWC_NUM_DISPLAY_TYPES] {layer_list.native_list(), nullptr}; |
208 | + hwc_display_contents_1_t* displays[num_displays] {layer_list.native_list(), nullptr, nullptr}; |
209 | if (hwc_device->set(hwc_device.get(), 1, displays)) |
210 | { |
211 | BOOST_THROW_EXCEPTION(std::runtime_error("error during hwc set()")); |
212 | |
213 | === renamed file 'src/platform/graphics/android/hwc11_device.h' => 'src/platform/graphics/android/hwc_device.h' |
214 | --- src/platform/graphics/android/hwc11_device.h 2014-01-20 16:38:54 +0000 |
215 | +++ src/platform/graphics/android/hwc_device.h 2014-01-21 17:48:17 +0000 |
216 | @@ -16,8 +16,8 @@ |
217 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
218 | */ |
219 | |
220 | -#ifndef MIR_GRAPHICS_ANDROID_HWC11_DEVICE_H_ |
221 | -#define MIR_GRAPHICS_ANDROID_HWC11_DEVICE_H_ |
222 | +#ifndef MIR_GRAPHICS_ANDROID_HWC_DEVICE_H_ |
223 | +#define MIR_GRAPHICS_ANDROID_HWC_DEVICE_H_ |
224 | |
225 | #include "mir_toolkit/common.h" |
226 | #include "hwc_common_device.h" |
227 | @@ -36,10 +36,10 @@ |
228 | class SyncFileOps; |
229 | class SyncFence; |
230 | |
231 | -class HWC11Device : public HWCCommonDevice |
232 | +class HwcDevice : public HWCCommonDevice |
233 | { |
234 | public: |
235 | - HWC11Device(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
236 | + HwcDevice(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
237 | std::shared_ptr<HWCVsyncCoordinator> const& coordinator); |
238 | |
239 | void prepare_gl(); |
240 | @@ -54,10 +54,11 @@ |
241 | std::shared_ptr<SyncFileOps> const sync_ops; |
242 | unsigned int primary_display_config; |
243 | MirPixelFormat fb_format; |
244 | + static size_t const num_displays{3}; //primary, external, virtual |
245 | }; |
246 | |
247 | } |
248 | } |
249 | } |
250 | |
251 | -#endif /* MIR_GRAPHICS_ANDROID_HWC11_DEVICE_H_ */ |
252 | +#endif /* MIR_GRAPHICS_ANDROID_HWC_DEVICE_H_ */ |
253 | |
254 | === renamed file 'src/platform/graphics/android/hwc10_device.cpp' => 'src/platform/graphics/android/hwc_fb_device.cpp' |
255 | --- src/platform/graphics/android/hwc10_device.cpp 2014-01-20 16:38:54 +0000 |
256 | +++ src/platform/graphics/android/hwc_fb_device.cpp 2014-01-21 17:48:17 +0000 |
257 | @@ -17,7 +17,7 @@ |
258 | * Kevin DuBois <kevin.dubois@canonical.com> |
259 | */ |
260 | |
261 | -#include "hwc10_device.h" |
262 | +#include "hwc_fb_device.h" |
263 | #include "hwc_vsync_coordinator.h" |
264 | #include "framebuffer_bundle.h" |
265 | #include "android_format_conversion-inl.h" |
266 | @@ -31,7 +31,7 @@ |
267 | namespace mga = mir::graphics::android; |
268 | namespace geom = mir::geometry; |
269 | |
270 | -mga::HWC10Device::HWC10Device(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
271 | +mga::HwcFbDevice::HwcFbDevice(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
272 | std::shared_ptr<framebuffer_device_t> const& fb_device, |
273 | std::shared_ptr<HWCVsyncCoordinator> const& coordinator) |
274 | : HWCCommonDevice(hwc_device, coordinator), |
275 | @@ -40,7 +40,7 @@ |
276 | { |
277 | } |
278 | |
279 | -void mga::HWC10Device::prepare_gl() |
280 | +void mga::HwcFbDevice::prepare_gl() |
281 | { |
282 | auto display_list = layer_list.native_list(); |
283 | if (hwc_device->prepare(hwc_device.get(), 1, &display_list) != 0) |
284 | @@ -49,12 +49,12 @@ |
285 | } |
286 | } |
287 | |
288 | -void mga::HWC10Device::prepare_gl_and_overlays(std::list<Renderable> const&) |
289 | +void mga::HwcFbDevice::prepare_gl_and_overlays(std::list<Renderable> const&) |
290 | { |
291 | prepare_gl(); |
292 | } |
293 | |
294 | -void mga::HWC10Device::gpu_render(EGLDisplay dpy, EGLSurface sur) |
295 | +void mga::HwcFbDevice::gpu_render(EGLDisplay dpy, EGLSurface sur) |
296 | { |
297 | auto display_list = layer_list.native_list(); |
298 | display_list->dpy = dpy; |
299 | @@ -68,7 +68,7 @@ |
300 | } |
301 | } |
302 | |
303 | -void mga::HWC10Device::post(mg::Buffer const& buffer) |
304 | +void mga::HwcFbDevice::post(mg::Buffer const& buffer) |
305 | { |
306 | auto lg = lock_unblanked(); |
307 | |
308 | |
309 | === renamed file 'src/platform/graphics/android/hwc10_device.h' => 'src/platform/graphics/android/hwc_fb_device.h' |
310 | --- src/platform/graphics/android/hwc10_device.h 2014-01-20 16:38:54 +0000 |
311 | +++ src/platform/graphics/android/hwc_fb_device.h 2014-01-21 17:48:17 +0000 |
312 | @@ -16,8 +16,8 @@ |
313 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
314 | */ |
315 | |
316 | -#ifndef MIR_GRAPHICS_ANDROID_HWC10_DEVICE_H_ |
317 | -#define MIR_GRAPHICS_ANDROID_HWC10_DEVICE_H_ |
318 | +#ifndef MIR_GRAPHICS_ANDROID_HWC_FB_DEVICE_H_ |
319 | +#define MIR_GRAPHICS_ANDROID_HWC_FB_DEVICE_H_ |
320 | |
321 | #include "hwc_common_device.h" |
322 | #include "hwc_layerlist.h" |
323 | @@ -31,10 +31,10 @@ |
324 | namespace android |
325 | { |
326 | |
327 | -class HWC10Device : public HWCCommonDevice |
328 | +class HwcFbDevice : public HWCCommonDevice |
329 | { |
330 | public: |
331 | - HWC10Device(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
332 | + HwcFbDevice(std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
333 | std::shared_ptr<framebuffer_device_t> const& fb_device, |
334 | std::shared_ptr<HWCVsyncCoordinator> const& coordinator); |
335 | |
336 | @@ -52,4 +52,4 @@ |
337 | } |
338 | } |
339 | |
340 | -#endif /* MIR_GRAPHICS_ANDROID_HWC10_DEVICE_H_ */ |
341 | +#endif /* MIR_GRAPHICS_ANDROID_HWC_FB_DEVICE_H_ */ |
342 | |
343 | === modified file 'src/platform/graphics/android/hwc_layerlist.cpp' |
344 | --- src/platform/graphics/android/hwc_layerlist.cpp 2014-01-13 06:12:33 +0000 |
345 | +++ src/platform/graphics/android/hwc_layerlist.cpp 2014-01-21 17:48:17 +0000 |
346 | @@ -109,12 +109,18 @@ |
347 | |
348 | void mga::LayerList::set_fb_target(std::shared_ptr<NativeBuffer> const& native_buffer) |
349 | { |
350 | - auto fb_position = hwc_representation->numHwLayers - 1; |
351 | - |
352 | - if (hwc_representation->hwLayers[fb_position].compositionType == HWC_FRAMEBUFFER_TARGET) |
353 | + if (hwc_representation->numHwLayers == 2) |
354 | { |
355 | - hwc_representation->hwLayers[fb_position] = mga::FramebufferLayer(*native_buffer); |
356 | - hwc_representation->hwLayers[fb_position].acquireFenceFd = native_buffer->copy_fence(); |
357 | + if (hwc_representation->hwLayers[0].flags == HWC_SKIP_LAYER) |
358 | + { |
359 | + hwc_representation->hwLayers[0] = mga::CompositionLayer(*native_buffer, HWC_SKIP_LAYER); |
360 | + } |
361 | + |
362 | + if (hwc_representation->hwLayers[1].compositionType == HWC_FRAMEBUFFER_TARGET) |
363 | + { |
364 | + hwc_representation->hwLayers[1] = mga::FramebufferLayer(*native_buffer); |
365 | + hwc_representation->hwLayers[1].acquireFenceFd = native_buffer->copy_fence(); |
366 | + } |
367 | } |
368 | } |
369 | |
370 | |
371 | === modified file 'src/platform/graphics/android/output_builder.cpp' |
372 | --- src/platform/graphics/android/output_builder.cpp 2014-01-13 06:12:33 +0000 |
373 | +++ src/platform/graphics/android/output_builder.cpp 2014-01-21 17:48:17 +0000 |
374 | @@ -49,12 +49,6 @@ |
375 | { |
376 | force_backup_display = true; |
377 | } |
378 | - |
379 | - //HWC 1.2 not supported yet. make an attempt to use backup display |
380 | - if (hwc_native && hwc_native->common.version == HWC_DEVICE_API_VERSION_1_2) |
381 | - { |
382 | - force_backup_display = true; |
383 | - } |
384 | } |
385 | |
386 | if (force_backup_display || hwc_native->common.version == HWC_DEVICE_API_VERSION_1_0) |
387 | @@ -83,16 +77,29 @@ |
388 | } |
389 | else |
390 | { |
391 | - if (hwc_native->common.version == HWC_DEVICE_API_VERSION_1_1) |
392 | - { |
393 | - device = res_factory->create_hwc11_device(hwc_native); |
394 | - display_report->report_hwc_composition_in_use(1,1); |
395 | - } |
396 | if (hwc_native->common.version == HWC_DEVICE_API_VERSION_1_0) |
397 | { |
398 | - device = res_factory->create_hwc10_device(hwc_native, fb_native); |
399 | - display_report->report_hwc_composition_in_use(1,0); |
400 | - } |
401 | + device = res_factory->create_hwc_fb_device(hwc_native, fb_native); |
402 | + } |
403 | + else //versions 1.1, 1.2 |
404 | + { |
405 | + device = res_factory->create_hwc_device(hwc_native); |
406 | + } |
407 | + |
408 | + switch (hwc_native->common.version) |
409 | + { |
410 | + case HWC_DEVICE_API_VERSION_1_2: |
411 | + display_report->report_hwc_composition_in_use(1,2); |
412 | + break; |
413 | + case HWC_DEVICE_API_VERSION_1_1: |
414 | + display_report->report_hwc_composition_in_use(1,1); |
415 | + break; |
416 | + case HWC_DEVICE_API_VERSION_1_0: |
417 | + display_report->report_hwc_composition_in_use(1,0); |
418 | + break; |
419 | + default: |
420 | + break; |
421 | + } |
422 | } |
423 | |
424 | return device; |
425 | |
426 | === modified file 'src/platform/graphics/android/resource_factory.cpp' |
427 | --- src/platform/graphics/android/resource_factory.cpp 2014-01-13 06:12:33 +0000 |
428 | +++ src/platform/graphics/android/resource_factory.cpp 2014-01-21 17:48:17 +0000 |
429 | @@ -24,8 +24,8 @@ |
430 | #include "graphic_buffer_allocator.h" |
431 | #include "server_render_window.h" |
432 | #include "interpreter_cache.h" |
433 | -#include "hwc11_device.h" |
434 | -#include "hwc10_device.h" |
435 | +#include "hwc_device.h" |
436 | +#include "hwc_fb_device.h" |
437 | #include "hwc_layerlist.h" |
438 | #include "hwc_vsync.h" |
439 | #include "android_display.h" |
440 | @@ -87,17 +87,17 @@ |
441 | return std::make_shared<mga::FBDevice>(fb_native_device); |
442 | } |
443 | |
444 | -std::shared_ptr<mga::DisplayDevice> mga::ResourceFactory::create_hwc11_device( |
445 | +std::shared_ptr<mga::DisplayDevice> mga::ResourceFactory::create_hwc_device( |
446 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device) const |
447 | { |
448 | auto syncer = std::make_shared<mga::HWCVsync>(); |
449 | - return std::make_shared<mga::HWC11Device>(hwc_native_device, syncer); |
450 | + return std::make_shared<mga::HwcDevice>(hwc_native_device, syncer); |
451 | } |
452 | |
453 | -std::shared_ptr<mga::DisplayDevice> mga::ResourceFactory::create_hwc10_device( |
454 | +std::shared_ptr<mga::DisplayDevice> mga::ResourceFactory::create_hwc_fb_device( |
455 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device, |
456 | std::shared_ptr<framebuffer_device_t> const& fb_native_device) const |
457 | { |
458 | auto syncer = std::make_shared<mga::HWCVsync>(); |
459 | - return std::make_shared<mga::HWC10Device>(hwc_native_device, fb_native_device, syncer); |
460 | + return std::make_shared<mga::HwcFbDevice>(hwc_native_device, fb_native_device, syncer); |
461 | } |
462 | |
463 | === modified file 'src/platform/graphics/android/resource_factory.h' |
464 | --- src/platform/graphics/android/resource_factory.h 2014-01-13 06:12:33 +0000 |
465 | +++ src/platform/graphics/android/resource_factory.h 2014-01-21 17:48:17 +0000 |
466 | @@ -38,9 +38,9 @@ |
467 | //devices |
468 | std::shared_ptr<DisplayDevice> create_fb_device( |
469 | std::shared_ptr<framebuffer_device_t> const& fb_native_device) const; |
470 | - std::shared_ptr<DisplayDevice> create_hwc11_device( |
471 | + std::shared_ptr<DisplayDevice> create_hwc_device( |
472 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device) const; |
473 | - std::shared_ptr<DisplayDevice> create_hwc10_device( |
474 | + std::shared_ptr<DisplayDevice> create_hwc_fb_device( |
475 | std::shared_ptr<hwc_composer_device_1> const& hwc_native_device, |
476 | std::shared_ptr<framebuffer_device_t> const& fb_native_device) const; |
477 | |
478 | |
479 | === modified file 'tests/unit-tests/graphics/android/CMakeLists.txt' |
480 | --- tests/unit-tests/graphics/android/CMakeLists.txt 2014-01-13 06:12:33 +0000 |
481 | +++ tests/unit-tests/graphics/android/CMakeLists.txt 2014-01-21 17:48:17 +0000 |
482 | @@ -7,8 +7,8 @@ |
483 | ${CMAKE_CURRENT_SOURCE_DIR}/test_android_alloc_adaptor.cpp |
484 | ${CMAKE_CURRENT_SOURCE_DIR}/test_android_buffer_allocator.cpp |
485 | ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_device.cpp |
486 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc10_device.cpp |
487 | - ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc11_device.cpp |
488 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_fb_device.cpp |
489 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_common_device.cpp |
490 | ${CMAKE_CURRENT_SOURCE_DIR}/test_hwc_display.cpp |
491 | ${CMAKE_CURRENT_SOURCE_DIR}/test_internal_client_interpreter.cpp |
492 | ${CMAKE_CURRENT_SOURCE_DIR}/test_internal_client.cpp |
493 | |
494 | === renamed file 'tests/unit-tests/graphics/android/test_hwc_device.cpp' => 'tests/unit-tests/graphics/android/test_hwc_common_device.cpp' |
495 | --- tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-01-13 06:12:33 +0000 |
496 | +++ tests/unit-tests/graphics/android/test_hwc_common_device.cpp 2014-01-21 17:48:17 +0000 |
497 | @@ -16,8 +16,8 @@ |
498 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
499 | */ |
500 | |
501 | -#include "src/platform/graphics/android/hwc10_device.h" |
502 | -#include "src/platform/graphics/android/hwc11_device.h" |
503 | +#include "src/platform/graphics/android/hwc_fb_device.h" |
504 | +#include "src/platform/graphics/android/hwc_device.h" |
505 | #include "src/platform/graphics/android/hwc_layerlist.h" |
506 | #include "src/platform/graphics/android/hwc_vsync_coordinator.h" |
507 | #include "mir_test_doubles/mock_hwc_composer_device_1.h" |
508 | @@ -44,21 +44,21 @@ |
509 | std::shared_ptr<mga::HWCVsyncCoordinator> const& coordinator); |
510 | |
511 | template <> |
512 | -std::shared_ptr<mga::HWCCommonDevice> make_hwc_device<mga::HWC10Device>( |
513 | +std::shared_ptr<mga::HWCCommonDevice> make_hwc_device<mga::HwcFbDevice>( |
514 | std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
515 | std::shared_ptr<framebuffer_device_t> const& fb_device, |
516 | std::shared_ptr<mga::HWCVsyncCoordinator> const& coordinator) |
517 | { |
518 | - return std::make_shared<mga::HWC10Device>(hwc_device, fb_device, coordinator); |
519 | + return std::make_shared<mga::HwcFbDevice>(hwc_device, fb_device, coordinator); |
520 | } |
521 | |
522 | template <> |
523 | -std::shared_ptr<mga::HWCCommonDevice> make_hwc_device<mga::HWC11Device>( |
524 | +std::shared_ptr<mga::HWCCommonDevice> make_hwc_device<mga::HwcDevice>( |
525 | std::shared_ptr<hwc_composer_device_1> const& hwc_device, |
526 | std::shared_ptr<framebuffer_device_t> const&, |
527 | std::shared_ptr<mga::HWCVsyncCoordinator> const& coordinator) |
528 | { |
529 | - return std::make_shared<mga::HWC11Device>(hwc_device, coordinator); |
530 | + return std::make_shared<mga::HwcDevice>(hwc_device, coordinator); |
531 | } |
532 | |
533 | template<typename T> |
534 | @@ -80,7 +80,7 @@ |
535 | std::shared_ptr<mtd::MockFBHalDevice> mock_fbdev; |
536 | }; |
537 | |
538 | -typedef ::testing::Types<mga::HWC10Device, mga::HWC11Device> HWCDeviceTestTypes; |
539 | +typedef ::testing::Types<mga::HwcFbDevice, mga::HwcDevice> HWCDeviceTestTypes; |
540 | TYPED_TEST_CASE(HWCCommon, HWCDeviceTestTypes); |
541 | |
542 | TYPED_TEST(HWCCommon, test_proc_registration) |
543 | |
544 | === renamed file 'tests/unit-tests/graphics/android/test_hwc11_device.cpp' => 'tests/unit-tests/graphics/android/test_hwc_device.cpp' |
545 | --- tests/unit-tests/graphics/android/test_hwc11_device.cpp 2014-01-20 16:40:37 +0000 |
546 | +++ tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-01-21 17:48:17 +0000 |
547 | @@ -17,7 +17,7 @@ |
548 | */ |
549 | |
550 | #include "src/platform/graphics/android/framebuffer_bundle.h" |
551 | -#include "src/platform/graphics/android/hwc11_device.h" |
552 | +#include "src/platform/graphics/android/hwc_device.h" |
553 | #include "src/platform/graphics/android/hwc_layerlist.h" |
554 | #include "mir_test_doubles/mock_hwc_composer_device_1.h" |
555 | #include "mir_test_doubles/mock_android_native_buffer.h" |
556 | @@ -35,7 +35,7 @@ |
557 | namespace mtd=mir::test::doubles; |
558 | namespace geom=mir::geometry; |
559 | |
560 | -class HWC11Device : public ::testing::Test |
561 | +class HwcDevice : public ::testing::Test |
562 | { |
563 | protected: |
564 | virtual void SetUp() |
565 | @@ -61,60 +61,83 @@ |
566 | testing::NiceMock<mtd::MockEGL> mock_egl; |
567 | }; |
568 | |
569 | -TEST_F(HWC11Device, test_hwc_prepare) |
570 | +TEST_F(HwcDevice, test_hwc_displays) |
571 | +{ |
572 | + using namespace testing; |
573 | + EXPECT_CALL(*mock_device, prepare_interface(mock_device.get(),_,_)) |
574 | + .Times(1); |
575 | + EXPECT_CALL(*mock_device, set_interface(mock_device.get(),_,_)) |
576 | + .Times(1); |
577 | + |
578 | + mga::HwcDevice device(mock_device, mock_vsync); |
579 | + device.prepare_gl(); |
580 | + device.post(*mock_buffer); |
581 | + |
582 | + /* primary phone display */ |
583 | + EXPECT_TRUE(mock_device->primary_prepare); |
584 | + EXPECT_TRUE(mock_device->primary_set); |
585 | + /* external monitor display not supported yet */ |
586 | + EXPECT_FALSE(mock_device->external_prepare); |
587 | + EXPECT_FALSE(mock_device->external_set); |
588 | + /* virtual monitor display not supported yet */ |
589 | + EXPECT_FALSE(mock_device->virtual_prepare); |
590 | + EXPECT_FALSE(mock_device->virtual_set); |
591 | +} |
592 | + |
593 | +TEST_F(HwcDevice, test_hwc_prepare) |
594 | { |
595 | using namespace testing; |
596 | EXPECT_CALL(*mock_device, prepare_interface(mock_device.get(), 1, _)) |
597 | .Times(1); |
598 | |
599 | - mga::HWC11Device device(mock_device, mock_vsync); |
600 | + mga::HwcDevice device(mock_device, mock_vsync); |
601 | device.prepare_gl(); |
602 | EXPECT_EQ(2, mock_device->display0_prepare_content.numHwLayers); |
603 | EXPECT_EQ(-1, mock_device->display0_prepare_content.retireFenceFd); |
604 | } |
605 | |
606 | -TEST_F(HWC11Device, test_hwc_prepare_with_overlays) |
607 | +TEST_F(HwcDevice, test_hwc_prepare_with_overlays) |
608 | { |
609 | using namespace testing; |
610 | EXPECT_CALL(*mock_device, prepare_interface(mock_device.get(), 1, _)) |
611 | .Times(1); |
612 | |
613 | - mga::HWC11Device device(mock_device, mock_vsync); |
614 | + mga::HwcDevice device(mock_device, mock_vsync); |
615 | std::list<mg::Renderable> renderlist; |
616 | device.prepare_gl_and_overlays(renderlist); |
617 | EXPECT_EQ(2, mock_device->display0_prepare_content.numHwLayers); |
618 | EXPECT_EQ(-1, mock_device->display0_prepare_content.retireFenceFd); |
619 | } |
620 | |
621 | -TEST_F(HWC11Device, test_hwc_render) |
622 | +TEST_F(HwcDevice, test_hwc_render) |
623 | { |
624 | EXPECT_CALL(mock_egl, eglSwapBuffers(dpy,surf)) |
625 | .Times(1); |
626 | - mga::HWC11Device device(mock_device, mock_vsync); |
627 | + mga::HwcDevice device(mock_device, mock_vsync); |
628 | device.gpu_render(dpy, surf); |
629 | } |
630 | |
631 | -TEST_F(HWC11Device, test_hwc_swapbuffers_failure) |
632 | +TEST_F(HwcDevice, test_hwc_swapbuffers_failure) |
633 | { |
634 | using namespace testing; |
635 | EXPECT_CALL(mock_egl, eglSwapBuffers(dpy,surf)) |
636 | .Times(1) |
637 | .WillOnce(Return(EGL_FALSE)); |
638 | |
639 | - mga::HWC11Device device(mock_device, mock_vsync); |
640 | + mga::HwcDevice device(mock_device, mock_vsync); |
641 | |
642 | EXPECT_THROW({ |
643 | device.gpu_render(dpy, surf); |
644 | }, std::runtime_error); |
645 | } |
646 | |
647 | -TEST_F(HWC11Device, test_hwc_commit) |
648 | +TEST_F(HwcDevice, test_hwc_commit) |
649 | { |
650 | using namespace testing; |
651 | int hwc_return_fence = 94; |
652 | mock_device->hwc_set_return_fence(hwc_return_fence); |
653 | |
654 | - mga::HWC11Device device(mock_device, mock_vsync); |
655 | + mga::HwcDevice device(mock_device, mock_vsync); |
656 | |
657 | InSequence seq; |
658 | EXPECT_CALL(*mock_device, set_interface(mock_device.get(), 1, _)) |
659 | @@ -133,13 +156,13 @@ |
660 | EXPECT_EQ(0, mock_device->set_layerlist[1].flags); |
661 | } |
662 | |
663 | -TEST_F(HWC11Device, test_hwc_commit_failure) |
664 | +TEST_F(HwcDevice, test_hwc_commit_failure) |
665 | { |
666 | using namespace testing; |
667 | |
668 | - mga::HWC11Device device(mock_device, mock_vsync); |
669 | + mga::HwcDevice device(mock_device, mock_vsync); |
670 | |
671 | - EXPECT_CALL(*mock_device, set_interface(mock_device.get(), 1, _)) |
672 | + EXPECT_CALL(*mock_device, set_interface(mock_device.get(), _, _)) |
673 | .Times(1) |
674 | .WillOnce(Return(-1)); |
675 | |
676 | |
677 | === renamed file 'tests/unit-tests/graphics/android/test_hwc10_device.cpp' => 'tests/unit-tests/graphics/android/test_hwc_fb_device.cpp' |
678 | --- tests/unit-tests/graphics/android/test_hwc10_device.cpp 2014-01-20 16:38:54 +0000 |
679 | +++ tests/unit-tests/graphics/android/test_hwc_fb_device.cpp 2014-01-21 17:48:17 +0000 |
680 | @@ -16,7 +16,7 @@ |
681 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
682 | */ |
683 | |
684 | -#include "src/platform/graphics/android/hwc10_device.h" |
685 | +#include "src/platform/graphics/android/hwc_fb_device.h" |
686 | #include "mir_test_doubles/mock_display_device.h" |
687 | #include "mir_test_doubles/mock_hwc_composer_device_1.h" |
688 | #include "mir_test_doubles/mock_buffer.h" |
689 | @@ -31,7 +31,7 @@ |
690 | namespace mtd=mir::test::doubles; |
691 | namespace geom=mir::geometry; |
692 | |
693 | -class HWC10Device : public ::testing::Test |
694 | +class HwcFbDevice : public ::testing::Test |
695 | { |
696 | protected: |
697 | virtual void SetUp() |
698 | @@ -57,13 +57,13 @@ |
699 | std::shared_ptr<mtd::MockBuffer> mock_buffer; |
700 | }; |
701 | |
702 | -TEST_F(HWC10Device, hwc10_prepare_gl_only) |
703 | +TEST_F(HwcFbDevice, hwc10_prepare_gl_only) |
704 | { |
705 | using namespace testing; |
706 | EXPECT_CALL(*mock_hwc_device, prepare_interface(mock_hwc_device.get(), 1, _)) |
707 | .Times(1); |
708 | |
709 | - mga::HWC10Device device(mock_hwc_device, mock_fb_device, mock_vsync); |
710 | + mga::HwcFbDevice device(mock_hwc_device, mock_fb_device, mock_vsync); |
711 | |
712 | device.prepare_gl(); |
713 | |
714 | @@ -75,13 +75,13 @@ |
715 | EXPECT_EQ(HWC_SKIP_LAYER, mock_hwc_device->prepare_layerlist[0].flags); |
716 | } |
717 | |
718 | -TEST_F(HWC10Device, hwc10_prepare_with_renderables) |
719 | +TEST_F(HwcFbDevice, hwc10_prepare_with_renderables) |
720 | { |
721 | using namespace testing; |
722 | EXPECT_CALL(*mock_hwc_device, prepare_interface(mock_hwc_device.get(), 1, _)) |
723 | .Times(1); |
724 | |
725 | - mga::HWC10Device device(mock_hwc_device, mock_fb_device, mock_vsync); |
726 | + mga::HwcFbDevice device(mock_hwc_device, mock_fb_device, mock_vsync); |
727 | |
728 | std::list<mg::Renderable> renderlist; |
729 | device.prepare_gl_and_overlays(renderlist); |
730 | @@ -94,7 +94,7 @@ |
731 | EXPECT_EQ(HWC_SKIP_LAYER, mock_hwc_device->prepare_layerlist[0].flags); |
732 | } |
733 | |
734 | -TEST_F(HWC10Device, hwc10_render_frame) |
735 | +TEST_F(HwcFbDevice, hwc10_render_frame) |
736 | { |
737 | using namespace testing; |
738 | |
739 | @@ -106,7 +106,7 @@ |
740 | EXPECT_CALL(*mock_hwc_device, set_interface(mock_hwc_device.get(), 1, _)) |
741 | .Times(1); |
742 | |
743 | - mga::HWC10Device device(mock_hwc_device, mock_fb_device, mock_vsync); |
744 | + mga::HwcFbDevice device(mock_hwc_device, mock_fb_device, mock_vsync); |
745 | |
746 | device.gpu_render(dpy, sur); |
747 | |
748 | @@ -120,7 +120,7 @@ |
749 | EXPECT_EQ(HWC_SKIP_LAYER, mock_hwc_device->set_layerlist[0].flags); |
750 | } |
751 | |
752 | -TEST_F(HWC10Device, hwc10_prepare_frame_failure) |
753 | +TEST_F(HwcFbDevice, hwc10_prepare_frame_failure) |
754 | { |
755 | using namespace testing; |
756 | |
757 | @@ -128,14 +128,14 @@ |
758 | .Times(1) |
759 | .WillOnce(Return(-1)); |
760 | |
761 | - mga::HWC10Device device(mock_hwc_device, mock_fb_device, mock_vsync); |
762 | + mga::HwcFbDevice device(mock_hwc_device, mock_fb_device, mock_vsync); |
763 | |
764 | EXPECT_THROW({ |
765 | device.prepare_gl(); |
766 | }, std::runtime_error); |
767 | } |
768 | |
769 | -TEST_F(HWC10Device, hwc10_commit_frame_failure) |
770 | +TEST_F(HwcFbDevice, hwc10_commit_frame_failure) |
771 | { |
772 | using namespace testing; |
773 | |
774 | @@ -147,7 +147,7 @@ |
775 | .Times(1) |
776 | .WillOnce(Return(-1)); |
777 | |
778 | - mga::HWC10Device device(mock_hwc_device, mock_fb_device, mock_vsync); |
779 | + mga::HwcFbDevice device(mock_hwc_device, mock_fb_device, mock_vsync); |
780 | |
781 | EXPECT_THROW({ |
782 | device.gpu_render(dpy, sur); |
783 | |
784 | === modified file 'tests/unit-tests/graphics/android/test_hwc_layerlist.cpp' |
785 | --- tests/unit-tests/graphics/android/test_hwc_layerlist.cpp 2014-01-13 06:12:33 +0000 |
786 | +++ tests/unit-tests/graphics/android/test_hwc_layerlist.cpp 2014-01-21 17:48:17 +0000 |
787 | @@ -40,6 +40,8 @@ |
788 | native_handle_1->anwb()->width = width; |
789 | native_handle_1->anwb()->height = height; |
790 | native_handle_2 = std::make_shared<NiceMock<mtd::MockAndroidNativeBuffer>>(); |
791 | + native_handle_2->anwb()->width = width; |
792 | + native_handle_2->anwb()->height = height; |
793 | } |
794 | |
795 | int width; |
796 | @@ -147,14 +149,17 @@ |
797 | .WillOnce(Return(handle_fence)); |
798 | |
799 | mga::LayerList layerlist({ |
800 | - mga::CompositionLayer(*native_handle_1, 0), |
801 | + mga::CompositionLayer(*native_handle_1, HWC_SKIP_LAYER), |
802 | mga::FramebufferLayer(*native_handle_1)}); |
803 | layerlist.set_fb_target(native_handle_2); |
804 | |
805 | auto list = layerlist.native_list(); |
806 | ASSERT_EQ(2u, list->numHwLayers); |
807 | - EXPECT_EQ(native_handle_1->handle(), list->hwLayers[0].handle); |
808 | EXPECT_EQ(-1, list->hwLayers[0].acquireFenceFd); |
809 | + hwc_rect_t expected_rect{0, 0, width, height}; |
810 | + EXPECT_THAT(list->hwLayers[0].displayFrame, MatchesRect(expected_rect, "dispframe")); |
811 | + EXPECT_THAT(list->hwLayers[1].displayFrame, MatchesRect(expected_rect, "dispframe")); |
812 | + EXPECT_EQ(list->hwLayers[0].handle, native_handle_2->handle()); |
813 | EXPECT_EQ(list->hwLayers[1].handle, native_handle_2->handle()); |
814 | EXPECT_EQ(handle_fence, list->hwLayers[1].acquireFenceFd); |
815 | } |
816 | |
817 | === modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp' |
818 | --- tests/unit-tests/graphics/android/test_output_builder.cpp 2014-01-13 06:12:33 +0000 |
819 | +++ tests/unit-tests/graphics/android/test_output_builder.cpp 2014-01-21 17:48:17 +0000 |
820 | @@ -64,8 +64,8 @@ |
821 | ON_CALL(*this, create_fb_native_device()).WillByDefault(Return(nullptr)); |
822 | ON_CALL(*this, create_native_window(_)).WillByDefault(Return(nullptr)); |
823 | ON_CALL(*this, create_fb_device(_)).WillByDefault(Return(nullptr)); |
824 | - ON_CALL(*this, create_hwc11_device(_)).WillByDefault(Return(nullptr)); |
825 | - ON_CALL(*this, create_hwc10_device(_,_)).WillByDefault(Return(nullptr)); |
826 | + ON_CALL(*this, create_hwc_device(_)).WillByDefault(Return(nullptr)); |
827 | + ON_CALL(*this, create_hwc_fb_device(_,_)).WillByDefault(Return(nullptr)); |
828 | } |
829 | |
830 | MOCK_CONST_METHOD0(create_hwc_native_device, std::shared_ptr<hwc_composer_device_1>()); |
831 | @@ -76,9 +76,9 @@ |
832 | |
833 | MOCK_CONST_METHOD1(create_fb_device, |
834 | std::shared_ptr<mga::DisplayDevice>(std::shared_ptr<framebuffer_device_t> const&)); |
835 | - MOCK_CONST_METHOD1(create_hwc11_device, |
836 | + MOCK_CONST_METHOD1(create_hwc_device, |
837 | std::shared_ptr<mga::DisplayDevice>(std::shared_ptr<hwc_composer_device_1> const&)); |
838 | - MOCK_CONST_METHOD2(create_hwc10_device, |
839 | + MOCK_CONST_METHOD2(create_hwc_fb_device, |
840 | std::shared_ptr<mga::DisplayDevice>( |
841 | std::shared_ptr<hwc_composer_device_1> const&, std::shared_ptr<framebuffer_device_t> const&)); |
842 | }; |
843 | @@ -116,7 +116,7 @@ |
844 | .Times(1); |
845 | EXPECT_CALL(*mock_resource_factory, create_fb_native_device()) |
846 | .Times(1); |
847 | - EXPECT_CALL(*mock_resource_factory, create_hwc10_device(_,_)) |
848 | + EXPECT_CALL(*mock_resource_factory, create_hwc_fb_device(_,_)) |
849 | .Times(1); |
850 | EXPECT_CALL(*mock_display_report, report_hwc_composition_in_use(1,0)) |
851 | .Times(1); |
852 | @@ -155,7 +155,7 @@ |
853 | |
854 | EXPECT_CALL(*mock_resource_factory, create_hwc_native_device()) |
855 | .Times(1); |
856 | - EXPECT_CALL(*mock_resource_factory, create_hwc11_device(_)) |
857 | + EXPECT_CALL(*mock_resource_factory, create_hwc_device(_)) |
858 | .Times(1); |
859 | EXPECT_CALL(*mock_display_report, report_hwc_composition_in_use(1,1)) |
860 | .Times(1); |
861 | @@ -205,8 +205,7 @@ |
862 | }, std::runtime_error); |
863 | } |
864 | |
865 | -//we don't support hwc 1.2 quite yet. for the time being, at least try the fb backup |
866 | -TEST_F(OutputBuilder, hwc_version_12_attempts_fb_backup) |
867 | +TEST_F(OutputBuilder, hwc_version_12) |
868 | { |
869 | using namespace testing; |
870 | |
871 | @@ -214,11 +213,9 @@ |
872 | |
873 | EXPECT_CALL(*mock_resource_factory, create_hwc_native_device()) |
874 | .Times(1); |
875 | - EXPECT_CALL(*mock_resource_factory, create_fb_native_device()) |
876 | - .Times(1); |
877 | - EXPECT_CALL(*mock_resource_factory, create_fb_device(_)) |
878 | - .Times(1); |
879 | - EXPECT_CALL(*mock_display_report, report_gpu_composition_in_use()) |
880 | + EXPECT_CALL(*mock_resource_factory, create_hwc_device(_)) |
881 | + .Times(1); |
882 | + EXPECT_CALL(*mock_display_report, report_hwc_composition_in_use(1,2)) |
883 | .Times(1); |
884 | |
885 | mga::OutputBuilder factory( |
FAILED: Continuous integration, rev:1345 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- ci/678/ jenkins. qa.ubuntu. com/job/ mir-android- trusty- i386-build/ 659 jenkins. qa.ubuntu. com/job/ mir-clang- trusty- amd64-build/ 655 jenkins. qa.ubuntu. com/job/ mir-mediumtests -trusty- touch/262/ console jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 408 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 408/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- armhf-ci/ 412/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- trusty- armhf/262/ console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- team-mir- development- branch- ci/678/ rebuild
http://