Mir

Merge lp:~mir-team/mir/0.18.2 into lp:mir/0.18

Proposed by Kevin DuBois
Status: Rejected
Rejected by: Kevin DuBois
Proposed branch: lp:~mir-team/mir/0.18.2
Merge into: lp:mir/0.18
Diff against target: 277 lines (+122/-14)
6 files modified
debian/changelog (+15/-1)
src/platforms/android/server/android_alloc_adaptor.cpp (+1/-1)
src/platforms/android/server/device_quirks.cpp (+24/-4)
src/platforms/android/server/device_quirks.h (+2/-0)
tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp (+32/-7)
tests/unit-tests/graphics/android/test_device_detection.cpp (+48/-1)
To merge this branch: bzr merge lp:~mir-team/mir/0.18.2
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Disapprove
Daniel van Vugt Needs Information
Review via email: mp+283955@code.launchpad.net

Commit message

MP for Temporary silo to address lp: #1517205 and to provide additional quirk.

Description of the change

MP for Temporary silo to address lp: #1517205 and to provide additional quirk.

To post a comment you must log in.
lp:~mir-team/mir/0.18.2 updated
3194. By Kevin DuBois

 port over quirk bits

3195. By Kevin DuBois

capture 0.18.1 release sig

3196. By Kevin DuBois

update the changelog appropriately

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The target branch contains additional fixes already that you haven't mentioned in the changelog. See: https://bugs.launchpad.net/mir/+milestone/0.18.2

review: Needs Fixing
lp:~mir-team/mir/0.18.2 updated
3197. By Daniel van Vugt

debian/changelog: Mention other fixes already landed.

3198. By Daniel van Vugt

Remove questionmark

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed the changelog. But is that right? Are you really fixing bug 1517205 with this?

review: Needs Information
Revision history for this message
Kevin DuBois (kdub) wrote :

@Daniel, walked back some of the changes yesterday and didn't get a chance to update this MP.

More likely than not, there won't be a 0.18.2, as 0.19.0 will contain what is needed by PES. This was set up as a contingency release in case 0.19.0 got blocked.

I'll self-disapprove for now before taking this down when 0.19 is released.

review: Disapprove

Unmerged revisions

3198. By Daniel van Vugt

Remove questionmark

3197. By Daniel van Vugt

debian/changelog: Mention other fixes already landed.

3196. By Kevin DuBois

update the changelog appropriately

3195. By Kevin DuBois

capture 0.18.1 release sig

