Mir

Merge lp:~mir-team/mir/revert-3098 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3198
Proposed branch: lp:~mir-team/mir/revert-3098
Merge into: lp:mir
Diff against target: 126 lines (+11/-29)
5 files modified
src/platforms/mesa/server/kms/platform_symbols.cpp (+3/-21)
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 (+3/-3)
To merge this branch: bzr merge lp:~mir-team/mir/revert-3098
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Approve
Cemil Azizoglu (community) Needs Information
Review via email: mp+280635@code.launchpad.net

Commit message

Reverting rev 3098 (the fix for LP: #1506707) in order to fix four regressions that it caused:
  LP: #1526225, LP: #1526505, LP: #1515558 and LP: #1526209.

Seems the medicine was worse than the disease in this case. (U8 xenial desktop session would fail to find its platform, a worse problem then LP: #1506707)

Description of the change

.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

From the discussion on the IRC, I don't believe probing logic is the problem, but care has to be taken when launching the nested server due to the known problem lp:1515558 ('--vt' switch needs to be used, if mesa-kms is desired).

In my local experiments on xenial desktop, with the '--vt' switch, everything works as expected. I suspect the crash seen in lp:1526209 may be due to something else. More investigation is needed.

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

Looks like the right revert.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/platforms/mesa/server/kms/platform_symbols.cpp'
--- src/platforms/mesa/server/kms/platform_symbols.cpp 2015-11-25 20:26:59 +0000
+++ src/platforms/mesa/server/kms/platform_symbols.cpp 2015-12-15 20:16:27 +0000
@@ -156,33 +156,15 @@
156 drm_devices.match_sysname("card[0-9]*");156 drm_devices.match_sysname("card[0-9]*");
157 drm_devices.scan_devices();157 drm_devices.scan_devices();
158158
159 if (drm_devices.begin() == drm_devices.end())
160 return mg::PlatformPriority::unsupported;
161
162 // Check for master
163 int tmp_fd = -1;
164 for (auto& device : drm_devices)159 for (auto& device : drm_devices)
165 {160 {
166 tmp_fd = open(device.devnode(), O_RDWR | O_CLOEXEC);161 static_cast<void>(device);
167 if (tmp_fd >= 0)162 if (platform_option_used)
168 break;
169 }
170
171 if (tmp_fd >= 0)
172 {
173 if (drmSetMaster(tmp_fd) >= 0)
174 {
175 drmDropMaster(tmp_fd);
176 drmClose(tmp_fd);
177 return mg::PlatformPriority::best;163 return mg::PlatformPriority::best;
178 }
179 else164 else
180 drmClose(tmp_fd);165 return mg::PlatformPriority::supported;
181 }166 }
182167
183 if (platform_option_used)
184 return mg::PlatformPriority::best;
185
186 return mg::PlatformPriority::unsupported;168 return mg::PlatformPriority::unsupported;
187}169}
188170
189171
=== modified file 'src/platforms/mesa/server/x11/graphics/graphics.cpp'
--- src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-11-12 14:21:39 +0000
+++ src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-12-15 20:16:27 +0000
@@ -91,7 +91,7 @@
91 drm_devices.scan_devices();91 drm_devices.scan_devices();
9292
93 if (drm_devices.begin() != drm_devices.end())93 if (drm_devices.begin() != drm_devices.end())
94 return mg::PlatformPriority::supported;94 return mg::PlatformPriority::best;
95 }95 }
96 return mg::PlatformPriority::unsupported;96 return mg::PlatformPriority::unsupported;
97}97}
9898
=== modified file 'tests/unit-tests/graphics/mesa/kms/test_platform.cpp'
--- tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-11-10 23:10:22 +0000
+++ tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-12-15 20:16:27 +0000
@@ -319,7 +319,7 @@
319 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));319 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));
320}320}
321321
322TEST_F(MesaGraphicsPlatform, probe_returns_best_when_master)322TEST_F(MesaGraphicsPlatform, probe_returns_supported_when_drm_devices_exist)
323{323{
324 mtf::UdevEnvironment udev_environment;324 mtf::UdevEnvironment udev_environment;
325 boost::program_options::options_description po;325 boost::program_options::options_description po;
@@ -329,7 +329,7 @@
329329
330 mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa-kms")};330 mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa-kms")};
331 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);331 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
332 EXPECT_EQ(mg::PlatformPriority::best, probe(options));332 EXPECT_EQ(mg::PlatformPriority::supported, probe(options));
333}333}
334334
335TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_vt_option_exist)335TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_vt_option_exist)
336336
=== modified file 'tests/unit-tests/graphics/mesa/x11/test_platform.cpp'
--- tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-11-06 20:02:49 +0000
+++ tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-12-15 20:16:27 +0000
@@ -116,7 +116,7 @@
116 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));116 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));
117}117}
118118
119TEST_F(X11GraphicsPlatformTest, probe_returns_supported_when_drm_render_nodes_exist)119TEST_F(X11GraphicsPlatformTest, probe_returns_best_when_drm_render_nodes_exist)
120{120{
121 mtf::UdevEnvironment udev_environment;121 mtf::UdevEnvironment udev_environment;
122 mir::options::ProgramOption options;122 mir::options::ProgramOption options;
@@ -125,5 +125,5 @@
125125
126 mir::SharedLibrary platform_lib{mtf::server_platform("server-mesa-x11")};126 mir::SharedLibrary platform_lib{mtf::server_platform("server-mesa-x11")};
127 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);127 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
128 EXPECT_EQ(mg::PlatformPriority::supported, probe(options));128 EXPECT_EQ(mg::PlatformPriority::best, probe(options));
129}129}
130130
=== modified file 'tests/unit-tests/graphics/test_platform_prober.cpp'
--- tests/unit-tests/graphics/test_platform_prober.cpp 2015-12-03 08:10:28 +0000
+++ tests/unit-tests/graphics/test_platform_prober.cpp 2015-12-15 20:16:27 +0000
@@ -121,7 +121,7 @@
121}121}
122122
123#ifdef MIR_BUILD_PLATFORM_MESA_KMS123#ifdef MIR_BUILD_PLATFORM_MESA_KMS
124TEST_F(ServerPlatformProbeMockDRM, LoadsMesaPlatformWhenDrmMasterCanBeAcquired)124TEST(ServerPlatformProbe, LoadsMesaPlatformWhenDrmDevicePresent)
125{125{
126 using namespace testing;126 using namespace testing;
127 mir::options::ProgramOption options;127 mir::options::ProgramOption options;
@@ -192,7 +192,7 @@
192}192}
193193
194#if defined(MIR_BUILD_PLATFORM_MESA_KMS) || defined(MIR_BUILD_PLATFORM_MESA_X11) || defined(MIR_BUILD_PLATFORM_ANDROID)194#if defined(MIR_BUILD_PLATFORM_MESA_KMS) || defined(MIR_BUILD_PLATFORM_MESA_X11) || defined(MIR_BUILD_PLATFORM_ANDROID)
195TEST_F(ServerPlatformProbeMockDRM, LoadsMesaOrAndroidInPreferenceToDummy)195TEST(ServerPlatformProbe, LoadsMesaOrAndroidInPreferenceToDummy)
196{196{
197 using namespace testing;197 using namespace testing;
198 mir::options::ProgramOption options;198 mir::options::ProgramOption options;
@@ -212,7 +212,7 @@
212}212}
213#endif213#endif
214214
215TEST_F(ServerPlatformProbeMockDRM, IgnoresNonPlatformModules)215TEST(ServerPlatformProbe, IgnoresNonPlatformModules)
216{216{
217 using namespace testing;217 using namespace testing;
218 mir::options::ProgramOption options;218 mir::options::ProgramOption options;

Subscribers

People subscribed via source and target branches