Merge lp:~kdub/mir/fix-1270245 into lp:mir
- fix-1270245
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Kevin DuBois |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3150 |
Proposed branch: | lp:~kdub/mir/fix-1270245 |
Merge into: | lp:mir |
Diff against target: |
328 lines (+165/-12) 7 files modified
src/platforms/android/server/device_quirks.cpp (+19/-6) src/platforms/android/server/device_quirks.h (+2/-0) src/platforms/android/server/display.cpp (+2/-1) src/platforms/android/server/server_render_window.cpp (+11/-3) src/platforms/android/server/server_render_window.h (+4/-1) tests/unit-tests/graphics/android/test_device_detection.cpp (+76/-0) tests/unit-tests/graphics/android/test_server_interpreter.cpp (+51/-1) |
To merge this branch: | bzr merge lp:~kdub/mir/fix-1270245 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Andreas Pokorny (community) | Approve | ||
Alan Griffiths | Abstain | ||
Alexandros Frantzis (community) | Approve | ||
Review via email: mp+278489@code.launchpad.net |
Commit message
android: explicitly wait for the synchronization fence before the framebuffer EGL context is posted in hwc::set() for some mali-based devices.
fixes: lp: #1270245
Description of the change
android: explicitly wait for the synchronization fence before the framebuffer EGL context is posted in hwc::set() for some mali-based devices.
note: this branch, in tandem with https:/
fixes: lp: #1270245
PS Jenkins bot (ps-jenkins) wrote : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
I am not able to reproduce the original bug locally to check if the fix works properly, but the code looks sensible.
+ if (clear_fence)
+ mga::SyncFence(
Since RealSyncFileOps is a stateless object we could instantiate it once as a member variable and reuse it to avoid unnecessary memory allocation on every frame. Of course there is still mir::Fd and probably many other objects we are allocating dynamically on every frame, but let's cut where we can.
Andreas Pokorny (andreas-pokorny) wrote : | # |
why mx4? Shouldnt that be nexus10? Or is that problem not related to the gpu but the display controller itself?
Alan Griffiths (alan-griffiths) wrote : | # |
+ return device_name == std::string{
I know there's existing code in this style, but it seem unnecessary to construct temporary string objects for these constants. As std::string has an operator=
return device_name == "krillin" || device_name == "mx4";
Kevin DuBois (kdub) wrote : | # |
@N10, This device isn't supported anymore by mir, and I haven't verified that this fix works for the device. It might be better to detect the device class eventually (eg, mali) and autodetect the workaround based on that.
Other issues fixed.
Andreas Pokorny (andreas-pokorny) wrote : | # |
Confused - I tried your branch ..
1) without a || device_name == "manta" :
corruption in mir_demo_
strange inconsistent updates in fingerpaint .. always somwehere on the right side of the buffer
no jumps or flickering in egltriangle
2) with an additional || device_name "manta"
no corruption in mir_demo_
no update problems in fingerpaint!
no jumps or flickering in egltriangle
It seems to fix lp:1517205
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3128
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Andreas Pokorny (andreas-pokorny) wrote : | # |
> @N10, This device isn't supported anymore by mir, and I haven't verified that
> this fix works for the device. It might be better to detect the device class
> eventually (eg, mali) and autodetect the workaround based on that.
>
> Other issues fixed.
can we add manta here? But the problem is not limited to mali since mx4 has the quirk?
Kevin DuBois (kdub) wrote : | # |
@Andreas, thanks for verifying, will add the n10 as well
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3131
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'src/platforms/android/server/device_quirks.cpp' | |||
2 | --- src/platforms/android/server/device_quirks.cpp 2015-11-25 12:59:13 +0000 | |||
3 | +++ src/platforms/android/server/device_quirks.cpp 2015-11-30 18:34:59 +0000 | |||
4 | @@ -49,7 +49,7 @@ | |||
5 | 49 | 49 | ||
6 | 50 | unsigned int num_framebuffers_for(std::string const& device_name, bool quirk_enabled) | 50 | unsigned int num_framebuffers_for(std::string const& device_name, bool quirk_enabled) |
7 | 51 | { | 51 | { |
9 | 52 | if (quirk_enabled && device_name == std::string{"mx3"}) | 52 | if (quirk_enabled && device_name == "mx3") |
10 | 53 | return 3; | 53 | return 3; |
11 | 54 | else | 54 | else |
12 | 55 | return 2; | 55 | return 2; |
13 | @@ -57,15 +57,22 @@ | |||
14 | 57 | 57 | ||
15 | 58 | bool gralloc_cannot_be_closed_safely_for(std::string const& device_name, bool quirk_enabled) | 58 | bool gralloc_cannot_be_closed_safely_for(std::string const& device_name, bool quirk_enabled) |
16 | 59 | { | 59 | { |
19 | 60 | return quirk_enabled && device_name == std::string{"krillin"}; | 60 | return quirk_enabled && device_name == "krillin"; |
20 | 61 | } | 61 | } |
21 | 62 | |||
22 | 63 | bool clear_fb_context_fence_for(std::string const& device_name) | ||
23 | 64 | { | ||
24 | 65 | return device_name == "krillin" || device_name == "mx4" || device_name == "manta"; | ||
25 | 66 | } | ||
26 | 67 | |||
27 | 62 | } | 68 | } |
28 | 63 | 69 | ||
29 | 64 | mga::DeviceQuirks::DeviceQuirks(PropertiesWrapper const& properties) | 70 | mga::DeviceQuirks::DeviceQuirks(PropertiesWrapper const& properties) |
30 | 65 | : device_name(determine_device_name(properties)), | 71 | : device_name(determine_device_name(properties)), |
31 | 66 | num_framebuffers_(num_framebuffers_for(device_name, true)), | 72 | num_framebuffers_(num_framebuffers_for(device_name, true)), |
32 | 67 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)), | 73 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)), |
34 | 68 | enable_width_alignment_quirk{true} | 74 | enable_width_alignment_quirk{true}, |
35 | 75 | clear_fb_context_fence_{clear_fb_context_fence_for(device_name)} | ||
36 | 69 | { | 76 | { |
37 | 70 | } | 77 | } |
38 | 71 | 78 | ||
39 | @@ -73,7 +80,8 @@ | |||
40 | 73 | : device_name(determine_device_name(properties)), | 80 | : device_name(determine_device_name(properties)), |
41 | 74 | num_framebuffers_(num_framebuffers_for(device_name, options.get(num_framebuffers_opt, true))), | 81 | num_framebuffers_(num_framebuffers_for(device_name, options.get(num_framebuffers_opt, true))), |
42 | 75 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, options.get(gralloc_cannot_be_closed_safely_opt, true))), | 82 | gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, options.get(gralloc_cannot_be_closed_safely_opt, true))), |
44 | 76 | enable_width_alignment_quirk(options.get(width_alignment_opt, true)) | 83 | enable_width_alignment_quirk(options.get(width_alignment_opt, true)), |
45 | 84 | clear_fb_context_fence_{clear_fb_context_fence_for(device_name)} | ||
46 | 77 | { | 85 | { |
47 | 78 | } | 86 | } |
48 | 79 | 87 | ||
49 | @@ -89,11 +97,16 @@ | |||
50 | 89 | 97 | ||
51 | 90 | int mga::DeviceQuirks::aligned_width(int width) const | 98 | int mga::DeviceQuirks::aligned_width(int width) const |
52 | 91 | { | 99 | { |
54 | 92 | if (enable_width_alignment_quirk && width == 720 && device_name == std::string{"vegetahd"}) | 100 | if (enable_width_alignment_quirk && width == 720 && device_name == "vegetahd") |
55 | 93 | return 736; | 101 | return 736; |
56 | 94 | return width; | 102 | return width; |
57 | 95 | } | 103 | } |
58 | 96 | 104 | ||
59 | 105 | bool mga::DeviceQuirks::clear_fb_context_fence() const | ||
60 | 106 | { | ||
61 | 107 | return clear_fb_context_fence_; | ||
62 | 108 | } | ||
63 | 109 | |||
64 | 97 | void mga::DeviceQuirks::add_options(boost::program_options::options_description& config) | 110 | void mga::DeviceQuirks::add_options(boost::program_options::options_description& config) |
65 | 98 | { | 111 | { |
66 | 99 | config.add_options() | 112 | config.add_options() |
67 | 100 | 113 | ||
68 | === modified file 'src/platforms/android/server/device_quirks.h' | |||
69 | --- src/platforms/android/server/device_quirks.h 2015-11-25 12:59:13 +0000 | |||
70 | +++ src/platforms/android/server/device_quirks.h 2015-11-30 18:34:59 +0000 | |||
71 | @@ -63,6 +63,7 @@ | |||
72 | 63 | unsigned int num_framebuffers() const; | 63 | unsigned int num_framebuffers() const; |
73 | 64 | bool gralloc_cannot_be_closed_safely() const; | 64 | bool gralloc_cannot_be_closed_safely() const; |
74 | 65 | int aligned_width(int width) const; | 65 | int aligned_width(int width) const; |
75 | 66 | bool clear_fb_context_fence() const; | ||
76 | 66 | 67 | ||
77 | 67 | static void add_options(boost::program_options::options_description& config); | 68 | static void add_options(boost::program_options::options_description& config); |
78 | 68 | 69 | ||
79 | @@ -73,6 +74,7 @@ | |||
80 | 73 | unsigned int const num_framebuffers_; | 74 | unsigned int const num_framebuffers_; |
81 | 74 | bool const gralloc_cannot_be_closed_safely_; | 75 | bool const gralloc_cannot_be_closed_safely_; |
82 | 75 | bool const enable_width_alignment_quirk; | 76 | bool const enable_width_alignment_quirk; |
83 | 77 | bool const clear_fb_context_fence_; | ||
84 | 76 | }; | 78 | }; |
85 | 77 | } | 79 | } |
86 | 78 | } | 80 | } |
87 | 79 | 81 | ||
88 | === modified file 'src/platforms/android/server/display.cpp' | |||
89 | --- src/platforms/android/server/display.cpp 2015-11-16 10:52:06 +0000 | |||
90 | +++ src/platforms/android/server/display.cpp 2015-11-30 18:34:59 +0000 | |||
91 | @@ -119,7 +119,8 @@ | |||
92 | 119 | { | 119 | { |
93 | 120 | std::shared_ptr<mga::FramebufferBundle> fbs{display_buffer_builder.create_framebuffers(config)}; | 120 | std::shared_ptr<mga::FramebufferBundle> fbs{display_buffer_builder.create_framebuffers(config)}; |
94 | 121 | auto cache = std::make_shared<mga::InterpreterCache>(); | 121 | auto cache = std::make_shared<mga::InterpreterCache>(); |
96 | 122 | auto interpreter = std::make_shared<mga::ServerRenderWindow>(fbs, config.current_format, cache); | 122 | mga::DeviceQuirks quirks(mga::PropertiesOps{}); |
97 | 123 | auto interpreter = std::make_shared<mga::ServerRenderWindow>(fbs, config.current_format, cache, quirks); | ||
98 | 123 | auto native_window = std::make_shared<mga::MirNativeWindow>(interpreter); | 124 | auto native_window = std::make_shared<mga::MirNativeWindow>(interpreter); |
99 | 124 | return std::unique_ptr<mga::ConfigurableDisplayBuffer>(new mga::DisplayBuffer( | 125 | return std::unique_ptr<mga::ConfigurableDisplayBuffer>(new mga::DisplayBuffer( |
100 | 125 | name, | 126 | name, |
101 | 126 | 127 | ||
102 | === modified file 'src/platforms/android/server/server_render_window.cpp' | |||
103 | --- src/platforms/android/server/server_render_window.cpp 2015-09-04 02:42:45 +0000 | |||
104 | +++ src/platforms/android/server/server_render_window.cpp 2015-11-30 18:34:59 +0000 | |||
105 | @@ -37,10 +37,12 @@ | |||
106 | 37 | mga::ServerRenderWindow::ServerRenderWindow( | 37 | mga::ServerRenderWindow::ServerRenderWindow( |
107 | 38 | std::shared_ptr<mga::FramebufferBundle> const& fb_bundle, | 38 | std::shared_ptr<mga::FramebufferBundle> const& fb_bundle, |
108 | 39 | MirPixelFormat format, | 39 | MirPixelFormat format, |
110 | 40 | std::shared_ptr<InterpreterResourceCache> const& cache) | 40 | std::shared_ptr<InterpreterResourceCache> const& cache, |
111 | 41 | DeviceQuirks& quirks) | ||
112 | 41 | : fb_bundle(fb_bundle), | 42 | : fb_bundle(fb_bundle), |
113 | 42 | resource_cache(cache), | 43 | resource_cache(cache), |
115 | 43 | format(mga::to_android_format(format)) | 44 | format(mga::to_android_format(format)), |
116 | 45 | clear_fence(quirks.clear_fb_context_fence()) | ||
117 | 44 | { | 46 | { |
118 | 45 | } | 47 | } |
119 | 46 | 48 | ||
120 | @@ -54,7 +56,13 @@ | |||
121 | 54 | 56 | ||
122 | 55 | void mga::ServerRenderWindow::driver_returns_buffer(ANativeWindowBuffer* buffer, int fence_fd) | 57 | void mga::ServerRenderWindow::driver_returns_buffer(ANativeWindowBuffer* buffer, int fence_fd) |
123 | 56 | { | 58 | { |
125 | 57 | resource_cache->update_native_fence(buffer, fence_fd); | 59 | //depending on the quirk, some mali drivers won't synchronize the fb context fence before posting. |
126 | 60 | //if this bug is present, we synchronize here to avoid tearing or other artifacts. | ||
127 | 61 | if (clear_fence) | ||
128 | 62 | mga::SyncFence(std::make_shared<RealSyncFileOps>(), mir::Fd(fence_fd)).wait(); | ||
129 | 63 | else | ||
130 | 64 | resource_cache->update_native_fence(buffer, fence_fd); | ||
131 | 65 | |||
132 | 58 | resource_cache->retrieve_buffer(buffer); | 66 | resource_cache->retrieve_buffer(buffer); |
133 | 59 | } | 67 | } |
134 | 60 | 68 | ||
135 | 61 | 69 | ||
136 | === modified file 'src/platforms/android/server/server_render_window.h' | |||
137 | --- src/platforms/android/server/server_render_window.h 2015-06-17 05:20:42 +0000 | |||
138 | +++ src/platforms/android/server/server_render_window.h 2015-11-30 18:34:59 +0000 | |||
139 | @@ -21,6 +21,7 @@ | |||
140 | 21 | #define MIR_GRAPHICS_ANDROID_SERVER_RENDER_WINDOW_H_ | 21 | #define MIR_GRAPHICS_ANDROID_SERVER_RENDER_WINDOW_H_ |
141 | 22 | 22 | ||
142 | 23 | #include "mir/graphics/android/android_driver_interpreter.h" | 23 | #include "mir/graphics/android/android_driver_interpreter.h" |
143 | 24 | #include "device_quirks.h" | ||
144 | 24 | #include "mir_toolkit/common.h" | 25 | #include "mir_toolkit/common.h" |
145 | 25 | 26 | ||
146 | 26 | #include <memory> | 27 | #include <memory> |
147 | @@ -39,7 +40,8 @@ | |||
148 | 39 | public: | 40 | public: |
149 | 40 | ServerRenderWindow(std::shared_ptr<FramebufferBundle> const& fb_bundle, | 41 | ServerRenderWindow(std::shared_ptr<FramebufferBundle> const& fb_bundle, |
150 | 41 | MirPixelFormat format, | 42 | MirPixelFormat format, |
152 | 42 | std::shared_ptr<InterpreterResourceCache> const&); | 43 | std::shared_ptr<InterpreterResourceCache> const&, |
153 | 44 | DeviceQuirks& quirks); | ||
154 | 43 | 45 | ||
155 | 44 | graphics::NativeBuffer* driver_requests_buffer() override; | 46 | graphics::NativeBuffer* driver_requests_buffer() override; |
156 | 45 | void driver_returns_buffer(ANativeWindowBuffer*, int fence_fd) override; | 47 | void driver_returns_buffer(ANativeWindowBuffer*, int fence_fd) override; |
157 | @@ -52,6 +54,7 @@ | |||
158 | 52 | std::shared_ptr<FramebufferBundle> const fb_bundle; | 54 | std::shared_ptr<FramebufferBundle> const fb_bundle; |
159 | 53 | std::shared_ptr<InterpreterResourceCache> const resource_cache; | 55 | std::shared_ptr<InterpreterResourceCache> const resource_cache; |
160 | 54 | int format; | 56 | int format; |
161 | 57 | bool const clear_fence; | ||
162 | 55 | }; | 58 | }; |
163 | 56 | 59 | ||
164 | 57 | } | 60 | } |
165 | 58 | 61 | ||
166 | === modified file 'tests/unit-tests/graphics/android/test_device_detection.cpp' | |||
167 | --- tests/unit-tests/graphics/android/test_device_detection.cpp 2015-11-25 12:59:13 +0000 | |||
168 | +++ tests/unit-tests/graphics/android/test_device_detection.cpp 2015-11-30 18:34:59 +0000 | |||
169 | @@ -132,6 +132,82 @@ | |||
170 | 132 | EXPECT_THAT(quirks.aligned_width(720), Eq(736)); | 132 | EXPECT_THAT(quirks.aligned_width(720), Eq(736)); |
171 | 133 | } | 133 | } |
172 | 134 | 134 | ||
173 | 135 | TEST(DeviceDetection, clears_gl_context_fence_on_manta) | ||
174 | 136 | { | ||
175 | 137 | using namespace testing; | ||
176 | 138 | char const default_str[] = ""; | ||
177 | 139 | char const mx4_name_str[] = "manta"; | ||
178 | 140 | |||
179 | 141 | MockOps mock_ops; | ||
180 | 142 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) | ||
181 | 143 | .Times(1) | ||
182 | 144 | .WillOnce(Invoke([&](char const*, char* value, char const*) | ||
183 | 145 | { | ||
184 | 146 | strncpy(value, mx4_name_str, PROP_VALUE_MAX); | ||
185 | 147 | return 0; | ||
186 | 148 | })); | ||
187 | 149 | |||
188 | 150 | mga::DeviceQuirks quirks(mock_ops); | ||
189 | 151 | EXPECT_TRUE(quirks.clear_fb_context_fence()); | ||
190 | 152 | } | ||
191 | 153 | |||
192 | 154 | TEST(DeviceDetection, clears_gl_context_fence_on_mx4) | ||
193 | 155 | { | ||
194 | 156 | using namespace testing; | ||
195 | 157 | char const default_str[] = ""; | ||
196 | 158 | char const mx4_name_str[] = "mx4"; | ||
197 | 159 | |||
198 | 160 | MockOps mock_ops; | ||
199 | 161 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) | ||
200 | 162 | .Times(1) | ||
201 | 163 | .WillOnce(Invoke([&](char const*, char* value, char const*) | ||
202 | 164 | { | ||
203 | 165 | strncpy(value, mx4_name_str, PROP_VALUE_MAX); | ||
204 | 166 | return 0; | ||
205 | 167 | })); | ||
206 | 168 | |||
207 | 169 | mga::DeviceQuirks quirks(mock_ops); | ||
208 | 170 | EXPECT_TRUE(quirks.clear_fb_context_fence()); | ||
209 | 171 | } | ||
210 | 172 | |||
211 | 173 | TEST(DeviceDetection, clears_gl_context_fence_on_krillin) | ||
212 | 174 | { | ||
213 | 175 | using namespace testing; | ||
214 | 176 | char const default_str[] = ""; | ||
215 | 177 | char const krillin_name_str[] = "krillin"; | ||
216 | 178 | |||
217 | 179 | MockOps mock_ops; | ||
218 | 180 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) | ||
219 | 181 | .Times(1) | ||
220 | 182 | .WillOnce(Invoke([&](char const*, char* value, char const*) | ||
221 | 183 | { | ||
222 | 184 | strncpy(value, krillin_name_str, PROP_VALUE_MAX); | ||
223 | 185 | return 0; | ||
224 | 186 | })); | ||
225 | 187 | |||
226 | 188 | mga::DeviceQuirks quirks(mock_ops); | ||
227 | 189 | EXPECT_TRUE(quirks.clear_fb_context_fence()); | ||
228 | 190 | } | ||
229 | 191 | |||
230 | 192 | TEST(DeviceDetection, does_not_clear_gl_context_fence_on_others) | ||
231 | 193 | { | ||
232 | 194 | using namespace testing; | ||
233 | 195 | char const default_str[] = ""; | ||
234 | 196 | char const mx4_name_str[] = "others"; | ||
235 | 197 | |||
236 | 198 | MockOps mock_ops; | ||
237 | 199 | EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str))) | ||
238 | 200 | .Times(1) | ||
239 | 201 | .WillOnce(Invoke([&](char const*, char* value, char const*) | ||
240 | 202 | { | ||
241 | 203 | strncpy(value, mx4_name_str, PROP_VALUE_MAX); | ||
242 | 204 | return 0; | ||
243 | 205 | })); | ||
244 | 206 | |||
245 | 207 | mga::DeviceQuirks quirks(mock_ops); | ||
246 | 208 | EXPECT_FALSE(quirks.clear_fb_context_fence()); | ||
247 | 209 | } | ||
248 | 210 | |||
249 | 135 | struct DeviceQuirks : testing::Test | 211 | struct DeviceQuirks : testing::Test |
250 | 136 | { | 212 | { |
251 | 137 | void SetUp() | 213 | void SetUp() |
252 | 138 | 214 | ||
253 | === modified file 'tests/unit-tests/graphics/android/test_server_interpreter.cpp' | |||
254 | --- tests/unit-tests/graphics/android/test_server_interpreter.cpp 2015-09-04 02:42:45 +0000 | |||
255 | +++ tests/unit-tests/graphics/android/test_server_interpreter.cpp 2015-11-30 18:34:59 +0000 | |||
256 | @@ -39,6 +39,26 @@ | |||
257 | 39 | 39 | ||
258 | 40 | namespace | 40 | namespace |
259 | 41 | { | 41 | { |
260 | 42 | //krillin and mx4 need to clear their fences before hwc commit. | ||
261 | 43 | struct StubPropertiesWrapper : mga::PropertiesWrapper | ||
262 | 44 | { | ||
263 | 45 | StubPropertiesWrapper(bool should_clear_fence) : | ||
264 | 46 | name(should_clear_fence ? "mx4" : "otherdevice") | ||
265 | 47 | { | ||
266 | 48 | } | ||
267 | 49 | |||
268 | 50 | int property_get(char const* key, char* value, char const* default_value) const override | ||
269 | 51 | { | ||
270 | 52 | if (strncmp(key, "ro.product.device", PROP_VALUE_MAX) == 0) | ||
271 | 53 | strncpy(value, name.c_str(), name.size()); | ||
272 | 54 | else | ||
273 | 55 | strncpy(value, default_value, PROP_VALUE_MAX); | ||
274 | 56 | return 0; | ||
275 | 57 | } | ||
276 | 58 | |||
277 | 59 | std::string name; | ||
278 | 60 | }; | ||
279 | 61 | |||
280 | 42 | struct ServerRenderWindow : public ::testing::Test | 62 | struct ServerRenderWindow : public ::testing::Test |
281 | 43 | { | 63 | { |
282 | 44 | std::shared_ptr<mtd::MockBuffer> mock_buffer{std::make_shared<testing::NiceMock<mtd::MockBuffer>>()}; | 64 | std::shared_ptr<mtd::MockBuffer> mock_buffer{std::make_shared<testing::NiceMock<mtd::MockBuffer>>()}; |
283 | @@ -47,7 +67,9 @@ | |||
284 | 47 | std::shared_ptr<mtd::MockFBBundle> mock_fb_bundle{ | 67 | std::shared_ptr<mtd::MockFBBundle> mock_fb_bundle{ |
285 | 48 | std::make_shared<testing::NiceMock<mtd::MockFBBundle>>()}; | 68 | std::make_shared<testing::NiceMock<mtd::MockFBBundle>>()}; |
286 | 49 | MirPixelFormat format{mir_pixel_format_abgr_8888}; | 69 | MirPixelFormat format{mir_pixel_format_abgr_8888}; |
288 | 50 | mga::ServerRenderWindow render_window{mock_fb_bundle, format, mock_cache}; | 70 | StubPropertiesWrapper wrapper{false}; |
289 | 71 | mga::DeviceQuirks quirks{wrapper}; | ||
290 | 72 | mga::ServerRenderWindow render_window{mock_fb_bundle, format, mock_cache, quirks}; | ||
291 | 51 | }; | 73 | }; |
292 | 52 | } | 74 | } |
293 | 53 | 75 | ||
294 | @@ -92,6 +114,34 @@ | |||
295 | 92 | Mock::VerifyAndClearExpectations(mock_fb_bundle.get()); | 114 | Mock::VerifyAndClearExpectations(mock_fb_bundle.get()); |
296 | 93 | } | 115 | } |
297 | 94 | 116 | ||
298 | 117 | TEST_F(ServerRenderWindow, clears_fence_when_quirk_present) | ||
299 | 118 | { | ||
300 | 119 | using namespace testing; | ||
301 | 120 | StubPropertiesWrapper wrapper{true}; | ||
302 | 121 | mga::DeviceQuirks quirks{wrapper}; | ||
303 | 122 | mga::ServerRenderWindow render_window{mock_fb_bundle, format, mock_cache, quirks}; | ||
304 | 123 | |||
305 | 124 | int fake_fence = 488; | ||
306 | 125 | auto stub_buffer = std::make_shared<mtd::StubAndroidNativeBuffer>(); | ||
307 | 126 | |||
308 | 127 | EXPECT_CALL(*mock_fb_bundle, buffer_for_render()) | ||
309 | 128 | .WillOnce(Return(mock_buffer)); | ||
310 | 129 | EXPECT_CALL(*mock_buffer, native_buffer_handle()) | ||
311 | 130 | .WillOnce(Return(stub_buffer)); | ||
312 | 131 | |||
313 | 132 | render_window.driver_requests_buffer(); | ||
314 | 133 | Mock::VerifyAndClearExpectations(mock_fb_bundle.get()); | ||
315 | 134 | |||
316 | 135 | std::shared_ptr<mg::Buffer> buf1 = mock_buffer; | ||
317 | 136 | EXPECT_CALL(*mock_cache, update_native_fence(stub_buffer->anwb(), fake_fence)) | ||
318 | 137 | .Times(0); | ||
319 | 138 | EXPECT_CALL(*mock_cache, retrieve_buffer(stub_buffer->anwb())) | ||
320 | 139 | .WillOnce(Return(mock_buffer)); | ||
321 | 140 | |||
322 | 141 | render_window.driver_returns_buffer(stub_buffer->anwb(), fake_fence); | ||
323 | 142 | Mock::VerifyAndClearExpectations(mock_fb_bundle.get()); | ||
324 | 143 | } | ||
325 | 144 | |||
326 | 95 | TEST_F(ServerRenderWindow, returns_format) | 145 | TEST_F(ServerRenderWindow, returns_format) |
327 | 96 | { | 146 | { |
328 | 97 | EXPECT_EQ(HAL_PIXEL_FORMAT_RGBA_8888, render_window.driver_requests_info(NATIVE_WINDOW_FORMAT)); | 147 | EXPECT_EQ(HAL_PIXEL_FORMAT_RGBA_8888, render_window.driver_requests_info(NATIVE_WINDOW_FORMAT)); |
FAILED: Continuous integration, rev:3126 jenkins. qa.ubuntu. com/job/ mir-ci/ 5657/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/5017 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/3923 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/4964/ console jenkins. qa.ubuntu. com/job/ mir-mediumtests -wily-touch/ 920/console jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1809 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1809/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 917 jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 917/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 4964 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 4964/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- touch/7506/ console s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 25470 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- wily-armhf/ 922/console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/5657/ rebuild
http://