3194. By Kevin DuBois

 port over quirk bits

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-01-18 18:06:23 +0000
3+++ debian/changelog 2016-01-28 09:56:28 +0000
4@@ -1,4 +1,18 @@
5-mir (0.18.1-0ubuntu1) UNRELEASED; urgency=medium
6+mir (0.18.2-0ubuntu1) UNRELEASED; urgency=medium
7+
8+ * New upstream release 0.18.2 (https://launchpad.net/mir/+milestone/0.18.2)
9+ - No ABI changes. Bug fix release only.
10+ - Bugs fixed:
11+ . Fix buffer leak causing server crashes after repeated screencasts.
12+ (LP: #1523900)
13+ . Fix Mir failing to start some servers: Avoid choosing graphics-dummy
14+ (or no driver at all) over mesa-kms on a desktop with DRM/Intel
15+ graphics. (LP: #1528082)
16+ . Add quirk for device that cannot allocate fb buffers. (LP: #1517205)
17+
18+ -- Kevin DuBois <kevin.dubois@canonical.com> Wed, 27 Jan 2016 09:36:46 -0500
19+
20+mir (0.18.1+16.04.20160115-0ubuntu1) xenial; urgency=medium
21
22 * New upstream release 0.18.1 (https://launchpad.net/mir/+milestone/0.18.1)
23 - No ABI changes. Bug fix release only.
24
25=== modified file 'src/platforms/android/server/android_alloc_adaptor.cpp'
26--- src/platforms/android/server/android_alloc_adaptor.cpp 2015-12-11 12:22:15 +0000
27+++ src/platforms/android/server/android_alloc_adaptor.cpp 2016-01-28 09:56:28 +0000
28@@ -104,7 +104,7 @@
29 case mga::BufferUsage::use_hardware:
30 return (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER);
31 case mga::BufferUsage::use_framebuffer_gles:
32- return (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB);
33+ return quirks->fb_gralloc_bits();
34 case mga::BufferUsage::use_software:
35 return (GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE);
36 default:
37
38=== modified file 'src/platforms/android/server/device_quirks.cpp'
39--- src/platforms/android/server/device_quirks.cpp 2015-11-30 18:29:57 +0000
40+++ src/platforms/android/server/device_quirks.cpp 2016-01-28 09:56:28 +0000
41@@ -17,6 +17,7 @@
42 */
43
44 #include "device_quirks.h"
45+#include "hardware/gralloc.h"
46
47 #include <mir/options/option.h>
48 #include <boost/program_options/options_description.hpp>
49@@ -37,7 +38,7 @@
50 char const* const num_framebuffers_opt = "enable-num-framebuffers-quirk";
51 char const* const gralloc_cannot_be_closed_safely_opt = "enable-gralloc-cannot-be-closed-safely-quirk";
52 char const* const width_alignment_opt = "enable-width-alignment-quirk";
53-
54+char const* const fb_ion_heap_opt = "fb-ion-heap";
55 std::string determine_device_name(mga::PropertiesWrapper const& properties)
56 {
57 char const default_value[] = "";
58@@ -60,6 +61,11 @@
59 return quirk_enabled && device_name == "krillin";
60 }
61
62+bool device_has_fb_ion_heap(std::string const& device_name, bool quirk_enabled)
63+{
64+ return quirk_enabled && (device_name != "Aquaris_M10_FHD");
65+}
66+
67 bool clear_fb_context_fence_for(std::string const& device_name)
68 {
69 return device_name == "krillin" || device_name == "mx4" || device_name == "manta";
70@@ -72,7 +78,8 @@
71 num_framebuffers_(num_framebuffers_for(device_name, true)),
72 gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)),
73 enable_width_alignment_quirk{true},
74- clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}
75+ clear_fb_context_fence_{clear_fb_context_fence_for(device_name)},
76+ fb_ion_heap_{device_has_fb_ion_heap(device_name, true)}
77 {
78 }
79
80@@ -81,7 +88,8 @@
81 num_framebuffers_(num_framebuffers_for(device_name, options.get(num_framebuffers_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))),
83 enable_width_alignment_quirk(options.get(width_alignment_opt, true)),
84- clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}
85+ clear_fb_context_fence_{clear_fb_context_fence_for(device_name)},
86+ fb_ion_heap_{device_has_fb_ion_heap(device_name, options.get(fb_ion_heap_opt, true))}
87 {
88 }
89
90@@ -107,6 +115,14 @@
91 return clear_fb_context_fence_;
92 }
93
94+int mga::DeviceQuirks::fb_gralloc_bits() const
95+{
96+ if (fb_ion_heap_)
97+ return GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB;
98+
99+ return GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE;
100+}
101+
102 void mga::DeviceQuirks::add_options(boost::program_options::options_description& config)
103 {
104 config.add_options()
105@@ -118,5 +134,9 @@
106 "[platform-specific] Only close gralloc if it is safe to do so (krillin quirk) [{true,false}]")
107 (width_alignment_opt,
108 boost::program_options::value<bool>()->default_value(true),
109- "[platform-specific] Enable width alignment (vegetahd quirk) [{true,false}]");
110+ "[platform-specific] Enable width alignment (vegetahd quirk) [{true,false}]")
111+ (fb_ion_heap_opt,
112+ boost::program_options::value<bool>()->default_value(true),
113+ "[platform-specific] device has ion heap for framebuffer allocation available [{true, false}]");
114+
115 }
116
117=== modified file 'src/platforms/android/server/device_quirks.h'
118--- src/platforms/android/server/device_quirks.h 2015-11-30 12:36:04 +0000
119+++ src/platforms/android/server/device_quirks.h 2016-01-28 09:56:28 +0000
120@@ -64,6 +64,7 @@
121 bool gralloc_cannot_be_closed_safely() const;
122 int aligned_width(int width) const;
123 bool clear_fb_context_fence() const;
124+ int fb_gralloc_bits() const;
125
126 static void add_options(boost::program_options::options_description& config);
127
128@@ -75,6 +76,7 @@
129 bool const gralloc_cannot_be_closed_safely_;
130 bool const enable_width_alignment_quirk;
131 bool const clear_fb_context_fence_;
132+ bool const fb_ion_heap_;
133 };
134 }
135 }
136
137=== modified file 'tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp'
138--- tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2015-12-11 12:22:15 +0000
139+++ tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2016-01-28 09:56:28 +0000
140@@ -18,6 +18,7 @@
141
142 #include "src/platforms/android/server/android_alloc_adaptor.h"
143 #include "src/platforms/android/server/device_quirks.h"
144+#include "mir/options/program_option.h"
145 #include "mir/graphics/android/native_buffer.h"
146
147 #include "mir/test/doubles/mock_android_alloc_device.h"
148@@ -37,10 +38,8 @@
149 {
150 public:
151 AdaptorICSTest()
152- : fb_usage_flags(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB),
153- hw_usage_flags(GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER),
154- sw_usage_flags(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE)
155- {}
156+ {
157+ }
158
159 virtual void SetUp()
160 {
161@@ -61,9 +60,15 @@
162 MirPixelFormat pf;
163 geom::Size size;
164 mga::BufferUsage usage;
165- int const fb_usage_flags;
166- int const hw_usage_flags;
167- int const sw_usage_flags;
168+ int const fb_usage_flags
169+ {GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB};
170+ int const fb_usage_flags_broken_device
171+ {GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE};
172+ int const hw_usage_flags
173+ {GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER};
174+ int const sw_usage_flags
175+ {GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN |
176+ GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE};
177 };
178
179 TEST_F(AdaptorICSTest, resource_type_test_fail_ret)
180@@ -181,6 +186,26 @@
181 alloc_adaptor->alloc_buffer(size, pf, mga::BufferUsage::use_framebuffer_gles);
182 }
183
184+TEST_F(AdaptorICSTest, adaptor_gralloc_usage_conversion_fb_gles_with_quirk)
185+{
186+ using namespace testing;
187+
188+ mir::options::ProgramOption options;
189+
190+ boost::program_options::options_description description;
191+ description.add_options()("fb-ion-heap", boost::program_options::value<bool>()->default_value(true), "");
192+ std::array<char const*, 3> args { "progname", "--fb-ion-heap", "false"};
193+ options.parse_arguments(description, args.size(), args.data());
194+ auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}, options);
195+
196+ alloc_adaptor = std::make_shared<mga::AndroidAllocAdaptor>(mock_alloc_device, quirks);
197+
198+ EXPECT_CALL(*mock_alloc_device, alloc_interface(_,_,_,_,fb_usage_flags_broken_device,_,_));
199+ EXPECT_CALL(*mock_alloc_device, free_interface(_,_));
200+
201+ alloc_adaptor->alloc_buffer(size, pf, mga::BufferUsage::use_framebuffer_gles);
202+}
203+
204 TEST_F(AdaptorICSTest, handle_size_is_correct)
205 {
206 auto native_handle = alloc_adaptor->alloc_buffer(size, pf, usage);
207
208=== modified file 'tests/unit-tests/graphics/android/test_device_detection.cpp'
209--- tests/unit-tests/graphics/android/test_device_detection.cpp 2015-11-30 18:28:36 +0000
210+++ tests/unit-tests/graphics/android/test_device_detection.cpp 2016-01-28 09:56:28 +0000
211@@ -18,7 +18,7 @@
212
213 #include "src/platforms/android/server/device_quirks.h"
214 #include "mir/options/program_option.h"
215-
216+#include <hardware/gralloc.h>
217 #include <gmock/gmock.h>
218 #include <gtest/gtest.h>
219
220@@ -215,6 +215,16 @@
221 mga::DeviceQuirks::add_options(desc);
222 }
223
224+ void enable_fb_ion_quirk()
225+ {
226+ int const argc = 2;
227+ char const* argv[argc] = {
228+ __PRETTY_FUNCTION__,
229+ "--fb-ion-heap=false"
230+ };
231+
232+ options.parse_arguments(desc, argc, argv);
233+ }
234 void disable_num_framebuffers_quirk()
235 {
236 int const argc = 2;
237@@ -312,3 +322,40 @@
238 mga::DeviceQuirks quirks(mock_ops, options);
239 EXPECT_THAT(quirks.aligned_width(720), Eq(720));
240 }
241+
242+TEST_F(DeviceQuirks, returns_correct_gralloc_bits_with_fb_ion_quirk_for_device)
243+{
244+ using namespace testing;
245+ char const default_str[] = "";
246+ char const name_str[] = "Aquaris_M10_FHD";
247+ MockOps mock_ops;
248+ EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str)))
249+ .Times(1)
250+ .WillOnce(Invoke([&](char const*, char* value, char const*)
251+ {
252+ strncpy(value, name_str, PROP_VALUE_MAX);
253+ return 0;
254+ }));
255+
256+ mga::DeviceQuirks quirks(mock_ops, options);
257+ EXPECT_THAT(quirks.fb_gralloc_bits(),
258+ testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE));
259+}
260+
261+TEST_F(DeviceQuirks, returns_correct_gralloc_bits_without_fb_ion_quirk)
262+{
263+ MockOps mock_ops;
264+ mga::DeviceQuirks quirks(mock_ops, options);
265+ EXPECT_THAT(quirks.fb_gralloc_bits(),
266+ testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB));
267+}
268+
269+TEST_F(DeviceQuirks, returns_correct_gralloc_bits_with_fb_ion_quirk)
270+{
271+ using namespace testing;
272+ MockOps mock_ops;
273+ enable_fb_ion_quirk();
274+ mga::DeviceQuirks quirks(mock_ops, options);
275+ EXPECT_THAT(quirks.fb_gralloc_bits(),
276+ testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE));
277+}

Subscribers

People subscribed via source and target branches

to all changes: