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
=== modified file 'debian/changelog'
--- debian/changelog 2016-01-18 18:06:23 +0000
+++ debian/changelog 2016-01-28 09:56:28 +0000
@@ -1,4 +1,18 @@
1mir (0.18.1-0ubuntu1) UNRELEASED; urgency=medium1mir (0.18.2-0ubuntu1) UNRELEASED; urgency=medium
2
3 * New upstream release 0.18.2 (https://launchpad.net/mir/+milestone/0.18.2)
4 - No ABI changes. Bug fix release only.
5 - Bugs fixed:
6 . Fix buffer leak causing server crashes after repeated screencasts.
7 (LP: #1523900)
8 . Fix Mir failing to start some servers: Avoid choosing graphics-dummy
9 (or no driver at all) over mesa-kms on a desktop with DRM/Intel
10 graphics. (LP: #1528082)
11 . Add quirk for device that cannot allocate fb buffers. (LP: #1517205)
12
13 -- Kevin DuBois <kevin.dubois@canonical.com> Wed, 27 Jan 2016 09:36:46 -0500
14
15mir (0.18.1+16.04.20160115-0ubuntu1) xenial; urgency=medium
216
3 * New upstream release 0.18.1 (https://launchpad.net/mir/+milestone/0.18.1)17 * New upstream release 0.18.1 (https://launchpad.net/mir/+milestone/0.18.1)
4 - No ABI changes. Bug fix release only.18 - No ABI changes. Bug fix release only.
519
=== modified file 'src/platforms/android/server/android_alloc_adaptor.cpp'
--- src/platforms/android/server/android_alloc_adaptor.cpp 2015-12-11 12:22:15 +0000
+++ src/platforms/android/server/android_alloc_adaptor.cpp 2016-01-28 09:56:28 +0000
@@ -104,7 +104,7 @@
104 case mga::BufferUsage::use_hardware:104 case mga::BufferUsage::use_hardware:
105 return (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER);105 return (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER);
106 case mga::BufferUsage::use_framebuffer_gles:106 case mga::BufferUsage::use_framebuffer_gles:
107 return (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB);107 return quirks->fb_gralloc_bits();
108 case mga::BufferUsage::use_software:108 case mga::BufferUsage::use_software:
109 return (GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE);109 return (GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE);
110 default:110 default:
111111
=== modified file 'src/platforms/android/server/device_quirks.cpp'
--- src/platforms/android/server/device_quirks.cpp 2015-11-30 18:29:57 +0000
+++ src/platforms/android/server/device_quirks.cpp 2016-01-28 09:56:28 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include "device_quirks.h"19#include "device_quirks.h"
20#include "hardware/gralloc.h"
2021
21#include <mir/options/option.h>22#include <mir/options/option.h>
22#include <boost/program_options/options_description.hpp>23#include <boost/program_options/options_description.hpp>
@@ -37,7 +38,7 @@
37char const* const num_framebuffers_opt = "enable-num-framebuffers-quirk";38char const* const num_framebuffers_opt = "enable-num-framebuffers-quirk";
38char const* const gralloc_cannot_be_closed_safely_opt = "enable-gralloc-cannot-be-closed-safely-quirk";39char const* const gralloc_cannot_be_closed_safely_opt = "enable-gralloc-cannot-be-closed-safely-quirk";
39char const* const width_alignment_opt = "enable-width-alignment-quirk";40char const* const width_alignment_opt = "enable-width-alignment-quirk";
4041char const* const fb_ion_heap_opt = "fb-ion-heap";
41std::string determine_device_name(mga::PropertiesWrapper const& properties)42std::string determine_device_name(mga::PropertiesWrapper const& properties)
42{43{
43 char const default_value[] = "";44 char const default_value[] = "";
@@ -60,6 +61,11 @@
60 return quirk_enabled && device_name == "krillin";61 return quirk_enabled && device_name == "krillin";
61}62}
6263
64bool device_has_fb_ion_heap(std::string const& device_name, bool quirk_enabled)
65{
66 return quirk_enabled && (device_name != "Aquaris_M10_FHD");
67}
68
63bool clear_fb_context_fence_for(std::string const& device_name)69bool clear_fb_context_fence_for(std::string const& device_name)
64{70{
65 return device_name == "krillin" || device_name == "mx4" || device_name == "manta";71 return device_name == "krillin" || device_name == "mx4" || device_name == "manta";
@@ -72,7 +78,8 @@
72 num_framebuffers_(num_framebuffers_for(device_name, true)),78 num_framebuffers_(num_framebuffers_for(device_name, true)),
73 gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)),79 gralloc_cannot_be_closed_safely_(gralloc_cannot_be_closed_safely_for(device_name, true)),
74 enable_width_alignment_quirk{true},80 enable_width_alignment_quirk{true},
75 clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}81 clear_fb_context_fence_{clear_fb_context_fence_for(device_name)},
82 fb_ion_heap_{device_has_fb_ion_heap(device_name, true)}
76{83{
77}84}
7885
@@ -81,7 +88,8 @@
81 num_framebuffers_(num_framebuffers_for(device_name, options.get(num_framebuffers_opt, true))),88 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))),89 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)),90 enable_width_alignment_quirk(options.get(width_alignment_opt, true)),
84 clear_fb_context_fence_{clear_fb_context_fence_for(device_name)}91 clear_fb_context_fence_{clear_fb_context_fence_for(device_name)},
92 fb_ion_heap_{device_has_fb_ion_heap(device_name, options.get(fb_ion_heap_opt, true))}
85{93{
86}94}
8795
@@ -107,6 +115,14 @@
107 return clear_fb_context_fence_;115 return clear_fb_context_fence_;
108}116}
109117
118int mga::DeviceQuirks::fb_gralloc_bits() const
119{
120 if (fb_ion_heap_)
121 return GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB;
122
123 return GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE;
124}
125
110void mga::DeviceQuirks::add_options(boost::program_options::options_description& config)126void mga::DeviceQuirks::add_options(boost::program_options::options_description& config)
111{127{
112 config.add_options()128 config.add_options()
@@ -118,5 +134,9 @@
118 "[platform-specific] Only close gralloc if it is safe to do so (krillin quirk) [{true,false}]")134 "[platform-specific] Only close gralloc if it is safe to do so (krillin quirk) [{true,false}]")
119 (width_alignment_opt,135 (width_alignment_opt,
120 boost::program_options::value<bool>()->default_value(true),136 boost::program_options::value<bool>()->default_value(true),
121 "[platform-specific] Enable width alignment (vegetahd quirk) [{true,false}]");137 "[platform-specific] Enable width alignment (vegetahd quirk) [{true,false}]")
138 (fb_ion_heap_opt,
139 boost::program_options::value<bool>()->default_value(true),
140 "[platform-specific] device has ion heap for framebuffer allocation available [{true, false}]");
141
122}142}
123143
=== modified file 'src/platforms/android/server/device_quirks.h'
--- src/platforms/android/server/device_quirks.h 2015-11-30 12:36:04 +0000
+++ src/platforms/android/server/device_quirks.h 2016-01-28 09:56:28 +0000
@@ -64,6 +64,7 @@
64 bool gralloc_cannot_be_closed_safely() const;64 bool gralloc_cannot_be_closed_safely() const;
65 int aligned_width(int width) const;65 int aligned_width(int width) const;
66 bool clear_fb_context_fence() const;66 bool clear_fb_context_fence() const;
67 int fb_gralloc_bits() const;
6768
68 static void add_options(boost::program_options::options_description& config);69 static void add_options(boost::program_options::options_description& config);
6970
@@ -75,6 +76,7 @@
75 bool const gralloc_cannot_be_closed_safely_;76 bool const gralloc_cannot_be_closed_safely_;
76 bool const enable_width_alignment_quirk;77 bool const enable_width_alignment_quirk;
77 bool const clear_fb_context_fence_;78 bool const clear_fb_context_fence_;
79 bool const fb_ion_heap_;
78};80};
79}81}
80}82}
8183
=== modified file 'tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp'
--- tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2015-12-11 12:22:15 +0000
+++ tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2016-01-28 09:56:28 +0000
@@ -18,6 +18,7 @@
1818
19#include "src/platforms/android/server/android_alloc_adaptor.h"19#include "src/platforms/android/server/android_alloc_adaptor.h"
20#include "src/platforms/android/server/device_quirks.h"20#include "src/platforms/android/server/device_quirks.h"
21#include "mir/options/program_option.h"
21#include "mir/graphics/android/native_buffer.h"22#include "mir/graphics/android/native_buffer.h"
2223
23#include "mir/test/doubles/mock_android_alloc_device.h"24#include "mir/test/doubles/mock_android_alloc_device.h"
@@ -37,10 +38,8 @@
37{38{
38public:39public:
39 AdaptorICSTest()40 AdaptorICSTest()
40 : fb_usage_flags(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB),41 {
41 hw_usage_flags(GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER),42 }
42 sw_usage_flags(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE)
43 {}
4443
45 virtual void SetUp()44 virtual void SetUp()
46 {45 {
@@ -61,9 +60,15 @@
61 MirPixelFormat pf;60 MirPixelFormat pf;
62 geom::Size size;61 geom::Size size;
63 mga::BufferUsage usage;62 mga::BufferUsage usage;
64 int const fb_usage_flags;63 int const fb_usage_flags
65 int const hw_usage_flags;64 {GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB};
66 int const sw_usage_flags;65 int const fb_usage_flags_broken_device
66 {GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE};
67 int const hw_usage_flags
68 {GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER};
69 int const sw_usage_flags
70 {GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN |
71 GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE};
67};72};
6873
69TEST_F(AdaptorICSTest, resource_type_test_fail_ret)74TEST_F(AdaptorICSTest, resource_type_test_fail_ret)
@@ -181,6 +186,26 @@
181 alloc_adaptor->alloc_buffer(size, pf, mga::BufferUsage::use_framebuffer_gles);186 alloc_adaptor->alloc_buffer(size, pf, mga::BufferUsage::use_framebuffer_gles);
182}187}
183188
189TEST_F(AdaptorICSTest, adaptor_gralloc_usage_conversion_fb_gles_with_quirk)
190{
191 using namespace testing;
192
193 mir::options::ProgramOption options;
194
195 boost::program_options::options_description description;
196 description.add_options()("fb-ion-heap", boost::program_options::value<bool>()->default_value(true), "");
197 std::array<char const*, 3> args { "progname", "--fb-ion-heap", "false"};
198 options.parse_arguments(description, args.size(), args.data());
199 auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}, options);
200
201 alloc_adaptor = std::make_shared<mga::AndroidAllocAdaptor>(mock_alloc_device, quirks);
202
203 EXPECT_CALL(*mock_alloc_device, alloc_interface(_,_,_,_,fb_usage_flags_broken_device,_,_));
204 EXPECT_CALL(*mock_alloc_device, free_interface(_,_));
205
206 alloc_adaptor->alloc_buffer(size, pf, mga::BufferUsage::use_framebuffer_gles);
207}
208
184TEST_F(AdaptorICSTest, handle_size_is_correct)209TEST_F(AdaptorICSTest, handle_size_is_correct)
185{210{
186 auto native_handle = alloc_adaptor->alloc_buffer(size, pf, usage);211 auto native_handle = alloc_adaptor->alloc_buffer(size, pf, usage);
187212
=== modified file 'tests/unit-tests/graphics/android/test_device_detection.cpp'
--- tests/unit-tests/graphics/android/test_device_detection.cpp 2015-11-30 18:28:36 +0000
+++ tests/unit-tests/graphics/android/test_device_detection.cpp 2016-01-28 09:56:28 +0000
@@ -18,7 +18,7 @@
1818
19#include "src/platforms/android/server/device_quirks.h"19#include "src/platforms/android/server/device_quirks.h"
20#include "mir/options/program_option.h"20#include "mir/options/program_option.h"
2121#include <hardware/gralloc.h>
22#include <gmock/gmock.h>22#include <gmock/gmock.h>
23#include <gtest/gtest.h>23#include <gtest/gtest.h>
2424
@@ -215,6 +215,16 @@
215 mga::DeviceQuirks::add_options(desc);215 mga::DeviceQuirks::add_options(desc);
216 }216 }
217217
218 void enable_fb_ion_quirk()
219 {
220 int const argc = 2;
221 char const* argv[argc] = {
222 __PRETTY_FUNCTION__,
223 "--fb-ion-heap=false"
224 };
225
226 options.parse_arguments(desc, argc, argv);
227 }
218 void disable_num_framebuffers_quirk()228 void disable_num_framebuffers_quirk()
219 {229 {
220 int const argc = 2;230 int const argc = 2;
@@ -312,3 +322,40 @@
312 mga::DeviceQuirks quirks(mock_ops, options);322 mga::DeviceQuirks quirks(mock_ops, options);
313 EXPECT_THAT(quirks.aligned_width(720), Eq(720));323 EXPECT_THAT(quirks.aligned_width(720), Eq(720));
314}324}
325
326TEST_F(DeviceQuirks, returns_correct_gralloc_bits_with_fb_ion_quirk_for_device)
327{
328 using namespace testing;
329 char const default_str[] = "";
330 char const name_str[] = "Aquaris_M10_FHD";
331 MockOps mock_ops;
332 EXPECT_CALL(mock_ops, property_get(StrEq("ro.product.device"), _, StrEq(default_str)))
333 .Times(1)
334 .WillOnce(Invoke([&](char const*, char* value, char const*)
335 {
336 strncpy(value, name_str, PROP_VALUE_MAX);
337 return 0;
338 }));
339
340 mga::DeviceQuirks quirks(mock_ops, options);
341 EXPECT_THAT(quirks.fb_gralloc_bits(),
342 testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE));
343}
344
345TEST_F(DeviceQuirks, returns_correct_gralloc_bits_without_fb_ion_quirk)
346{
347 MockOps mock_ops;
348 mga::DeviceQuirks quirks(mock_ops, options);
349 EXPECT_THAT(quirks.fb_gralloc_bits(),
350 testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_FB));
351}
352
353TEST_F(DeviceQuirks, returns_correct_gralloc_bits_with_fb_ion_quirk)
354{
355 using namespace testing;
356 MockOps mock_ops;
357 enable_fb_ion_quirk();
358 mga::DeviceQuirks quirks(mock_ops, options);
359 EXPECT_THAT(quirks.fb_gralloc_bits(),
360 testing::Eq(GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_TEXTURE));
361}

Subscribers

People subscribed via source and target branches

to all changes: