Merge lp:~cemil-azizoglu/mir/add-create-module-context-fn into lp:mir
- add-create-module-context-fn
- Merge into development-branch
Status: | Work in progress |
---|---|
Proposed branch: | lp:~cemil-azizoglu/mir/add-create-module-context-fn |
Merge into: | lp:mir |
Prerequisite: | lp:~cemil-azizoglu/mir/mir-on-x-configure |
Diff against target: |
510 lines (+127/-39) 23 files modified
include/platform/mir/graphics/platform.h (+12/-4) include/platform/mir/input/platform.h (+6/-2) src/platforms/android/server/platform.cpp (+9/-2) src/platforms/android/server/symbols.map (+5/-0) src/platforms/mesa/server/kms/guest_platform.cpp (+2/-1) src/platforms/mesa/server/kms/platform.cpp (+7/-1) src/platforms/mesa/server/kms/symbols.map (+5/-0) src/platforms/mesa/server/x11/CMakeLists.txt (+7/-0) src/platforms/mesa/server/x11/X11_resources.cpp (+11/-0) src/platforms/mesa/server/x11/graphics/CMakeLists.txt (+2/-9) src/platforms/mesa/server/x11/graphics/graphics.cpp (+7/-6) src/platforms/mesa/server/x11/input/CMakeLists.txt (+1/-1) src/platforms/mesa/server/x11/input/input.cpp (+5/-4) src/platforms/mesa/server/x11/symbols.map (+5/-0) src/server/graphics/default_configuration.cpp (+7/-2) src/server/input/default_configuration.cpp (+5/-1) tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+2/-1) tests/mir_test_doubles/platform_factory.cpp (+2/-1) tests/mir_test_framework/stub_input.cpp (+7/-1) tests/mir_test_framework/stubbed_graphics_platform.cpp (+9/-2) tests/mir_test_framework/symbols-server.map (+5/-0) tests/mir_test_framework/symbols-stub-input.map (+5/-0) tests/unit-tests/graphics/android/test_platform.cpp (+1/-1) |
To merge this branch: | bzr merge lp:~cemil-azizoglu/mir/add-create-module-context-fn |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Alan Griffiths | Needs Information | ||
Alexandros Frantzis (community) | Needs Fixing | ||
Review via email: mp+269127@code.launchpad.net |
Commit message
Add create_
Description of the change
Add create_
- Both graphics and input platforms would have this function.
- If both graphics and input platforms are compiled into the same so, there will be one implementation.
- The function is called before creating a graphics and/or input platform.
- The context created is opaque outside the platform layer.
- The context obtained will then be provided to APIs such as create_
- This facilitates the X11 related assets to be created once and be used for input as well as graphics.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2836
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 2837. By Cemil Azizoglu
-
Fix android build
- 2838. By Cemil Azizoglu
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2837
http://
Executed test runs:
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 : | # |
PASSED: Continuous integration, rev:2838
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
> std::shared_
std::shared_
Looks good otherwise.
- 2839. By Cemil Azizoglu
-
merge prereq
- 2840. By Cemil Azizoglu
-
Move create_
module_ context function to the main dir of x platform - 2841. By Cemil Azizoglu
-
merge prereq
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2841
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2841
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andreas Pokorny (andreas-pokorny) wrote : | # |
I was about to suggest using mir::UniqueModu
Alan Griffiths (alan-griffiths) wrote : | # |
> I was about to suggest using mir::UniqueModu
> keep the module alive at least as long as the context object from the platform
> is alive. But unique_ptr does not allow void.
As with the branch Alexandros proposed yesterday there's an advantage to an "empty" type with a vtab - it can be used with RTTI to safely downcast at the receiving end.
Alan Griffiths (alan-griffiths) wrote : | # |
*Needs Discussion*
I'm just pondering an alternative approach: adding a method to mg::Platform. Vis:
auto create_
It the user has specified an input platform this can be ignored, otherwise call this and if it returns non-nullptr then use the result. Otherwise Mir looks for a suitable module elsewhere as currently.
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
> *Needs Discussion*
>
> I'm just pondering an alternative approach: adding a method to mg::Platform.
> Vis:
>
> auto create_
>
> It the user has specified an input platform this can be ignored, otherwise
> call this and if it returns non-nullptr then use the result. Otherwise Mir
> looks for a suitable module elsewhere as currently.
Some anomalies with this approach would be :
- Not sure how this would solve the problem of creating a common context for both graphics and input irrespective of load order.
- Strange to have an "input" related interface in mir::graphics::...
- A graphics only platform would still need to have a create_
- Imposes an order in which graphics (first) and input (next) platforms need to be created
- 2842. By Cemil Azizoglu
-
create_
module_ context --> get_module_context
CreateModuleContext --> GetModuleContext
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
Need to think about this more. Making it WIP for now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2842
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 2842. By Cemil Azizoglu
-
create_
module_ context --> get_module_context
CreateModuleContext --> GetModuleContext - 2841. By Cemil Azizoglu
-
merge prereq
- 2840. By Cemil Azizoglu
-
Move create_
module_ context function to the main dir of x platform - 2839. By Cemil Azizoglu
-
merge prereq
- 2838. By Cemil Azizoglu
-
merge trunk
- 2837. By Cemil Azizoglu
-
Fix android build
- 2836. By Cemil Azizoglu
-
Add create_
module_ context( ) to platforms - 2835. By Cemil Azizoglu
-
merge trunk
Preview Diff
1 | === modified file 'include/platform/mir/graphics/platform.h' | |||
2 | --- include/platform/mir/graphics/platform.h 2015-08-14 16:11:47 +0000 | |||
3 | +++ include/platform/mir/graphics/platform.h 2015-09-01 03:06:58 +0000 | |||
4 | @@ -40,6 +40,8 @@ | |||
5 | 40 | class ProgramOption; | 40 | class ProgramOption; |
6 | 41 | } | 41 | } |
7 | 42 | 42 | ||
8 | 43 | typedef std::shared_ptr<void>(*GetModuleContext)(); | ||
9 | 44 | |||
10 | 43 | /// Graphics subsystem. Mediates interaction between core system and | 45 | /// Graphics subsystem. Mediates interaction between core system and |
11 | 44 | /// the graphics environment. | 46 | /// the graphics environment. |
12 | 45 | namespace graphics | 47 | namespace graphics |
13 | @@ -119,11 +121,13 @@ | |||
14 | 119 | typedef std::shared_ptr<mir::graphics::Platform>(*CreateHostPlatform)( | 121 | typedef std::shared_ptr<mir::graphics::Platform>(*CreateHostPlatform)( |
15 | 120 | std::shared_ptr<mir::options::Option> const& options, | 122 | std::shared_ptr<mir::options::Option> const& options, |
16 | 121 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, | 123 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
18 | 122 | std::shared_ptr<mir::graphics::DisplayReport> const& report); | 124 | std::shared_ptr<mir::graphics::DisplayReport> const& report, |
19 | 125 | std::shared_ptr<void> module_context); | ||
20 | 123 | 126 | ||
21 | 124 | typedef std::shared_ptr<mir::graphics::Platform>(*CreateGuestPlatform)( | 127 | typedef std::shared_ptr<mir::graphics::Platform>(*CreateGuestPlatform)( |
22 | 125 | std::shared_ptr<mir::graphics::DisplayReport> const& report, | 128 | std::shared_ptr<mir::graphics::DisplayReport> const& report, |
24 | 126 | std::shared_ptr<mir::graphics::NestedContext> const& nested_context); | 129 | std::shared_ptr<mir::graphics::NestedContext> const& nested_context, |
25 | 130 | std::shared_ptr<void> module_context); | ||
26 | 127 | 131 | ||
27 | 128 | 132 | ||
28 | 129 | typedef void(*AddPlatformOptions)( | 133 | typedef void(*AddPlatformOptions)( |
29 | @@ -153,7 +157,8 @@ | |||
30 | 153 | std::shared_ptr<mir::graphics::Platform> create_host_platform( | 157 | std::shared_ptr<mir::graphics::Platform> create_host_platform( |
31 | 154 | std::shared_ptr<mir::options::Option> const& options, | 158 | std::shared_ptr<mir::options::Option> const& options, |
32 | 155 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, | 159 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
34 | 156 | std::shared_ptr<mir::graphics::DisplayReport> const& report); | 160 | std::shared_ptr<mir::graphics::DisplayReport> const& report, |
35 | 161 | std::shared_ptr<void> module_context); | ||
36 | 157 | 162 | ||
37 | 158 | /** | 163 | /** |
38 | 159 | * Function prototype used to return a new guest graphics platform. The guest graphics platform | 164 | * Function prototype used to return a new guest graphics platform. The guest graphics platform |
39 | @@ -168,7 +173,8 @@ | |||
40 | 168 | */ | 173 | */ |
41 | 169 | std::shared_ptr<mir::graphics::Platform> create_guest_platform( | 174 | std::shared_ptr<mir::graphics::Platform> create_guest_platform( |
42 | 170 | std::shared_ptr<mir::graphics::DisplayReport> const& report, | 175 | std::shared_ptr<mir::graphics::DisplayReport> const& report, |
44 | 171 | std::shared_ptr<mir::graphics::NestedContext> const& nested_context); | 176 | std::shared_ptr<mir::graphics::NestedContext> const& nested_context, |
45 | 177 | std::shared_ptr<void> module_context); | ||
46 | 172 | 178 | ||
47 | 173 | /** | 179 | /** |
48 | 174 | * Function prototype used to add platform specific options to the platform-independent server options. | 180 | * Function prototype used to add platform specific options to the platform-independent server options. |
49 | @@ -188,6 +194,8 @@ | |||
50 | 188 | mir::graphics::PlatformPriority probe_graphics_platform(mir::options::ProgramOption const& options); | 194 | mir::graphics::PlatformPriority probe_graphics_platform(mir::options::ProgramOption const& options); |
51 | 189 | 195 | ||
52 | 190 | mir::ModuleProperties const* describe_graphics_module(); | 196 | mir::ModuleProperties const* describe_graphics_module(); |
53 | 197 | |||
54 | 198 | std::shared_ptr<void> get_module_context(); | ||
55 | 191 | } | 199 | } |
56 | 192 | 200 | ||
57 | 193 | #endif // MIR_GRAPHICS_PLATFORM_H_ | 201 | #endif // MIR_GRAPHICS_PLATFORM_H_ |
58 | 194 | 202 | ||
59 | === modified file 'include/platform/mir/input/platform.h' | |||
60 | --- include/platform/mir/input/platform.h 2015-07-23 02:39:20 +0000 | |||
61 | +++ include/platform/mir/input/platform.h 2015-09-01 03:06:58 +0000 | |||
62 | @@ -38,6 +38,8 @@ | |||
63 | 38 | class Dispatchable; | 38 | class Dispatchable; |
64 | 39 | } | 39 | } |
65 | 40 | 40 | ||
66 | 41 | typedef std::shared_ptr<void>(*GetModuleContext)(); | ||
67 | 42 | |||
68 | 41 | namespace input | 43 | namespace input |
69 | 42 | { | 44 | { |
70 | 43 | class InputDevice; | 45 | class InputDevice; |
71 | @@ -94,7 +96,8 @@ | |||
72 | 94 | std::shared_ptr<options::Option> const& options, | 96 | std::shared_ptr<options::Option> const& options, |
73 | 95 | std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry, | 97 | std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
74 | 96 | std::shared_ptr<InputDeviceRegistry> const& input_device_registry, | 98 | std::shared_ptr<InputDeviceRegistry> const& input_device_registry, |
76 | 97 | std::shared_ptr<InputReport> const& report); | 99 | std::shared_ptr<InputReport> const& report, |
77 | 100 | std::shared_ptr<void> module_context); | ||
78 | 98 | 101 | ||
79 | 99 | typedef void(*AddPlatformOptions)( | 102 | typedef void(*AddPlatformOptions)( |
80 | 100 | boost::program_options::options_description& config); | 103 | boost::program_options::options_description& config); |
81 | @@ -126,7 +129,8 @@ | |||
82 | 126 | std::shared_ptr<mir::options::Option> const& options, | 129 | std::shared_ptr<mir::options::Option> const& options, |
83 | 127 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, | 130 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
84 | 128 | std::shared_ptr<mir::input::InputDeviceRegistry> const& input_device_registry, | 131 | std::shared_ptr<mir::input::InputDeviceRegistry> const& input_device_registry, |
86 | 129 | std::shared_ptr<mir::input::InputReport> const& report); | 132 | std::shared_ptr<mir::input::InputReport> const& report, |
87 | 133 | std::shared_ptr<void> module_context); | ||
88 | 130 | 134 | ||
89 | 131 | /** | 135 | /** |
90 | 132 | * Function used to add additional configuration options | 136 | * Function used to add additional configuration options |
91 | 133 | 137 | ||
92 | === modified file 'src/platforms/android/server/platform.cpp' | |||
93 | --- src/platforms/android/server/platform.cpp 2015-07-23 02:39:20 +0000 | |||
94 | +++ src/platforms/android/server/platform.cpp 2015-09-01 03:06:58 +0000 | |||
95 | @@ -138,7 +138,8 @@ | |||
96 | 138 | std::shared_ptr<mg::Platform> create_host_platform( | 138 | std::shared_ptr<mg::Platform> create_host_platform( |
97 | 139 | std::shared_ptr<mo::Option> const& options, | 139 | std::shared_ptr<mo::Option> const& options, |
98 | 140 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, | 140 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
100 | 141 | std::shared_ptr<mir::graphics::DisplayReport> const& display_report) | 141 | std::shared_ptr<mir::graphics::DisplayReport> const& display_report, |
101 | 142 | std::shared_ptr<void> /*module_context*/) | ||
102 | 142 | { | 143 | { |
103 | 143 | auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}, *options); | 144 | auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}, *options); |
104 | 144 | auto hwc_report = make_hwc_report(*options); | 145 | auto hwc_report = make_hwc_report(*options); |
105 | @@ -153,7 +154,8 @@ | |||
106 | 153 | 154 | ||
107 | 154 | std::shared_ptr<mg::Platform> create_guest_platform( | 155 | std::shared_ptr<mg::Platform> create_guest_platform( |
108 | 155 | std::shared_ptr<mg::DisplayReport> const& display_report, | 156 | std::shared_ptr<mg::DisplayReport> const& display_report, |
110 | 156 | std::shared_ptr<mg::NestedContext> const&) | 157 | std::shared_ptr<mg::NestedContext> const&, |
111 | 158 | std::shared_ptr<void> /*module_context*/) | ||
112 | 157 | { | 159 | { |
113 | 158 | //TODO: actually allow disabling quirks for guest platform | 160 | //TODO: actually allow disabling quirks for guest platform |
114 | 159 | auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}); | 161 | auto quirks = std::make_shared<mga::DeviceQuirks>(mga::PropertiesOps{}); |
115 | @@ -196,3 +198,8 @@ | |||
116 | 196 | { | 198 | { |
117 | 197 | return &description; | 199 | return &description; |
118 | 198 | } | 200 | } |
119 | 201 | |||
120 | 202 | std::shared_ptr<void> get_module_context() | ||
121 | 203 | { | ||
122 | 204 | return {}; | ||
123 | 205 | } | ||
124 | 199 | 206 | ||
125 | === modified file 'src/platforms/android/server/symbols.map' | |||
126 | --- src/platforms/android/server/symbols.map 2015-07-22 02:54:31 +0000 | |||
127 | +++ src/platforms/android/server/symbols.map 2015-09-01 03:06:58 +0000 | |||
128 | @@ -1,3 +1,8 @@ | |||
129 | 1 | MIR_SERVER_PLATFORM { | ||
130 | 2 | global: | ||
131 | 3 | get_module_context; | ||
132 | 4 | }; | ||
133 | 5 | |||
134 | 1 | MIR_GRAPHICS_PLATFORM_4 { | 6 | MIR_GRAPHICS_PLATFORM_4 { |
135 | 2 | global: | 7 | global: |
136 | 3 | add_graphics_platform_options; | 8 | add_graphics_platform_options; |
137 | 4 | 9 | ||
138 | === modified file 'src/platforms/mesa/server/kms/guest_platform.cpp' | |||
139 | --- src/platforms/mesa/server/kms/guest_platform.cpp 2015-07-23 02:39:20 +0000 | |||
140 | +++ src/platforms/mesa/server/kms/guest_platform.cpp 2015-09-01 03:06:58 +0000 | |||
141 | @@ -90,7 +90,8 @@ | |||
142 | 90 | 90 | ||
143 | 91 | std::shared_ptr<mg::Platform> create_guest_platform( | 91 | std::shared_ptr<mg::Platform> create_guest_platform( |
144 | 92 | std::shared_ptr<mg::DisplayReport> const&, | 92 | std::shared_ptr<mg::DisplayReport> const&, |
146 | 93 | std::shared_ptr<mg::NestedContext> const& nested_context) | 93 | std::shared_ptr<mg::NestedContext> const& nested_context, |
147 | 94 | std::shared_ptr<void> /*module_context*/) | ||
148 | 94 | { | 95 | { |
149 | 95 | return std::make_shared<mgm::GuestPlatform>(nested_context); | 96 | return std::make_shared<mgm::GuestPlatform>(nested_context); |
150 | 96 | } | 97 | } |
151 | 97 | 98 | ||
152 | === modified file 'src/platforms/mesa/server/kms/platform.cpp' | |||
153 | --- src/platforms/mesa/server/kms/platform.cpp 2015-07-23 02:39:20 +0000 | |||
154 | +++ src/platforms/mesa/server/kms/platform.cpp 2015-09-01 03:06:58 +0000 | |||
155 | @@ -185,7 +185,8 @@ | |||
156 | 185 | std::shared_ptr<mg::Platform> create_host_platform( | 185 | std::shared_ptr<mg::Platform> create_host_platform( |
157 | 186 | std::shared_ptr<mo::Option> const& options, | 186 | std::shared_ptr<mo::Option> const& options, |
158 | 187 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, | 187 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
160 | 188 | std::shared_ptr<mg::DisplayReport> const& report) | 188 | std::shared_ptr<mg::DisplayReport> const& report, |
161 | 189 | std::shared_ptr<void> /*module_context*/) | ||
162 | 189 | { | 190 | { |
163 | 190 | auto real_fops = std::make_shared<RealVTFileOperations>(); | 191 | auto real_fops = std::make_shared<RealVTFileOperations>(); |
164 | 191 | auto real_pops = std::unique_ptr<RealPosixProcessOperations>(new RealPosixProcessOperations{}); | 192 | auto real_pops = std::unique_ptr<RealPosixProcessOperations>(new RealPosixProcessOperations{}); |
165 | @@ -258,3 +259,8 @@ | |||
166 | 258 | { | 259 | { |
167 | 259 | return &description; | 260 | return &description; |
168 | 260 | } | 261 | } |
169 | 262 | |||
170 | 263 | std::shared_ptr<void> get_module_context() | ||
171 | 264 | { | ||
172 | 265 | return {}; | ||
173 | 266 | } | ||
174 | 261 | 267 | ||
175 | === modified file 'src/platforms/mesa/server/kms/symbols.map' | |||
176 | --- src/platforms/mesa/server/kms/symbols.map 2015-07-23 02:39:20 +0000 | |||
177 | +++ src/platforms/mesa/server/kms/symbols.map 2015-09-01 03:06:58 +0000 | |||
178 | @@ -1,3 +1,8 @@ | |||
179 | 1 | MIR_SERVER_PLATFORM { | ||
180 | 2 | global: | ||
181 | 3 | get_module_context; | ||
182 | 4 | }; | ||
183 | 5 | |||
184 | 1 | MIR_GRAPHICS_PLATFORM_4 { | 6 | MIR_GRAPHICS_PLATFORM_4 { |
185 | 2 | global: | 7 | global: |
186 | 3 | add_graphics_platform_options; | 8 | add_graphics_platform_options; |
187 | 4 | 9 | ||
188 | === modified file 'src/platforms/mesa/server/x11/CMakeLists.txt' | |||
189 | --- src/platforms/mesa/server/x11/CMakeLists.txt 2015-08-27 16:57:05 +0000 | |||
190 | +++ src/platforms/mesa/server/x11/CMakeLists.txt 2015-09-01 03:06:58 +0000 | |||
191 | @@ -1,6 +1,13 @@ | |||
192 | 1 | add_subdirectory(graphics/) | 1 | add_subdirectory(graphics/) |
193 | 2 | add_subdirectory(input/) | 2 | add_subdirectory(input/) |
194 | 3 | 3 | ||
195 | 4 | include_directories( | ||
196 | 5 | ${server_common_include_dirs} | ||
197 | 6 | ${PROJECT_SOURCE_DIR}/src/platforms/mesa/server/common | ||
198 | 7 | ${PROJECT_SOURCE_DIR}/include/platform | ||
199 | 8 | ${DRM_INCLUDE_DIRS} | ||
200 | 9 | ) | ||
201 | 10 | |||
202 | 4 | add_library( | 11 | add_library( |
203 | 5 | mirplatformservermesax11 MODULE | 12 | mirplatformservermesax11 MODULE |
204 | 6 | 13 | ||
205 | 7 | 14 | ||
206 | === modified file 'src/platforms/mesa/server/x11/X11_resources.cpp' | |||
207 | --- src/platforms/mesa/server/x11/X11_resources.cpp 2015-08-21 20:12:37 +0000 | |||
208 | +++ src/platforms/mesa/server/x11/X11_resources.cpp 2015-09-01 03:06:58 +0000 | |||
209 | @@ -19,6 +19,7 @@ | |||
210 | 19 | #define MIR_LOG_COMPONENT "x11-error" | 19 | #define MIR_LOG_COMPONENT "x11-error" |
211 | 20 | #include "mir/log.h" | 20 | #include "mir/log.h" |
212 | 21 | 21 | ||
213 | 22 | #include "graphics/platform.h" | ||
214 | 22 | #include "X11_resources.h" | 23 | #include "X11_resources.h" |
215 | 23 | 24 | ||
216 | 24 | namespace mx = mir::X; | 25 | namespace mx = mir::X; |
217 | @@ -26,6 +27,16 @@ | |||
218 | 26 | //Force synchronous Xlib operation - for debugging | 27 | //Force synchronous Xlib operation - for debugging |
219 | 27 | //#define FORCE_SYNCHRONOUS | 28 | //#define FORCE_SYNCHRONOUS |
220 | 28 | 29 | ||
221 | 30 | std::shared_ptr<void> get_module_context() | ||
222 | 31 | { | ||
223 | 32 | static std::shared_ptr<mx::X11Resources> anchor; | ||
224 | 33 | |||
225 | 34 | if (!anchor) | ||
226 | 35 | anchor = std::make_shared<mx::X11Resources>(); | ||
227 | 36 | |||
228 | 37 | return anchor; | ||
229 | 38 | } | ||
230 | 39 | |||
231 | 29 | int mx::mir_x11_error_handler(Display* dpy, XErrorEvent* eev) | 40 | int mx::mir_x11_error_handler(Display* dpy, XErrorEvent* eev) |
232 | 30 | { | 41 | { |
233 | 31 | char msg[80]; | 42 | char msg[80]; |
234 | 32 | 43 | ||
235 | === modified file 'src/platforms/mesa/server/x11/graphics/CMakeLists.txt' | |||
236 | --- src/platforms/mesa/server/x11/graphics/CMakeLists.txt 2015-09-01 02:26:10 +0000 | |||
237 | +++ src/platforms/mesa/server/x11/graphics/CMakeLists.txt 2015-09-01 03:06:58 +0000 | |||
238 | @@ -1,16 +1,9 @@ | |||
239 | 1 | include_directories( | 1 | include_directories( |
240 | 2 | ${server_common_include_dirs} | 2 | ${server_common_include_dirs} |
241 | 3 | ${PROJECT_SOURCE_DIR}/include/platform | 3 | ${PROJECT_SOURCE_DIR}/include/platform |
242 | 4 | ${PROJECT_SOURCE_DIR}/include/client | ||
243 | 5 | ${PROJECT_SOURCE_DIR}/src/platforms/mesa/server/common | 4 | ${PROJECT_SOURCE_DIR}/src/platforms/mesa/server/common |
252 | 6 | ) | 5 | ${DRM_INCLUDE_DIRS} |
253 | 7 | 6 | ${EGL_INCLUDE_DIRS} | |
246 | 8 | include_directories( | ||
247 | 9 | ${DRM_INCLUDE_DIRS} | ||
248 | 10 | ${GBM_INCLUDE_DIRS} | ||
249 | 11 | ${EGL_INCLUDE_DIRS} | ||
250 | 12 | ${GLESv2_INCLUDE_DIRS} | ||
251 | 13 | ${UDEV_INCLUDE_DIRS} | ||
254 | 14 | ) | 7 | ) |
255 | 15 | 8 | ||
256 | 16 | add_library( | 9 | add_library( |
257 | 17 | 10 | ||
258 | === modified file 'src/platforms/mesa/server/x11/graphics/graphics.cpp' | |||
259 | --- src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-08-21 20:12:37 +0000 | |||
260 | +++ src/platforms/mesa/server/x11/graphics/graphics.cpp 2015-09-01 03:06:58 +0000 | |||
261 | @@ -25,22 +25,23 @@ | |||
262 | 25 | namespace mx = mir::X; | 25 | namespace mx = mir::X; |
263 | 26 | namespace mgx = mg::X; | 26 | namespace mgx = mg::X; |
264 | 27 | 27 | ||
265 | 28 | mx::X11Resources x11_resources; | ||
266 | 29 | |||
267 | 30 | std::shared_ptr<mg::Platform> create_host_platform( | 28 | std::shared_ptr<mg::Platform> create_host_platform( |
268 | 31 | std::shared_ptr<mo::Option> const& /*options*/, | 29 | std::shared_ptr<mo::Option> const& /*options*/, |
269 | 32 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, | 30 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
271 | 33 | std::shared_ptr<mg::DisplayReport> const& /*report*/) | 31 | std::shared_ptr<mg::DisplayReport> const& /*report*/, |
272 | 32 | std::shared_ptr<void> module_context) | ||
273 | 34 | { | 33 | { |
275 | 35 | if (!x11_resources.get_conn()) | 34 | auto context = std::static_pointer_cast<mx::X11Resources>(module_context); |
276 | 35 | if (!context->get_conn()) | ||
277 | 36 | BOOST_THROW_EXCEPTION(std::runtime_error("Need valid x11 display")); | 36 | BOOST_THROW_EXCEPTION(std::runtime_error("Need valid x11 display")); |
278 | 37 | 37 | ||
280 | 38 | return std::make_shared<mgx::Platform>(x11_resources.get_conn()); | 38 | return std::make_shared<mgx::Platform>(context->get_conn()); |
281 | 39 | } | 39 | } |
282 | 40 | 40 | ||
283 | 41 | std::shared_ptr<mg::Platform> create_guest_platform( | 41 | std::shared_ptr<mg::Platform> create_guest_platform( |
284 | 42 | std::shared_ptr<mg::DisplayReport> const& /*report*/, | 42 | std::shared_ptr<mg::DisplayReport> const& /*report*/, |
286 | 43 | std::shared_ptr<mg::NestedContext> const&) | 43 | std::shared_ptr<mg::NestedContext> const&, |
287 | 44 | std::shared_ptr<void> /*module_context*/) | ||
288 | 44 | { | 45 | { |
289 | 45 | BOOST_THROW_EXCEPTION(std::runtime_error("Guest platform isn't supported under X")); | 46 | BOOST_THROW_EXCEPTION(std::runtime_error("Guest platform isn't supported under X")); |
290 | 46 | return nullptr; | 47 | return nullptr; |
291 | 47 | 48 | ||
292 | === modified file 'src/platforms/mesa/server/x11/input/CMakeLists.txt' | |||
293 | --- src/platforms/mesa/server/x11/input/CMakeLists.txt 2015-08-21 22:20:42 +0000 | |||
294 | +++ src/platforms/mesa/server/x11/input/CMakeLists.txt 2015-09-01 03:06:58 +0000 | |||
295 | @@ -1,5 +1,5 @@ | |||
296 | 1 | include_directories( | 1 | include_directories( |
298 | 2 | ${server_common_include_dirs} | 2 | ${PROJECT_SOURCE_DIR}/include/platform |
299 | 3 | ${PROJECT_SOURCE_DIR}/include/client | 3 | ${PROJECT_SOURCE_DIR}/include/client |
300 | 4 | ) | 4 | ) |
301 | 5 | 5 | ||
302 | 6 | 6 | ||
303 | === modified file 'src/platforms/mesa/server/x11/input/input.cpp' | |||
304 | --- src/platforms/mesa/server/x11/input/input.cpp 2015-08-21 20:12:37 +0000 | |||
305 | +++ src/platforms/mesa/server/x11/input/input.cpp 2015-09-01 03:06:58 +0000 | |||
306 | @@ -25,15 +25,16 @@ | |||
307 | 25 | namespace mx = mir::X; | 25 | namespace mx = mir::X; |
308 | 26 | namespace mix = mi::X; | 26 | namespace mix = mi::X; |
309 | 27 | 27 | ||
310 | 28 | extern mx::X11Resources x11_resources; | ||
311 | 29 | |||
312 | 30 | mir::UniqueModulePtr<mi::Platform> create_input_platform( | 28 | mir::UniqueModulePtr<mi::Platform> create_input_platform( |
313 | 31 | std::shared_ptr<mo::Option> const& /*options*/, | 29 | std::shared_ptr<mo::Option> const& /*options*/, |
314 | 32 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, | 30 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
315 | 33 | std::shared_ptr<mi::InputDeviceRegistry> const& input_device_registry, | 31 | std::shared_ptr<mi::InputDeviceRegistry> const& input_device_registry, |
317 | 34 | std::shared_ptr<mi::InputReport> const& /*report*/) | 32 | std::shared_ptr<mi::InputReport> const& /*report*/, |
318 | 33 | std::shared_ptr<void> module_context) | ||
319 | 35 | { | 34 | { |
321 | 36 | return mir::make_module_ptr<mix::XInputPlatform>(input_device_registry, x11_resources.get_conn()); | 35 | auto context = std::static_pointer_cast<mx::X11Resources>(module_context); |
322 | 36 | |||
323 | 37 | return mir::make_module_ptr<mix::XInputPlatform>(input_device_registry, context->get_conn()); | ||
324 | 37 | } | 38 | } |
325 | 38 | 39 | ||
326 | 39 | void add_input_platform_options( | 40 | void add_input_platform_options( |
327 | 40 | 41 | ||
328 | === modified file 'src/platforms/mesa/server/x11/symbols.map' | |||
329 | --- src/platforms/mesa/server/x11/symbols.map 2015-09-01 02:26:10 +0000 | |||
330 | +++ src/platforms/mesa/server/x11/symbols.map 2015-09-01 03:06:58 +0000 | |||
331 | @@ -1,3 +1,8 @@ | |||
332 | 1 | MIR_SERVER_PLATFORM { | ||
333 | 2 | global: | ||
334 | 3 | get_module_context; | ||
335 | 4 | }; | ||
336 | 5 | |||
337 | 1 | MIR_GRAPHICS_PLATFORM_4 { | 6 | MIR_GRAPHICS_PLATFORM_4 { |
338 | 2 | global: | 7 | global: |
339 | 3 | add_graphics_platform_options; | 8 | add_graphics_platform_options; |
340 | 4 | 9 | ||
341 | === modified file 'src/server/graphics/default_configuration.cpp' | |||
342 | --- src/server/graphics/default_configuration.cpp 2015-07-20 03:16:27 +0000 | |||
343 | +++ src/server/graphics/default_configuration.cpp 2015-09-01 03:06:58 +0000 | |||
344 | @@ -94,6 +94,10 @@ | |||
345 | 94 | } | 94 | } |
346 | 95 | platform_library = mir::graphics::module_for_device(platforms, dynamic_cast<mir::options::ProgramOption&>(*the_options())); | 95 | platform_library = mir::graphics::module_for_device(platforms, dynamic_cast<mir::options::ProgramOption&>(*the_options())); |
347 | 96 | } | 96 | } |
348 | 97 | auto get_module_context = platform_library->load_function<mir::GetModuleContext>( | ||
349 | 98 | "get_module_context", | ||
350 | 99 | "MIR_SERVER_PLATFORM"); | ||
351 | 100 | auto context = get_module_context ? get_module_context() : nullptr; | ||
352 | 97 | auto create_host_platform = platform_library->load_function<mg::CreateHostPlatform>( | 101 | auto create_host_platform = platform_library->load_function<mg::CreateHostPlatform>( |
353 | 98 | "create_host_platform", | 102 | "create_host_platform", |
354 | 99 | MIR_SERVER_GRAPHICS_PLATFORM_VERSION); | 103 | MIR_SERVER_GRAPHICS_PLATFORM_VERSION); |
355 | @@ -111,11 +115,12 @@ | |||
356 | 111 | description->micro_version); | 115 | description->micro_version); |
357 | 112 | 116 | ||
358 | 113 | if (!the_options()->is_set(options::host_socket_opt)) | 117 | if (!the_options()->is_set(options::host_socket_opt)) |
360 | 114 | return create_host_platform(the_options(), the_emergency_cleanup(), the_display_report()); | 118 | return create_host_platform(the_options(), the_emergency_cleanup(), the_display_report(), context); |
361 | 115 | else | 119 | else |
362 | 116 | return create_guest_platform( | 120 | return create_guest_platform( |
363 | 117 | the_display_report(), | 121 | the_display_report(), |
365 | 118 | the_host_connection()); | 122 | the_host_connection(), |
366 | 123 | context); | ||
367 | 119 | 124 | ||
368 | 120 | }); | 125 | }); |
369 | 121 | } | 126 | } |
370 | 122 | 127 | ||
371 | === modified file 'src/server/input/default_configuration.cpp' | |||
372 | --- src/server/input/default_configuration.cpp 2015-08-20 12:33:43 +0000 | |||
373 | +++ src/server/input/default_configuration.cpp 2015-09-01 03:06:58 +0000 | |||
374 | @@ -318,10 +318,14 @@ | |||
375 | 318 | 318 | ||
376 | 319 | auto lib = std::make_shared<mir::SharedLibrary>( | 319 | auto lib = std::make_shared<mir::SharedLibrary>( |
377 | 320 | options->get<std::string>(options::platform_input_lib)); | 320 | options->get<std::string>(options::platform_input_lib)); |
378 | 321 | auto get_module_context = lib->load_function<mir::GetModuleContext>( | ||
379 | 322 | "get_module_context", | ||
380 | 323 | "MIR_SERVER_PLATFORM"); | ||
381 | 324 | auto context = get_module_context ? get_module_context() : nullptr; | ||
382 | 321 | auto create = lib->load_function<mi::CreatePlatform>( | 325 | auto create = lib->load_function<mi::CreatePlatform>( |
383 | 322 | "create_input_platform", | 326 | "create_input_platform", |
384 | 323 | MIR_SERVER_INPUT_PLATFORM_VERSION); | 327 | MIR_SERVER_INPUT_PLATFORM_VERSION); |
386 | 324 | return create(the_options(), the_emergency_cleanup(), the_input_device_registry(), the_input_report()); | 328 | return create(the_options(), the_emergency_cleanup(), the_input_device_registry(), the_input_report(), context); |
387 | 325 | }); | 329 | }); |
388 | 326 | } | 330 | } |
389 | 327 | 331 | ||
390 | 328 | 332 | ||
391 | === modified file 'tests/integration-tests/graphics/mesa/test_buffer_integration.cpp' | |||
392 | --- tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2015-06-25 13:43:43 +0000 | |||
393 | +++ tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2015-09-01 03:06:58 +0000 | |||
394 | @@ -102,7 +102,8 @@ | |||
395 | 102 | platform = create_host_platform( | 102 | platform = create_host_platform( |
396 | 103 | options, | 103 | options, |
397 | 104 | std::make_shared<mtd::NullEmergencyCleanup>(), | 104 | std::make_shared<mtd::NullEmergencyCleanup>(), |
399 | 105 | mr::null_display_report()); | 105 | mr::null_display_report(), |
400 | 106 | get_module_context()); | ||
401 | 106 | } | 107 | } |
402 | 107 | else | 108 | else |
403 | 108 | { | 109 | { |
404 | 109 | 110 | ||
405 | === modified file 'tests/mir_test_doubles/platform_factory.cpp' | |||
406 | --- tests/mir_test_doubles/platform_factory.cpp 2015-08-21 20:35:15 +0000 | |||
407 | +++ tests/mir_test_doubles/platform_factory.cpp 2015-09-01 03:06:58 +0000 | |||
408 | @@ -40,7 +40,8 @@ | |||
409 | 40 | return create_host_platform( | 40 | return create_host_platform( |
410 | 41 | std::make_shared<options::ProgramOption>(), | 41 | std::make_shared<options::ProgramOption>(), |
411 | 42 | std::make_shared<NullEmergencyCleanup>(), | 42 | std::make_shared<NullEmergencyCleanup>(), |
413 | 43 | report::null_display_report()); | 43 | report::null_display_report(), |
414 | 44 | get_module_context()); | ||
415 | 44 | } | 45 | } |
416 | 45 | 46 | ||
417 | 46 | #elif MESA_KMS | 47 | #elif MESA_KMS |
418 | 47 | 48 | ||
419 | === modified file 'tests/mir_test_framework/stub_input.cpp' | |||
420 | --- tests/mir_test_framework/stub_input.cpp 2015-07-20 03:16:27 +0000 | |||
421 | +++ tests/mir_test_framework/stub_input.cpp 2015-09-01 03:06:58 +0000 | |||
422 | @@ -28,7 +28,8 @@ | |||
423 | 28 | std::shared_ptr<mo::Option> const& /*options*/, | 28 | std::shared_ptr<mo::Option> const& /*options*/, |
424 | 29 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, | 29 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
425 | 30 | std::shared_ptr<mi::InputDeviceRegistry> const& input_device_registry, | 30 | std::shared_ptr<mi::InputDeviceRegistry> const& input_device_registry, |
427 | 31 | std::shared_ptr<mi::InputReport> const& /*report*/) | 31 | std::shared_ptr<mi::InputReport> const& /*report*/, |
428 | 32 | std::shared_ptr<void> /*module_context*/) | ||
429 | 32 | { | 33 | { |
430 | 33 | return mir::make_module_ptr<mtf::StubInputPlatform>(input_device_registry); | 34 | return mir::make_module_ptr<mtf::StubInputPlatform>(input_device_registry); |
431 | 34 | } | 35 | } |
432 | @@ -64,3 +65,8 @@ | |||
433 | 64 | { | 65 | { |
434 | 65 | return mir::make_module_ptr<mtf::FakeInputDeviceImpl>(info); | 66 | return mir::make_module_ptr<mtf::FakeInputDeviceImpl>(info); |
435 | 66 | } | 67 | } |
436 | 68 | |||
437 | 69 | extern "C" std::shared_ptr<void> get_module_context() | ||
438 | 70 | { | ||
439 | 71 | return {}; | ||
440 | 72 | } | ||
441 | 67 | 73 | ||
442 | === modified file 'tests/mir_test_framework/stubbed_graphics_platform.cpp' | |||
443 | --- tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-07-23 02:39:20 +0000 | |||
444 | +++ tests/mir_test_framework/stubbed_graphics_platform.cpp 2015-09-01 03:06:58 +0000 | |||
445 | @@ -294,7 +294,8 @@ | |||
446 | 294 | std::shared_ptr<mg::Platform> create_host_platform( | 294 | std::shared_ptr<mg::Platform> create_host_platform( |
447 | 295 | std::shared_ptr<mo::Option> const& /*options*/, | 295 | std::shared_ptr<mo::Option> const& /*options*/, |
448 | 296 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, | 296 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
450 | 297 | std::shared_ptr<mg::DisplayReport> const& /*report*/) | 297 | std::shared_ptr<mg::DisplayReport> const& /*report*/, |
451 | 298 | std::shared_ptr<void> /*module_context*/) | ||
452 | 298 | { | 299 | { |
453 | 299 | std::shared_ptr<mg::Platform> result{}; | 300 | std::shared_ptr<mg::Platform> result{}; |
454 | 300 | 301 | ||
455 | @@ -313,7 +314,8 @@ | |||
456 | 313 | 314 | ||
457 | 314 | std::shared_ptr<mg::Platform> create_guest_platform( | 315 | std::shared_ptr<mg::Platform> create_guest_platform( |
458 | 315 | std::shared_ptr<mg::DisplayReport> const&, | 316 | std::shared_ptr<mg::DisplayReport> const&, |
460 | 316 | std::shared_ptr<mg::NestedContext> const& context) | 317 | std::shared_ptr<mg::NestedContext> const& context, |
461 | 318 | std::shared_ptr<void> /*module_context*/) | ||
462 | 317 | { | 319 | { |
463 | 318 | auto graphics_platform = the_graphics_platform.lock(); | 320 | auto graphics_platform = the_graphics_platform.lock(); |
464 | 319 | if (!graphics_platform) | 321 | if (!graphics_platform) |
465 | @@ -339,3 +341,8 @@ | |||
466 | 339 | { | 341 | { |
467 | 340 | display_preset = display; | 342 | display_preset = display; |
468 | 341 | } | 343 | } |
469 | 344 | |||
470 | 345 | extern "C" std::shared_ptr<void> get_module_context() | ||
471 | 346 | { | ||
472 | 347 | return {}; | ||
473 | 348 | } | ||
474 | 342 | 349 | ||
475 | === modified file 'tests/mir_test_framework/symbols-server.map' | |||
476 | --- tests/mir_test_framework/symbols-server.map 2015-07-22 02:54:31 +0000 | |||
477 | +++ tests/mir_test_framework/symbols-server.map 2015-09-01 03:06:58 +0000 | |||
478 | @@ -1,3 +1,8 @@ | |||
479 | 1 | MIR_SERVER_PLATFORM { | ||
480 | 2 | global: | ||
481 | 3 | get_module_context; | ||
482 | 4 | }; | ||
483 | 5 | |||
484 | 1 | MIR_GRAPHICS_PLATFORM_4 { | 6 | MIR_GRAPHICS_PLATFORM_4 { |
485 | 2 | global: | 7 | global: |
486 | 3 | add_graphics_platform_options; | 8 | add_graphics_platform_options; |
487 | 4 | 9 | ||
488 | === modified file 'tests/mir_test_framework/symbols-stub-input.map' | |||
489 | --- tests/mir_test_framework/symbols-stub-input.map 2015-08-27 08:41:14 +0000 | |||
490 | +++ tests/mir_test_framework/symbols-stub-input.map 2015-09-01 03:06:58 +0000 | |||
491 | @@ -1,3 +1,8 @@ | |||
492 | 1 | MIR_SERVER_PLATFORM { | ||
493 | 2 | global: | ||
494 | 3 | get_module_context; | ||
495 | 4 | }; | ||
496 | 5 | |||
497 | 1 | MIR_INPUT_PLATFORM_2 { | 6 | MIR_INPUT_PLATFORM_2 { |
498 | 2 | global: | 7 | global: |
499 | 3 | add_input_platform_options; | 8 | add_input_platform_options; |
500 | 4 | 9 | ||
501 | === modified file 'tests/unit-tests/graphics/android/test_platform.cpp' | |||
502 | --- tests/unit-tests/graphics/android/test_platform.cpp 2015-07-20 03:16:27 +0000 | |||
503 | +++ tests/unit-tests/graphics/android/test_platform.cpp 2015-09-01 03:06:58 +0000 | |||
504 | @@ -271,5 +271,5 @@ | |||
505 | 271 | EXPECT_CALL(hwaccess, hw_get_module(StrEq(GRALLOC_HARDWARE_MODULE_ID), _)) | 271 | EXPECT_CALL(hwaccess, hw_get_module(StrEq(GRALLOC_HARDWARE_MODULE_ID), _)) |
506 | 272 | .Times(AtMost(1)); | 272 | .Times(AtMost(1)); |
507 | 273 | 273 | ||
509 | 274 | auto platform = create_guest_platform(mt::fake_shared(stub_report), nullptr); | 274 | auto platform = create_guest_platform(mt::fake_shared(stub_report), nullptr, get_module_context()); |
510 | 275 | } | 275 | } |
Also platform ABI, graphics ABI and input ABI need to be bumped. Will bump separately.