Merge lp:~cemil-azizoglu/mir/more-accurate-probing into lp:mir
- more-accurate-probing
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Cemil Azizoglu |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3098 |
Proposed branch: | lp:~cemil-azizoglu/mir/more-accurate-probing |
Merge into: | lp:mir |
Diff against target: |
140 lines (+36/-11) 5 files modified
src/platforms/mesa/server/kms/platform_symbols.cpp (+21/-3) src/platforms/mesa/server/x11/graphics/graphics.cpp (+1/-1) tests/unit-tests/graphics/mesa/kms/test_platform.cpp (+2/-2) tests/unit-tests/graphics/mesa/x11/test_platform.cpp (+2/-2) tests/unit-tests/graphics/test_platform_prober.cpp (+10/-3) |
To merge this branch: | bzr merge lp:~cemil-azizoglu/mir/more-accurate-probing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Andreas Pokorny (community) | Approve | ||
Alan Griffiths | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Review via email: mp+276825@code.launchpad.net |
Commit message
Tighten probing rules
Description of the change
Tighten probing rules to better differentiate between mir-on-x and kms platforms by using the ability to become 'master'.
PS Jenkins bot (ps-jenkins) wrote : | # |
Alan Griffiths (alan-griffiths) wrote : | # |
I'm not convinced that checking explicitly for an option used by a different platform scales well.
I assume checking for options not recognized by /this/ platform would give false positives by detecting options used by downstreams (I'm looking at you U8) that don't use Mir's boost.Options support.
Could we instead add a bonus to our PlatformPriority score for seeing options we recognize? (So, in this case, mesa-kms would "win" if it sees --vt.)
Alexandros Frantzis (afrantzis) wrote : | # |
> I'm not convinced that checking explicitly for an option used by a different platform scales well.
...
> Could we instead add a bonus to our PlatformPriority score for seeing options we recognize? (So, in > this case, mesa-kms would "win" if it sees --vt.)
+1
Chris Halse Rogers (raof) wrote : | # |
Yeah, either give a boost for platforms that understand the option or have a filter at the platform load stage that only loads platforms that understand the options.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3095
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3096
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3096
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3097
http://
Executed test runs:
SUCCESS: http://
FAILURE: 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 : | # |
Needs Information: If the caller has insufficient rights, the call to drmSetMaster will fail.That way it would be a lot harder to lock yourself out when launching a mir_demo_server. Unless of course someone specifies the platform on command line and bypasses probing entirely.
If so I would move the drmMaster above the platform option check - or as proposed above change the early return into += x of the probing result.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3098
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
None: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
None: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3099
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:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
+ const char *argv[] = {"dummy", "--vt"};
+ options.
These are not needed for any of the existing tests and also skew the results since they include a platform specific argument.
TEST_F(
The test name is now misleading. This should be renamed to LoadsMesaPlatfo
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3100
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'src/platforms/mesa/server/kms/platform_symbols.cpp' | |||
2 | --- src/platforms/mesa/server/kms/platform_symbols.cpp 2015-11-04 07:43:28 +0000 | |||
3 | +++ src/platforms/mesa/server/kms/platform_symbols.cpp 2015-11-10 15:26:16 +0000 | |||
4 | @@ -164,15 +164,33 @@ | |||
5 | 164 | drm_devices.match_sysname("card[0-9]*"); | 164 | drm_devices.match_sysname("card[0-9]*"); |
6 | 165 | drm_devices.scan_devices(); | 165 | drm_devices.scan_devices(); |
7 | 166 | 166 | ||
8 | 167 | if (drm_devices.begin() == drm_devices.end()) | ||
9 | 168 | return mg::PlatformPriority::unsupported; | ||
10 | 169 | |||
11 | 170 | // Check for master | ||
12 | 171 | int tmp_fd = -1; | ||
13 | 167 | for (auto& device : drm_devices) | 172 | for (auto& device : drm_devices) |
14 | 168 | { | 173 | { |
17 | 169 | static_cast<void>(device); | 174 | tmp_fd = open(device.devnode(), O_RDWR | O_CLOEXEC); |
18 | 170 | if (platform_option_used) | 175 | if (tmp_fd >= 0) |
19 | 176 | break; | ||
20 | 177 | } | ||
21 | 178 | |||
22 | 179 | if (tmp_fd >= 0) | ||
23 | 180 | { | ||
24 | 181 | if (drmSetMaster(tmp_fd) >= 0) | ||
25 | 182 | { | ||
26 | 183 | drmDropMaster(tmp_fd); | ||
27 | 184 | drmClose(tmp_fd); | ||
28 | 171 | return mg::PlatformPriority::best; | 185 | return mg::PlatformPriority::best; |
29 | 186 | } | ||
30 | 172 | else | 187 | else |
32 | 173 | return mg::PlatformPriority::supported; | 188 | drmClose(tmp_fd); |
33 | 174 | } | 189 | } |
34 | 175 | 190 | ||
35 | 191 | if (platform_option_used) | ||
36 | 192 | return mg::PlatformPriority::best; | ||
37 | 193 | |||
38 | 176 | return mg::PlatformPriority::unsupported; | 194 | return mg::PlatformPriority::unsupported; |
39 | 177 | } | 195 | } |
40 | 178 | 196 | ||
41 | 179 | 197 | ||
42 | === modified file 'src/platforms/mesa/server/x11/graphics/graphics.cpp' | |||
43 | --- src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-11-04 07:43:28 +0000 | |||
44 | +++ src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-11-10 15:26:16 +0000 | |||
45 | @@ -86,7 +86,7 @@ | |||
46 | 86 | drm_devices.scan_devices(); | 86 | drm_devices.scan_devices(); |
47 | 87 | 87 | ||
48 | 88 | if (drm_devices.begin() != drm_devices.end()) | 88 | if (drm_devices.begin() != drm_devices.end()) |
50 | 89 | return mg::PlatformPriority::best; | 89 | return mg::PlatformPriority::supported; |
51 | 90 | } | 90 | } |
52 | 91 | return mg::PlatformPriority::unsupported; | 91 | return mg::PlatformPriority::unsupported; |
53 | 92 | } | 92 | } |
54 | 93 | 93 | ||
55 | === modified file 'tests/unit-tests/graphics/mesa/kms/test_platform.cpp' | |||
56 | --- tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-11-09 11:13:52 +0000 | |||
57 | +++ tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-11-10 15:26:16 +0000 | |||
58 | @@ -319,7 +319,7 @@ | |||
59 | 319 | EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options)); | 319 | EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options)); |
60 | 320 | } | 320 | } |
61 | 321 | 321 | ||
63 | 322 | TEST_F(MesaGraphicsPlatform, probe_returns_supported_when_drm_devices_exist) | 322 | TEST_F(MesaGraphicsPlatform, probe_returns_best_when_master) |
64 | 323 | { | 323 | { |
65 | 324 | mtf::UdevEnvironment udev_environment; | 324 | mtf::UdevEnvironment udev_environment; |
66 | 325 | boost::program_options::options_description po; | 325 | boost::program_options::options_description po; |
67 | @@ -329,7 +329,7 @@ | |||
68 | 329 | 329 | ||
69 | 330 | mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa-kms")}; | 330 | mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa-kms")}; |
70 | 331 | auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); | 331 | auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
72 | 332 | EXPECT_EQ(mg::PlatformPriority::supported, probe(options)); | 332 | EXPECT_EQ(mg::PlatformPriority::best, probe(options)); |
73 | 333 | } | 333 | } |
74 | 334 | 334 | ||
75 | 335 | TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_vt_option_exist) | 335 | TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_vt_option_exist) |
76 | 336 | 336 | ||
77 | === modified file 'tests/unit-tests/graphics/mesa/x11/test_platform.cpp' | |||
78 | --- tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-09-30 23:50:10 +0000 | |||
79 | +++ tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-11-10 15:26:16 +0000 | |||
80 | @@ -116,7 +116,7 @@ | |||
81 | 116 | EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options)); | 116 | EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options)); |
82 | 117 | } | 117 | } |
83 | 118 | 118 | ||
85 | 119 | TEST_F(X11GraphicsPlatformTest, probe_returns_best_when_drm_render_nodes_exist) | 119 | TEST_F(X11GraphicsPlatformTest, probe_returns_supported_when_drm_render_nodes_exist) |
86 | 120 | { | 120 | { |
87 | 121 | mtf::UdevEnvironment udev_environment; | 121 | mtf::UdevEnvironment udev_environment; |
88 | 122 | mir::options::ProgramOption options; | 122 | mir::options::ProgramOption options; |
89 | @@ -125,5 +125,5 @@ | |||
90 | 125 | 125 | ||
91 | 126 | mir::SharedLibrary platform_lib{mtf::server_platform("server-mesa-x11")}; | 126 | mir::SharedLibrary platform_lib{mtf::server_platform("server-mesa-x11")}; |
92 | 127 | auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); | 127 | auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform); |
94 | 128 | EXPECT_EQ(mg::PlatformPriority::best, probe(options)); | 128 | EXPECT_EQ(mg::PlatformPriority::supported, probe(options)); |
95 | 129 | } | 129 | } |
96 | 130 | 130 | ||
97 | === modified file 'tests/unit-tests/graphics/test_platform_prober.cpp' | |||
98 | --- tests/unit-tests/graphics/test_platform_prober.cpp 2015-09-30 19:34:21 +0000 | |||
99 | +++ tests/unit-tests/graphics/test_platform_prober.cpp 2015-11-10 15:26:16 +0000 | |||
100 | @@ -100,6 +100,13 @@ | |||
101 | 100 | return std::shared_ptr<void>{}; | 100 | return std::shared_ptr<void>{}; |
102 | 101 | #endif | 101 | #endif |
103 | 102 | } | 102 | } |
104 | 103 | |||
105 | 104 | class ServerPlatformProbeMockDRM : public ::testing::Test | ||
106 | 105 | { | ||
107 | 106 | public: | ||
108 | 107 | ::testing::NiceMock<mtd::MockDRM> mock_drm; | ||
109 | 108 | }; | ||
110 | 109 | |||
111 | 103 | } | 110 | } |
112 | 104 | 111 | ||
113 | 105 | TEST(ServerPlatformProbe, ConstructingWithNoModulesIsAnError) | 112 | TEST(ServerPlatformProbe, ConstructingWithNoModulesIsAnError) |
114 | @@ -112,7 +119,7 @@ | |||
115 | 112 | } | 119 | } |
116 | 113 | 120 | ||
117 | 114 | #ifdef MIR_BUILD_PLATFORM_MESA_KMS | 121 | #ifdef MIR_BUILD_PLATFORM_MESA_KMS |
119 | 115 | TEST(ServerPlatformProbe, LoadsMesaPlatformWhenDrmDevicePresent) | 122 | TEST_F(ServerPlatformProbeMockDRM, LoadsMesaPlatformWhenDrmMasterCanBeAcquired) |
120 | 116 | { | 123 | { |
121 | 117 | using namespace testing; | 124 | using namespace testing; |
122 | 118 | mir::options::ProgramOption options; | 125 | mir::options::ProgramOption options; |
123 | @@ -183,7 +190,7 @@ | |||
124 | 183 | } | 190 | } |
125 | 184 | 191 | ||
126 | 185 | #if defined(MIR_BUILD_PLATFORM_MESA_KMS) || defined(MIR_BUILD_PLATFORM_MESA_X11) || defined(MIR_BUILD_PLATFORM_ANDROID) | 192 | #if defined(MIR_BUILD_PLATFORM_MESA_KMS) || defined(MIR_BUILD_PLATFORM_MESA_X11) || defined(MIR_BUILD_PLATFORM_ANDROID) |
128 | 186 | TEST(ServerPlatformProbe, LoadsMesaOrAndroidInPreferenceToDummy) | 193 | TEST_F(ServerPlatformProbeMockDRM, LoadsMesaOrAndroidInPreferenceToDummy) |
129 | 187 | { | 194 | { |
130 | 188 | using namespace testing; | 195 | using namespace testing; |
131 | 189 | mir::options::ProgramOption options; | 196 | mir::options::ProgramOption options; |
132 | @@ -203,7 +210,7 @@ | |||
133 | 203 | } | 210 | } |
134 | 204 | #endif | 211 | #endif |
135 | 205 | 212 | ||
137 | 206 | TEST(ServerPlatformProbe, IgnoresNonPlatformModules) | 213 | TEST_F(ServerPlatformProbeMockDRM, IgnoresNonPlatformModules) |
138 | 207 | { | 214 | { |
139 | 208 | using namespace testing; | 215 | using namespace testing; |
140 | 209 | mir::options::ProgramOption options; | 216 | mir::options::ProgramOption options; |
PASSED: Continuous integration, rev:3092 jenkins. qa.ubuntu. com/job/ mir-ci/ 5516/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/4811 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/3718 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/4753 jenkins. qa.ubuntu. com/job/ mir-mediumtests -wily-touch/ 711/console jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1670 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 1670/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 711 jenkins. qa.ubuntu. com/job/ mir-wily- i386-ci/ 711/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 4754 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 4754/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- touch/7357 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 24949 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- wily-armhf/ 712/console
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: s-jenkins. ubuntu- ci:8080/ job/mir- ci/5516/ rebuild
http://