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
1=== modified file 'src/platforms/mesa/server/kms/platform_symbols.cpp'
2--- src/platforms/mesa/server/kms/platform_symbols.cpp 2015-11-25 20:26:59 +0000
3+++ src/platforms/mesa/server/kms/platform_symbols.cpp 2015-12-15 20:16:27 +0000
4@@ -156,33 +156,15 @@
5 drm_devices.match_sysname("card[0-9]*");
6 drm_devices.scan_devices();
7
8- if (drm_devices.begin() == drm_devices.end())
9- return mg::PlatformPriority::unsupported;
10-
11- // Check for master
12- int tmp_fd = -1;
13 for (auto& device : drm_devices)
14 {
15- tmp_fd = open(device.devnode(), O_RDWR | O_CLOEXEC);
16- if (tmp_fd >= 0)
17- break;
18- }
19-
20- if (tmp_fd >= 0)
21- {
22- if (drmSetMaster(tmp_fd) >= 0)
23- {
24- drmDropMaster(tmp_fd);
25- drmClose(tmp_fd);
26+ static_cast<void>(device);
27+ if (platform_option_used)
28 return mg::PlatformPriority::best;
29- }
30 else
31- drmClose(tmp_fd);
32+ return mg::PlatformPriority::supported;
33 }
34
35- if (platform_option_used)
36- return mg::PlatformPriority::best;
37-
38 return mg::PlatformPriority::unsupported;
39 }
40
41
42=== modified file 'src/platforms/mesa/server/x11/graphics/graphics.cpp'
43--- src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-11-12 14:21:39 +0000
44+++ src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-12-15 20:16:27 +0000
45@@ -91,7 +91,7 @@
46 drm_devices.scan_devices();
47
48 if (drm_devices.begin() != drm_devices.end())
49- return mg::PlatformPriority::supported;
50+ return mg::PlatformPriority::best;
51 }
52 return mg::PlatformPriority::unsupported;
53 }
54
55=== modified file 'tests/unit-tests/graphics/mesa/kms/test_platform.cpp'
56--- tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-11-10 23:10:22 +0000
57+++ tests/unit-tests/graphics/mesa/kms/test_platform.cpp 2015-12-15 20:16:27 +0000
58@@ -319,7 +319,7 @@
59 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));
60 }
61
62-TEST_F(MesaGraphicsPlatform, probe_returns_best_when_master)
63+TEST_F(MesaGraphicsPlatform, probe_returns_supported_when_drm_devices_exist)
64 {
65 mtf::UdevEnvironment udev_environment;
66 boost::program_options::options_description po;
67@@ -329,7 +329,7 @@
68
69 mir::SharedLibrary platform_lib{mtf::server_platform("graphics-mesa-kms")};
70 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
71- EXPECT_EQ(mg::PlatformPriority::best, probe(options));
72+ EXPECT_EQ(mg::PlatformPriority::supported, probe(options));
73 }
74
75 TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_vt_option_exist)
76
77=== modified file 'tests/unit-tests/graphics/mesa/x11/test_platform.cpp'
78--- tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-11-06 20:02:49 +0000
79+++ tests/unit-tests/graphics/mesa/x11/test_platform.cpp 2015-12-15 20:16:27 +0000
80@@ -116,7 +116,7 @@
81 EXPECT_EQ(mg::PlatformPriority::unsupported, probe(options));
82 }
83
84-TEST_F(X11GraphicsPlatformTest, probe_returns_supported_when_drm_render_nodes_exist)
85+TEST_F(X11GraphicsPlatformTest, probe_returns_best_when_drm_render_nodes_exist)
86 {
87 mtf::UdevEnvironment udev_environment;
88 mir::options::ProgramOption options;
89@@ -125,5 +125,5 @@
90
91 mir::SharedLibrary platform_lib{mtf::server_platform("server-mesa-x11")};
92 auto probe = platform_lib.load_function<mg::PlatformProbe>(probe_platform);
93- EXPECT_EQ(mg::PlatformPriority::supported, probe(options));
94+ EXPECT_EQ(mg::PlatformPriority::best, probe(options));
95 }
96
97=== modified file 'tests/unit-tests/graphics/test_platform_prober.cpp'
98--- tests/unit-tests/graphics/test_platform_prober.cpp 2015-12-03 08:10:28 +0000
99+++ tests/unit-tests/graphics/test_platform_prober.cpp 2015-12-15 20:16:27 +0000
100@@ -121,7 +121,7 @@
101 }
102
103 #ifdef MIR_BUILD_PLATFORM_MESA_KMS
104-TEST_F(ServerPlatformProbeMockDRM, LoadsMesaPlatformWhenDrmMasterCanBeAcquired)
105+TEST(ServerPlatformProbe, LoadsMesaPlatformWhenDrmDevicePresent)
106 {
107 using namespace testing;
108 mir::options::ProgramOption options;
109@@ -192,7 +192,7 @@
110 }
111
112 #if defined(MIR_BUILD_PLATFORM_MESA_KMS) || defined(MIR_BUILD_PLATFORM_MESA_X11) || defined(MIR_BUILD_PLATFORM_ANDROID)
113-TEST_F(ServerPlatformProbeMockDRM, LoadsMesaOrAndroidInPreferenceToDummy)
114+TEST(ServerPlatformProbe, LoadsMesaOrAndroidInPreferenceToDummy)
115 {
116 using namespace testing;
117 mir::options::ProgramOption options;
118@@ -212,7 +212,7 @@
119 }
120 #endif
121
122-TEST_F(ServerPlatformProbeMockDRM, IgnoresNonPlatformModules)
123+TEST(ServerPlatformProbe, IgnoresNonPlatformModules)
124 {
125 using namespace testing;
126 mir::options::ProgramOption options;

Subscribers

People subscribed via source and target branches