Merge lp:~raof/mir/privatise-all-the-things into lp:mir
- privatise-all-the-things
- Merge into development-branch
Status: | Superseded |
---|---|
Proposed branch: | lp:~raof/mir/privatise-all-the-things |
Merge into: | lp:mir |
Diff against target: |
5047 lines (+2580/-573) (has conflicts) 123 files modified
CMakeLists.txt (+4/-2) client-ABI-sha1sums (+1/-1) common-ABI-sha1sums (+5/-1) debian/control (+7/-12) debian/create_postinst_prerm_scripts.sh (+0/-39) debian/install_ld_so_conf.sh (+0/-26) debian/mir-client-platform-android-1.install (+1/-1) debian/mir-client-platform-mesa-1.install (+1/-1) debian/mir-platform-graphics-android-1.install (+1/-1) debian/mir-platform-graphics-mesa-1.install (+1/-1) debian/rules (+0/-11) debian/update-alternatives.postinst.in (+0/-18) debian/update-alternatives.prerm.in (+0/-16) include/platform/mir/graphics/platform.h (+36/-0) include/platform/mir/options/configuration.h (+2/-0) include/platform/mir/shared_library_loader.h (+0/-28) include/server/mir/default_server_configuration.h (+3/-0) include/shared/mir/logging/null_shared_library_prober_report.h (+49/-0) include/shared/mir/logging/shared_library_prober_report.h (+48/-0) include/shared/mir/shared_library_prober.h (+36/-0) include/shared/mir/shared_library_prober_report.h (+44/-0) include/shared/mir_toolkit/mesa/native_display.h (+3/-3) include/test/mir_test_doubles/mock_android_alloc_device.h (+5/-0) include/test/mir_test_doubles/mock_android_hw.h (+5/-0) include/test/mir_test_doubles/mock_hwc_composer_device_1.h (+5/-0) include/test/mir_test_framework/client_platform_factory.h (+72/-0) include/test/mir_test_framework/executable_path.h (+2/-0) include/test/mir_test_framework/stub_client_platform_factory.h (+33/-0) platform-ABI-sha1sums (+7/-4) server-ABI-sha1sums (+8/-5) src/client/CMakeLists.txt (+14/-11) src/client/android/CMakeLists.txt (+6/-22) src/client/android/android_native_display_container.cpp (+16/-4) src/client/android/android_native_display_container.h (+8/-1) src/client/android/client_platform_factory.cpp (+21/-5) src/client/android/client_platform_factory.h (+2/-5) src/client/android/symbols.map (+2/-1) src/client/client_platform_factory.h (+5/-2) src/client/default_connection_configuration.cpp (+51/-0) src/client/default_connection_configuration.h (+7/-0) src/client/egl_native_display_container.h (+3/-1) src/client/lttng/CMakeLists.txt (+1/-0) src/client/lttng/shared_library_prober_report.cpp (+50/-0) src/client/lttng/shared_library_prober_report.h (+55/-0) src/client/lttng/shared_library_prober_report_tp.h (+85/-0) src/client/mesa/CMakeLists.txt (+5/-22) src/client/mesa/client_platform.cpp (+1/-1) src/client/mesa/client_platform_factory.cpp (+20/-6) src/client/mesa/client_platform_factory.h (+0/-5) src/client/mesa/mesa_native_display_container.cpp (+5/-5) src/client/mesa/mesa_native_display_container.h (+1/-1) src/client/mesa/native_surface.cpp (+0/-1) src/client/mesa/symbols.map (+4/-2) src/client/mir_connection.cpp (+7/-3) src/client/mir_connection.h (+3/-1) src/client/probing_client_platform_factory.cpp (+29/-0) src/client/probing_client_platform_factory.h (+27/-0) src/platform/CMakeLists.txt (+17/-6) src/platform/graphics/CMakeLists.txt (+1/-0) src/platform/graphics/android/CMakeLists.txt (+15/-25) src/platform/graphics/android/android_platform.cpp (+23/-0) src/platform/graphics/android/symbols.map (+8/-0) src/platform/graphics/mesa/CMakeLists.txt (+18/-27) src/platform/graphics/mesa/platform.cpp (+28/-0) src/platform/graphics/mesa/symbols.map (+8/-0) src/platform/graphics/platform_probe.cpp (+42/-0) src/platform/graphics/platform_probe.h (+37/-0) src/platform/options/default_configuration.cpp (+67/-17) src/platform/shared_library_loader.cpp (+0/-38) src/platform/symbols.map (+3/-0) src/server/CMakeLists.txt (+4/-1) src/server/graphics/CMakeLists.txt (+1/-1) src/server/graphics/default_configuration.cpp (+37/-6) src/server/logging/CMakeLists.txt (+0/-1) src/server/report/default_server_configuration.cpp (+9/-0) src/server/report/logging/CMakeLists.txt (+0/-1) src/server/report/logging/logging_report_factory.cpp (+5/-1) src/server/report/logging_report_factory.h (+2/-0) src/server/report/lttng/CMakeLists.txt (+1/-0) src/server/report/lttng/lttng_report_factory.cpp (+5/-0) src/server/report/lttng/shared_library_prober_report.cpp (+48/-0) src/server/report/lttng/shared_library_prober_report.h (+52/-0) src/server/report/lttng/shared_library_prober_report_tp.h (+71/-0) src/server/report/lttng_report_factory.h (+1/-0) src/server/report/null/CMakeLists.txt (+1/-0) src/server/report/null/null_report_factory.cpp (+11/-0) src/server/report/null/shared_library_prober_report.cpp (+35/-0) src/server/report/null/shared_library_prober_report.h (+43/-0) src/server/report/null_report_factory.h (+2/-1) src/server/report/report_factory.h (+3/-0) src/shared/graphics/android/mir_native_window.cpp (+0/-1) src/shared/logging/CMakeLists.txt (+2/-1) src/shared/logging/shared_library_prober_report.cpp (+58/-0) src/shared/sharedlibrary/CMakeLists.txt (+5/-1) src/shared/sharedlibrary/shared_library_prober.cpp (+63/-0) src/shared/symbols.map (+9/-0) tests/acceptance-tests/CMakeLists.txt (+3/-1) tests/acceptance-tests/test_symbols_required_by_mesa.cpp (+3/-3) tests/integration-tests/CMakeLists.txt (+21/-2) tests/mir_test_doubles/CMakeLists.txt (+13/-10) tests/mir_test_framework/CMakeLists.txt (+38/-0) tests/mir_test_framework/executable_path.cpp (+5/-0) tests/mir_test_framework/platform_graphics_dummy.cpp (+33/-0) tests/mir_test_framework/stub_client_platform_factory.cpp (+143/-0) tests/mir_test_framework/stub_client_platform_module.cpp (+35/-0) tests/mir_test_framework/symbols-client.map (+7/-0) tests/mir_test_framework/symbols-server.map (+10/-0) tests/mir_test_framework/testing_client_options.cpp (+2/-102) tests/unit-tests/CMakeLists.txt (+42/-3) tests/unit-tests/client/CMakeLists.txt (+1/-0) tests/unit-tests/client/android/test_android_client_platform.cpp (+4/-7) tests/unit-tests/client/mesa/test_client_platform.cpp (+7/-6) tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp (+1/-1) tests/unit-tests/client/test_client_platform.cpp (+109/-29) tests/unit-tests/client/test_probing_client_platform_factory.cpp (+116/-0) tests/unit-tests/graphics/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/android/test_android_platform.cpp (+24/-0) tests/unit-tests/graphics/android/test_output_builder.cpp (+2/-1) tests/unit-tests/graphics/mesa/test_platform.cpp (+22/-0) tests/unit-tests/graphics/test_platform_prober.cpp (+194/-0) tests/unit-tests/shared_library_test.cpp (+28/-11) tests/unit-tests/test_shared_library_prober.cpp (+165/-0) tools/valgrind_suppressions_armhf (+9/-0) Text conflict in src/client/default_connection_configuration.cpp Text conflict in src/client/default_connection_configuration.h |
To merge this branch: | bzr merge lp:~raof/mir/privatise-all-the-things |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Needs Resubmitting | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Alan Griffiths | Abstain | ||
Alexandros Frantzis (community) | Abstain | ||
Kevin DuBois (community) | Needs Information | ||
Review via email: mp+228796@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-29.
Commit message
Move the platform plugins into a private directory, versioned with the relevant ABI.
Together with Alan's versioning of libmirplatform, makes different versions of Mir parallel installable again.
Description of the change
Move the platform plugins into a private directory, versioned with the relevant ABI.
There are some obvious TODOs here, but none seem super-urgent:
*) Actually managing the lifetime of our platform plugins rather than just keeping them around indefinitely
*) Defining an ABI we expose to platform plugins and then sticking them in an unversioned directory.
*) Loading the specific version of the ABI we expect via dlvsym.
Things that I'll do as an immediate follow-on branch:
*) Logging for platform module probing
PS Jenkins bot (ps-jenkins) wrote : | # |
Alan Griffiths (alan-griffiths) wrote : | # |
How does removing libmirplatform fits with our "platform" story?
AIUI libmirplatform is the LGPL foundation (establishing common interfaces & types) that both a propitiatory platform implementation and the GPL libmirserver link against.
How is that seen to work after these changes?
Alexandros Frantzis (afrantzis) wrote : | # |
Besides the conflicts:
42 +Package: libmirplatformg
Debian packaging guidelines mandate lib<name><version>, so e.g. libmirclientpla
225 -override_
231 -override_
787 + // TODO: Some sort of probe so we have some guarantee that
We need to check if removing alternatives support breaks the emulator use case (which was the driving force behing it). In general, until we have a smart enough probe, we either need to allow setting a sensible system-wide default (that's what the current alternatives system does), or disallow installing the mesa/android packages at the same time (which somewhat defeats the purpose of this MP).
2173 +std::list<
Prefer vector<> by default (not that it will makes any performance different in this case).
Kevin DuBois (kdub) wrote : | # |
the define MIR_SERVER_
Chris Halse Rogers (raof) wrote : | # |
> How does removing libmirplatform fits with our "platform" story?
>
> AIUI libmirplatform is the LGPL foundation (establishing common interfaces &
> types) that both a propitiatory platform implementation and the GPL
> libmirserver link against.
>
> How is that seen to work after these changes?
Roughly the same as it was working before these changes - if, for example, you check out libmirplatform in trunk then you'll see it exports a single symbol - mir::load_library - which I removed and then noticed that nothing was actually linked against libmirplatform (because we pass the linker flag to only link against things that we use symbols from).
Thinking of which, have we checked with our lawyers and/or NVIDIA's/AMD's lawyers about this? The situation is more like loadable modules in the kernel rather than traditional dynamic linking, and it'd be nice to be clearer about our expectations than the kernel is.
> Besides the conflicts:
>
> 42 +Package: libmirplatformg
>
> Debian packaging guidelines mandate lib<name><version>, so e.g.
> libmirclientpla
> version is only used if the name ends with a number.
Ah, yeah. I'll actually go the other way - this isn't a shared library, it's a module, so I'll rename it mir-platform-
> 787 + // TODO: Some sort of probe so we have some guarantee that
>
> We need to check if removing alternatives support breaks the emulator use case
> (which was the driving force behing it). In general, until we have a smart
> enough probe, we either need to allow setting a sensible system-wide default
> (that's what the current alternatives system does), or disallow installing the
> mesa/android packages at the same time (which somewhat defeats the purpose of
> this MP).
It shouldn't be too hard to get a basic probe up and running. I'll do so.
>
> 2173 +std::list<
>
> Prefer vector<> by default (not that it will makes any performance different
> in this case).
Ah, yeah. This was a holdover of trying to use raw mir::SharedLibrary which isn't default-
> the define MIR_SERVER_
> the various cross compiling methods floating around. Could we use a some
> default paths instead?
I'm not entirely clear what you're concerned about here. Is your concern about testability? That should be mitigated by the MIR_CLIENT_
Alan Griffiths (alan-griffiths) wrote : | # |
> > How does removing libmirplatform fits with our "platform" story?
> >
> > AIUI libmirplatform is the LGPL foundation (establishing common interfaces &
> > types) that both a propitiatory platform implementation and the GPL
> > libmirserver link against.
> >
> > How is that seen to work after these changes?
>
> Roughly the same as it was working before these changes - if, for example, you
> check out libmirplatform in trunk then you'll see it exports a single symbol -
> mir::load_library - which I removed and then noticed that nothing was actually
> linked against libmirplatform (because we pass the linker flag to only link
> against things that we use symbols from).
>
> Thinking of which, have we checked with our lawyers and/or NVIDIA's/AMD's
> lawyers about this? The situation is more like loadable modules in the kernel
> rather than traditional dynamic linking, and it'd be nice to be clearer about
> our expectations than the kernel is.
I wasn't party to the conversations with lawyers, I'm going on what kgunn told us.
Alan Griffiths (alan-griffiths) wrote : | # |
> Roughly the same as it was working before these changes - if, for example, you
> check out libmirplatform in trunk then you'll see it exports a single symbol -
> mir::load_library - which I removed and then noticed that nothing was actually
> linked against libmirplatform (because we pass the linker flag to only link
> against things that we use symbols from).
That bug and has been fixed on development-branch (-r 1786)
Chris Halse Rogers (raof) wrote : | # |
Moving to WIP: probing is taking a little longer than expected. Hah!
Alan Griffiths (alan-griffiths) wrote : | # |
Interesting approach. Not a complete review but:
1607 +#include <iostream>
Not needed
~~~~
3961 -#ifdef ANDROID
3962 #include "mir_test_
3963 -#include "src/client/
Causes FTBFS for me on desktop:
include/
#include <hardware/
compilation terminated.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1826
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1827. By Chris Halse Rogers
-
Fix the build and the tests when not building the Andorid platform
- 1828. By Chris Halse Rogers
-
Add a --platform-
graphics- path option. This makes it easier to test the full stack without installing it, and
is the sort of thing people are going to reasonable expect in a configuration
file. - 1829. By Chris Halse Rogers
-
Drop noexcept from create_platform declaration.
Since we're returning a std::shared_ptr<> we're pretty much guaranteed that both sides
of this call are actually C++, and can deal with exceptions.This means we need to expose all the necessary symbols for exception propagation and
so on, so drop the local: catch-all clause from the modules' symbols.map
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1827
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1830. By Chris Halse Rogers
-
Merge trunk
- 1831. By Chris Halse Rogers
-
Fix licensing for server → platform move of platform_probe.*
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1829
http://
Executed test runs:
SUCCESS: 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:1831
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1832. By Chris Halse Rogers
-
Include <iostream> less
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1832
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1833. By Chris Halse Rogers
-
Babysit Google Test a bit.
Apparently ::testing::Values() is confused by being handed a list of objects,
resulting in Valgrind errors. Fix this by constructing a list of
ClientPlatformTraits* pointing to the globals instead.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1833
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1834. By Chris Halse Rogers
-
Suppress just a little more armhf valgrind wackiness
- 1835. By Chris Halse Rogers
-
Probe client platform modules before attempting to create a ClientPlatform
Exceptions aren't flow-control constructs, this will allow platforms to *actually* throw
an exception if ClientPlatform construction unexpectedly fails, and resolves a weird
leak found by valgrind that's probably to do with exception throwing across DSOs without
appropriate symbol exports.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1835
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1836. By Chris Halse Rogers
-
Merge trunk, resolve conflicts
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1836
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1837. By Chris Halse Rogers
-
Also add is_appropriate_
module to stub client platform
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1837
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
Didn't get a chance to review properly.
- 1838. By Chris Halse Rogers
-
Merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1838
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1839. By Chris Halse Rogers
-
Be smarter about the client platform tests.
We can instantiate the parametrised multiple times, so do it individually for Mesa and Android
if they're built, rather than testing the dummy for each platform not built. The dummy platform
is not yet sufficiently dummy to work properly here.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1839
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Griffiths (alan-griffiths) wrote : | # |
> [0;32m[ RUN ] [mSurfaceLoop.
> Build timed out (after 60 minutes). Marking the build as failed.
Sometimes tests hang. Sometimes CI is this slow. Who knows?!
~~~~
1204 +std::shared_
Having recently tracked down several problems caused by namespace scoped objects with state I'm concerned that this may be fragile.
~~~~
Triggering rebuild to see if it it gets through CI - will come back for a closer look later.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1839
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1840. By Chris Halse Rogers
-
Merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1840
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1841. By Chris Halse Rogers
-
Update SHAsums
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1841
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1842. By Chris Halse Rogers
-
Select the right client platform for integration tests.
The Android integration tests have some Android-specific tests that need a real client platform,
so give it to them.Conversely, the Mesa client platform cannot load in the integration test environment, as they need
a real platform package.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1842
http://
Executed test runs:
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://
- 1843. By Chris Halse Rogers
-
Default to logging our choice of platform library.
This is both so I can see what the hell's happening in CI, but is also
a reasonable default¹. Who wants to receive bug reports where we don't know
what platform libraries are being loaded?¹: For the server, certainly. Less reasonable for the client, until we make
the client log hookable.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1843
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1844. By Chris Halse Rogers
-
Merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1844
http://
Executed test runs:
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://
Daniel van Vugt (vanvugt) wrote : | # |
Minor suggestion: Try reverting all the blank line changes. That will get the diff size down to below the 5000 line limit so Launchpad will display it all.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1844
http://
Executed test runs:
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://
- 1845. By Chris Halse Rogers
-
Revert the switch to logging by default.
They're not currently as useful as I thought; I'll switch them back on
in the follow-up branch where they *are* more useful ☺
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1844
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1846. By Chris Halse Rogers
-
Merge trunk
- 1847. By Chris Halse Rogers
-
Add new entries to mircommon symbols.map
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1845
http://
Executed test runs:
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:1847
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1845
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Chris Halse Rogers (raof) wrote : | # |
Ok. I don't know what's going on with CI.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1845
http://
Executed test runs:
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://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1845
http://
Executed test runs:
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://
Daniel van Vugt (vanvugt) wrote : | # |
I suggest trying to shrink the diff down to 5000 lines so LP will not truncate it. Also resubmit because the above CI madness is making things confusing.
- 1848. By Chris Halse Rogers
-
Merge trunk
- 1849. By Chris Halse Rogers
-
Merge library-prober as a prerequisite
- 1850. By Chris Halse Rogers
-
Update sha1sums
- 1851. By Chris Halse Rogers
-
Remerge prerequisite
- 1852. By Chris Halse Rogers
-
♪ Merge merge merge your prereq gently down the stream ♫
- 1853. By Chris Halse Rogers
-
Stub client library doesn't need to link to mir-test-framework
Fixes failure to build on i386-android-
cross-compile - 1854. By Chris Halse Rogers
-
Merge versioned-
shared- library work - 1855. By Chris Halse Rogers
-
Make ProbingClientFa
ctory ignore non-client-platform modules. You shouldn't be installing non-client platform modules in the client platform path,
but that's no reason not to be robust against it - 1856. By Chris Halse Rogers
-
Remove some detritus
- 1857. By Chris Halse Rogers
-
Define CLIENT_PLATFORM_API instead of the client module path
- 1858. By Chris Halse Rogers
-
Also make module_for_device ignore non-server-platform modules.
Again, there's no reason not to be robust against this
- 1859. By Chris Halse Rogers
-
Load the specific platform version we're expecting.
There's no particular reason not to do this now, and it's a bit of safety for when we
*do* have a different platform ABI - 1860. By Chris Halse Rogers
-
Merge prereq
- 1861. By Chris Halse Rogers
-
Merge prereq
- 1862. By Chris Halse Rogers
-
Merged versioned-loader into private-
library- loading. - 1863. By Chris Halse Rogers
-
Merged versioned-loader into private-
library- loading. - 1864. By Chris Halse Rogers
-
Use a dummy library rather than something that might actually have side-effects
- 1865. By Chris Halse Rogers
-
Merged versioned-loader into private-
library- loading. - 1866. By Chris Halse Rogers
-
Timeouts for everyone!
This was reliably timing out for me under valgrind. 50 seconds should be enough for everyone!
- 1867. By Chris Halse Rogers
-
Merge trunk. Conflicts!
- 1868. By Chris Halse Rogers
-
Fix cross-building of client-
platform- dummy - 1869. By Chris Halse Rogers
-
Aww, yeah. Don't load libmirplatform twice
- 1870. By Chris Halse Rogers
-
Merge trunk, reverting version-drivers branch as this subsumes it
- 1871. By Chris Halse Rogers
-
Merge trunk, resolving conflicts
- 1872. By Chris Halse Rogers
-
Merge trunk
- 1873. By Chris Halse Rogers
-
Merge trunk
- 1874. By Chris Halse Rogers
-
Drop numbering from driver packages.
Looking through what's involved in that ABI, we haven't changed anything in there for a while.
We should be able to handle not breaking the driver interface, and when we do we should
be able to invest the effort to handle backwards compatibility. - 1875. By Chris Halse Rogers
-
Use MIR_CLIENT_
PLATFORM_ 2. We load the platform libraries from an entirely new path, so it's not actually
necessary for the purposes of disambiguation, but it's also harmless. - 1876. By Chris Halse Rogers
-
Install and load platform libraries in unadorned path.
- 1877. By Chris Halse Rogers
-
Merge trunk
- 1878. By Chris Halse Rogers
-
Drop duplicated prefixes from platform libraries
- 1879. By Chris Halse Rogers
-
Merge trunk
- 1880. By Chris Halse Rogers
-
Remove resolved hw_get_module question-comment
- 1881. By Chris Halse Rogers
-
Remove spurious whitespace changes
- 1882. By Chris Halse Rogers
-
Use BOOST_THROW_
EXCEPTION to decorate the exceptions - 1883. By Chris Halse Rogers
-
Clarify MIR_GRAPHICS_
PLATFORM_ 1 CMake comment - 1884. By Chris Halse Rogers
-
Fix android platform module install
- 1885. By Chris Halse Rogers
-
Merge trunk
- 1886. By Chris Halse Rogers
-
Fix android graphics platform linking post-merge
- 1887. By Chris Halse Rogers
-
Link Mesa platform graphics module against libmirplatform, to pick up symbol versions
- 1888. By Chris Halse Rogers
-
Move client and server modules into an appropriate directory in the build tree
- 1889. By Chris Halse Rogers
-
Fix remaining Android module load failure in tests
- 1890. By Chris Halse Rogers
-
Merge trunk
- 1891. By Chris Halse Rogers
-
Turn libplatformstub into platform-
graphics- dummy.so and fix the tests - 1892. By Chris Halse Rogers
-
Add a set of helpers to find the various platform plugins
- 1893. By Chris Halse Rogers
-
Don't throw exception pointers; just throw the exception.
- 1894. By Chris Halse Rogers
-
Fix name for platform-
graphics- dummy.so - 1895. By Chris Halse Rogers
-
Coalesce all hardcoded platform module strings into {client,
server} _platform_ () calls - 1896. By Chris Halse Rogers
-
Rename, and install client & server stub platforms into mir-test-tools
- 1897. By Chris Halse Rogers
-
Merge trunk, updating the RendererFactory cludge for graphics-stub.so
- 1898. By Chris Halse Rogers
-
Fix random tab character
- 1899. By Chris Halse Rogers
-
Fix stub server platform build on armhf
- 1900. By Chris Halse Rogers
-
Fix unnecessary symbol leakage from server platform modules
- 1901. By Chris Halse Rogers
-
Merge trunk
Unmerged revisions
- 1901. By Chris Halse Rogers
-
Merge trunk
- 1900. By Chris Halse Rogers
-
Fix unnecessary symbol leakage from server platform modules
- 1899. By Chris Halse Rogers
-
Fix stub server platform build on armhf
- 1898. By Chris Halse Rogers
-
Fix random tab character
- 1897. By Chris Halse Rogers
-
Merge trunk, updating the RendererFactory cludge for graphics-stub.so
- 1896. By Chris Halse Rogers
-
Rename, and install client & server stub platforms into mir-test-tools
- 1895. By Chris Halse Rogers
-
Coalesce all hardcoded platform module strings into {client,
server} _platform_ () calls - 1894. By Chris Halse Rogers
-
Fix name for platform-
graphics- dummy.so - 1893. By Chris Halse Rogers
-
Don't throw exception pointers; just throw the exception.
- 1892. By Chris Halse Rogers
-
Add a set of helpers to find the various platform plugins
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-08-21 13:18:01 +0000 |
3 | +++ CMakeLists.txt 2014-08-29 01:18:58 +0000 |
4 | @@ -107,7 +107,7 @@ |
5 | include_directories(include/shared) |
6 | |
7 | # Check for boost |
8 | -find_package(Boost 1.48.0 COMPONENTS date_time system program_options iostreams REQUIRED) |
9 | +find_package(Boost 1.48.0 COMPONENTS date_time system program_options iostreams filesystem REQUIRED) |
10 | include_directories ( |
11 | ${Boost_INCLUDE_DIRS} |
12 | ) |
13 | @@ -159,13 +159,15 @@ |
14 | include_directories (${EGL_INCLUDE_DIRS}) |
15 | include_directories (${GLM_INCLUDE_DIRS}) |
16 | |
17 | +find_package( PkgConfig ) |
18 | + |
19 | if (MIR_BUILD_PLATFORM_ANDROID) |
20 | find_package(AndroidProperties REQUIRED) |
21 | find_package(LibHardware REQUIRED) |
22 | + pkg_check_modules( ANDROID_HEADERS REQUIRED android-headers ) |
23 | endif() |
24 | |
25 | if (MIR_BUILD_PLATFORM_MESA) |
26 | - find_package( PkgConfig ) |
27 | pkg_check_modules( GBM REQUIRED gbm>=9.0.0) |
28 | pkg_check_modules( DRM REQUIRED libdrm ) |
29 | endif() |
30 | |
31 | === modified file 'client-ABI-sha1sums' |
32 | --- client-ABI-sha1sums 2014-08-04 16:01:56 +0000 |
33 | +++ client-ABI-sha1sums 2014-08-29 01:18:58 +0000 |
34 | @@ -12,5 +12,5 @@ |
35 | 183d9e5e6cfe48b3d9145a28541dd4202ff6137b include/shared/mir_toolkit/common.h |
36 | fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/shared/mir_toolkit/cursors.h |
37 | bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/shared/mir_toolkit/event.h |
38 | -99ef5f3bf548508fae24c60f74be1dea018a6e8c include/shared/mir_toolkit/mesa/native_display.h |
39 | +4975998aa1056ed0d39dcc538127453e516ad8e9 include/shared/mir_toolkit/mesa/native_display.h |
40 | 101017c17714a57db57d79b7b5e7df40a3568236 include/shared/mir_toolkit/mir_native_buffer.h |
41 | |
42 | === modified file 'common-ABI-sha1sums' |
43 | --- common-ABI-sha1sums 2014-08-26 16:23:10 +0000 |
44 | +++ common-ABI-sha1sums 2014-08-29 01:18:58 +0000 |
45 | @@ -28,18 +28,22 @@ |
46 | 2319b60bf87801a93af636d3bbfbae420f6776a4 include/shared/mir/logging/dumb_console_logger.h |
47 | 52cb642982f7f4fa623cf041b11eca126a3df0f4 include/shared/mir/logging/input_timestamp.h |
48 | 72e20902d70588af73bea7a524337264b853bf0a include/shared/mir/logging/logger.h |
49 | +2697f3edce3b3120983b402d383bbdead10f5487 include/shared/mir/logging/null_shared_library_prober_report.h |
50 | +e9e5f22fe9deb8965946be0f85ea3d255baca740 include/shared/mir/logging/shared_library_prober_report.h |
51 | f199066a30882b22be901de0c4e6aa62e320e593 include/shared/mir/protobuf/google_protobuf_guard.h |
52 | 4b4b8d7ae1cd870aeec6399afd6dbd56205c80b2 include/shared/mir/raii.h |
53 | bb27ec04b2861d128f420698491941f71e1aefc0 include/shared/mir/recursive_read_write_mutex.h |
54 | 903210453b98267e47c03ab2920c1db047ba0457 include/shared/mir/report/lttng/mir_tracepoint.h |
55 | 52b6b60543a361e91dbeaa2549114239f57b6b4e include/shared/mir/report/lttng/tracepoint_provider.h |
56 | dc80f8a57f133276dd5a72f4d0360a7b71154d16 include/shared/mir/shared_library.h |
57 | +4d80544bf59ef452979b934d664ac592aff58c82 include/shared/mir/shared_library_prober.h |
58 | +53e4159f2a0b564cb39a7785b4e229f6f7424779 include/shared/mir/shared_library_prober_report.h |
59 | b4e96264b9a57a1f2ceceb700c5379658905ded7 include/shared/mir/thread_name.h |
60 | 9907751d046e4aea81881cf19e5df52c7a6a813e include/shared/mir_toolkit/client_types.h |
61 | 183d9e5e6cfe48b3d9145a28541dd4202ff6137b include/shared/mir_toolkit/common.h |
62 | fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/shared/mir_toolkit/cursors.h |
63 | bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/shared/mir_toolkit/event.h |
64 | -99ef5f3bf548508fae24c60f74be1dea018a6e8c include/shared/mir_toolkit/mesa/native_display.h |
65 | +4975998aa1056ed0d39dcc538127453e516ad8e9 include/shared/mir_toolkit/mesa/native_display.h |
66 | 101017c17714a57db57d79b7b5e7df40a3568236 include/shared/mir_toolkit/mir_native_buffer.h |
67 | 9f646fa12eaca5fc3b7a8fde6208673c071c8ef3 include/shared/mir/udev/wrapper.h |
68 | 9fd77ab693cc4c9a200e44804f5493733528a674 include/shared/mir/variable_length_array.h |
69 | |
70 | === modified file 'debian/control' |
71 | --- debian/control 2014-08-26 09:27:49 +0000 |
72 | +++ debian/control 2014-08-29 01:18:58 +0000 |
73 | @@ -19,6 +19,7 @@ |
74 | libboost-program-options-dev, |
75 | libboost-system-dev, |
76 | libboost-iostreams-dev, |
77 | + libboost-filesystem-dev, |
78 | protobuf-compiler, |
79 | libdrm-dev, |
80 | libegl1-mesa-dev, |
81 | @@ -51,8 +52,7 @@ |
82 | Pre-Depends: ${misc:Pre-Depends} |
83 | Depends: ${misc:Depends}, |
84 | ${shlibs:Depends}, |
85 | - libmirplatformgraphics-mesa (= ${binary:Version}) | |
86 | - libmirplatformgraphics-android (= ${binary:Version}), |
87 | + mir-platform-graphics-mesa-1 | mir-platform-graphics-android-1, |
88 | Description: Display server for Ubuntu - server library |
89 | Mir is a display server running on linux systems, with a focus on efficiency, |
90 | robust operation and a well-defined driver model. |
91 | @@ -73,14 +73,13 @@ |
92 | Contains the shared libraries required for the Mir server to interact with |
93 | the underlying hardware platform. |
94 | |
95 | -Package: libmirplatformgraphics-mesa |
96 | +Package: mir-platform-graphics-mesa-1 |
97 | Section: libs |
98 | Architecture: i386 amd64 armhf arm64 |
99 | Multi-Arch: same |
100 | Pre-Depends: ${misc:Pre-Depends} |
101 | Depends: ${misc:Depends}, |
102 | ${shlibs:Depends}, |
103 | - libmirplatform2 (= ${binary:Version}), |
104 | Description: Display server for Ubuntu - platform library for Mesa |
105 | Mir is a display server running on linux systems, with a focus on efficiency, |
106 | robust operation and a well-defined driver model. |
107 | @@ -88,14 +87,13 @@ |
108 | Contains the shared libraries required for the Mir server to interact with |
109 | the hardware platform using the Mesa drivers. |
110 | |
111 | -Package: libmirplatformgraphics-android |
112 | +Package: mir-platform-graphics-android-1 |
113 | Section: libs |
114 | Architecture: i386 amd64 armhf |
115 | Multi-Arch: same |
116 | Pre-Depends: ${misc:Pre-Depends} |
117 | Depends: ${misc:Depends}, |
118 | ${shlibs:Depends}, |
119 | - libmirplatform2 (= ${binary:Version}), |
120 | Description: Display server for Ubuntu - platform library for Android |
121 | Mir is a display server running on linux systems, with a focus on efficiency, |
122 | robust operation and a well-defined driver model. |
123 | @@ -159,8 +157,7 @@ |
124 | Pre-Depends: ${misc:Pre-Depends} |
125 | Depends: ${misc:Depends}, |
126 | ${shlibs:Depends}, |
127 | - libmirclientplatform-mesa (= ${binary:Version}) | |
128 | - libmirclientplatform-android (= ${binary:Version}), |
129 | + mir-client-platform-mesa-1 | mir-client-platform-android-1, |
130 | Description: Display server for Ubuntu - client library |
131 | Mir is a display server running on linux systems, with a focus on efficiency, |
132 | robust operation and a well-defined driver model. |
133 | @@ -182,14 +179,13 @@ |
134 | . |
135 | Contains header files required to develop against Mir. |
136 | |
137 | -Package: libmirclientplatform-mesa |
138 | +Package: mir-client-platform-mesa-1 |
139 | Section: libs |
140 | Architecture: i386 amd64 armhf arm64 |
141 | Multi-Arch: same |
142 | Pre-Depends: ${misc:Pre-Depends} |
143 | Depends: ${misc:Depends}, |
144 | ${shlibs:Depends} |
145 | -Replaces: libmirclientplatform |
146 | Description: Display server for Ubuntu - client platform library for Mesa |
147 | Mir is a display server running on linux systems, with a focus on efficiency, |
148 | robust operation and a well-defined driver model. |
149 | @@ -197,14 +193,13 @@ |
150 | Contains the shared libraries required for the Mir clients to interact with |
151 | the underlying hardware platform using the Mesa drivers. |
152 | |
153 | -Package: libmirclientplatform-android |
154 | +Package: mir-client-platform-android-1 |
155 | Section: libs |
156 | Architecture: i386 amd64 armhf |
157 | Multi-Arch: same |
158 | Pre-Depends: ${misc:Pre-Depends} |
159 | Depends: ${misc:Depends}, |
160 | ${shlibs:Depends} |
161 | -Replaces: libmirclientplatform |
162 | Description: Display server for Ubuntu - client platform library for Android |
163 | Mir is a display server running on linux systems, with a focus on efficiency, |
164 | robust operation and a well-defined driver model. |
165 | |
166 | === removed file 'debian/create_postinst_prerm_scripts.sh' |
167 | --- debian/create_postinst_prerm_scripts.sh 2014-04-15 15:02:05 +0000 |
168 | +++ debian/create_postinst_prerm_scripts.sh 1970-01-01 00:00:00 +0000 |
169 | @@ -1,39 +0,0 @@ |
170 | -#!/bin/sh |
171 | - |
172 | -set -e |
173 | - |
174 | -dpkg_alternatives_priority=500 |
175 | -deb_host_arch=$1 |
176 | -deb_host_multiarch=$2 |
177 | - |
178 | -mir_platform_types="platformgraphics clientplatform" |
179 | -case $deb_host_arch in |
180 | - arm64) |
181 | - mir_platforms="mesa" |
182 | - ;; |
183 | - *) |
184 | - mir_platforms="android mesa" |
185 | - ;; |
186 | -esac |
187 | - |
188 | -create_script() |
189 | -{ |
190 | - local script=$1 |
191 | - local platform_type=$2 |
192 | - local platform=$3 |
193 | - |
194 | - sed -e "s/@DEB_HOST_MULTIARCH@/$deb_host_multiarch/" \ |
195 | - -e "s/@MIR_PLATFORM_TYPE@/$platform_type/" \ |
196 | - -e "s/@MIR_PLATFORM@/$platform/" \ |
197 | - -e "s/@DPKG_ALTERNATIVES_PRIORITY@/$dpkg_alternatives_priority/" \ |
198 | - debian/update-alternatives.${script}.in > debian/libmir$platform_type-$platform.${script} |
199 | -} |
200 | - |
201 | -for platform_type in $mir_platform_types; |
202 | -do |
203 | - for platform in $mir_platforms; |
204 | - do |
205 | - create_script postinst $platform_type $platform |
206 | - create_script prerm $platform_type $platform |
207 | - done |
208 | -done |
209 | |
210 | === removed file 'debian/install_ld_so_conf.sh' |
211 | --- debian/install_ld_so_conf.sh 2014-04-15 15:02:05 +0000 |
212 | +++ debian/install_ld_so_conf.sh 1970-01-01 00:00:00 +0000 |
213 | @@ -1,26 +0,0 @@ |
214 | -#!/bin/sh |
215 | - |
216 | -set -e |
217 | - |
218 | -DEB_HOST_ARCH=$1 |
219 | -DEB_HOST_MULTIARCH=$2 |
220 | - |
221 | -mir_platform_types="platformgraphics clientplatform" |
222 | -case $DEB_HOST_ARCH in |
223 | - arm64) |
224 | - mir_platforms="mesa" |
225 | - ;; |
226 | - *) |
227 | - mir_platforms="android mesa" |
228 | - ;; |
229 | -esac |
230 | - |
231 | -for platform_type in $mir_platform_types; |
232 | -do |
233 | - for platform in $mir_platforms; |
234 | - do |
235 | - platform_dir="/usr/lib/$DEB_HOST_MULTIARCH/mir/$platform_type/$platform" |
236 | - package_dir="debian/libmir$platform_type-$platform/$platform_dir" |
237 | - echo "$platform_dir" > $package_dir/ld.so.conf |
238 | - done |
239 | -done |
240 | |
241 | === renamed file 'debian/libmirclientplatform-android.install' => 'debian/mir-client-platform-android-1.install' |
242 | --- debian/libmirclientplatform-android.install 2014-02-14 08:43:47 +0000 |
243 | +++ debian/mir-client-platform-android-1.install 2014-08-29 01:18:58 +0000 |
244 | @@ -1,1 +1,1 @@ |
245 | -usr/lib/*/mir/clientplatform/android/* |
246 | +usr/lib/*/mir/client-platform-1/client-platform-android.so |
247 | |
248 | === renamed file 'debian/libmirclientplatform-mesa.install' => 'debian/mir-client-platform-mesa-1.install' |
249 | --- debian/libmirclientplatform-mesa.install 2014-02-14 08:43:47 +0000 |
250 | +++ debian/mir-client-platform-mesa-1.install 2014-08-29 01:18:58 +0000 |
251 | @@ -1,1 +1,1 @@ |
252 | -usr/lib/*/mir/clientplatform/mesa/* |
253 | +usr/lib/*/mir/client-platform-1/client-platform-mesa.so |
254 | |
255 | === renamed file 'debian/libmirplatformgraphics-android.install' => 'debian/mir-platform-graphics-android-1.install' |
256 | --- debian/libmirplatformgraphics-android.install 2014-02-14 08:43:47 +0000 |
257 | +++ debian/mir-platform-graphics-android-1.install 2014-08-29 01:18:58 +0000 |
258 | @@ -1,1 +1,1 @@ |
259 | -usr/lib/*/mir/platformgraphics/android/* |
260 | +usr/lib/*/mir/server-platform-1/platform-graphics-android.so |
261 | |
262 | === renamed file 'debian/libmirplatformgraphics-mesa.install' => 'debian/mir-platform-graphics-mesa-1.install' |
263 | --- debian/libmirplatformgraphics-mesa.install 2014-02-14 08:43:47 +0000 |
264 | +++ debian/mir-platform-graphics-mesa-1.install 2014-08-29 01:18:58 +0000 |
265 | @@ -1,1 +1,1 @@ |
266 | -usr/lib/*/mir/platformgraphics/mesa/* |
267 | +usr/lib/*/mir/server-platform-1/platform-graphics-mesa.so |
268 | |
269 | === modified file 'debian/rules' |
270 | --- debian/rules 2014-08-15 08:04:46 +0000 |
271 | +++ debian/rules 2014-08-29 01:18:58 +0000 |
272 | @@ -46,14 +46,3 @@ |
273 | # TODO: we'll use a symbol file once mir is abi stable |
274 | override_dh_makeshlibs: |
275 | dh_makeshlibs -V |
276 | - |
277 | -override_dh_install: |
278 | - dh_install --fail-missing \ |
279 | - -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmirplatformgraphics.so \ |
280 | - -Xusr/lib/$(DEB_HOST_MULTIARCH)/libmirclientplatform.so |
281 | - sh debian/install_ld_so_conf.sh $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH) |
282 | - |
283 | -override_dh_installdeb: |
284 | - sh debian/create_postinst_prerm_scripts.sh \ |
285 | - $(DEB_HOST_ARCH) $(DEB_HOST_MULTIARCH) |
286 | - dh_installdeb |
287 | |
288 | === removed file 'debian/update-alternatives.postinst.in' |
289 | --- debian/update-alternatives.postinst.in 2014-02-14 09:20:28 +0000 |
290 | +++ debian/update-alternatives.postinst.in 1970-01-01 00:00:00 +0000 |
291 | @@ -1,18 +0,0 @@ |
292 | -#!/bin/sh |
293 | - |
294 | -set -e |
295 | - |
296 | -if [ "$1" = "configure" ]; |
297 | -then |
298 | - update-alternatives --force --install \ |
299 | - /etc/ld.so.conf.d/@DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@.conf \ |
300 | - @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \ |
301 | - /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf \ |
302 | - @DPKG_ALTERNATIVES_PRIORITY@ |
303 | - |
304 | - LDCONFIG_NOTRIGGER=y ldconfig |
305 | -fi |
306 | - |
307 | -#DEBHELPER# |
308 | - |
309 | -exit 0 |
310 | |
311 | === removed file 'debian/update-alternatives.prerm.in' |
312 | --- debian/update-alternatives.prerm.in 2014-02-14 09:20:28 +0000 |
313 | +++ debian/update-alternatives.prerm.in 1970-01-01 00:00:00 +0000 |
314 | @@ -1,16 +0,0 @@ |
315 | -#!/bin/sh |
316 | - |
317 | -set -e |
318 | - |
319 | -if [ "$1" = "remove" ]; |
320 | -then |
321 | - update-alternatives --remove \ |
322 | - @DEB_HOST_MULTIARCH@_mir@MIR_PLATFORM_TYPE@_conf \ |
323 | - /usr/lib/@DEB_HOST_MULTIARCH@/mir/@MIR_PLATFORM_TYPE@/@MIR_PLATFORM@/ld.so.conf |
324 | - |
325 | - ldconfig |
326 | -fi |
327 | - |
328 | -#DEBHELPER# |
329 | - |
330 | -exit 0 |
331 | |
332 | === modified file 'include/platform/mir/graphics/platform.h' |
333 | --- include/platform/mir/graphics/platform.h 2014-07-02 06:29:24 +0000 |
334 | +++ include/platform/mir/graphics/platform.h 2014-08-29 01:18:58 +0000 |
335 | @@ -126,6 +126,33 @@ |
336 | }; |
337 | |
338 | /** |
339 | + * A measure of how good this module is at supporting the current device |
340 | + * |
341 | + * \note This is compared as an integer; best + 1 is a valid PlatformPriority that |
342 | + * will be used in preference to a module that reports best. |
343 | + * Platform modules distributed with Mir will never use a priority higher |
344 | + * than best. |
345 | + */ |
346 | +enum PlatformPriority : uint32_t |
347 | +{ |
348 | + unsupported = 0, /**< Unable to function at all on this device */ |
349 | + supported = 128, /**< Capable of providing a functioning Platform on this device, |
350 | + * possibly with degraded performance or features. |
351 | + */ |
352 | + best = 256 /**< Capable of providing a Platform with the best features and |
353 | + * performance this device is capable of. |
354 | + */ |
355 | +}; |
356 | + |
357 | +/** |
358 | + * Describes a platform module |
359 | + */ |
360 | +struct ModuleProperties |
361 | +{ |
362 | + char const* name; |
363 | +}; |
364 | + |
365 | +/** |
366 | * Function prototype used to return a new graphics platform. |
367 | * |
368 | * \param [in] options options to use for this platform |
369 | @@ -148,6 +175,15 @@ |
370 | boost::program_options::options_description& config); |
371 | extern "C" void add_platform_options( |
372 | boost::program_options::options_description& config); |
373 | + |
374 | +// TODO: We actually need to be more granular here; on a device with more |
375 | +// than one graphics system we may need a different platform per GPU, |
376 | +// so we should be associating platforms with graphics devices in some way |
377 | +extern "C" typedef PlatformPriority(*PlatformProbe)(); |
378 | +extern "C" PlatformPriority probe_platform(); |
379 | + |
380 | +extern "C" typedef ModuleProperties const*(*DescribeModule)(); |
381 | +extern "C" ModuleProperties const* describe_module(); |
382 | } |
383 | } |
384 | |
385 | |
386 | === modified file 'include/platform/mir/options/configuration.h' |
387 | --- include/platform/mir/options/configuration.h 2014-08-05 14:19:29 +0000 |
388 | +++ include/platform/mir/options/configuration.h 2014-08-29 01:18:58 +0000 |
389 | @@ -39,6 +39,7 @@ |
390 | extern char const* const connector_report_opt; |
391 | extern char const* const scene_report_opt; |
392 | extern char const* const input_report_opt; |
393 | +extern char const* const shared_library_prober_report_opt; |
394 | extern char const* const host_socket_opt; |
395 | extern char const* const frontend_threads_opt; |
396 | extern char const* const fatal_abort_opt; |
397 | @@ -56,6 +57,7 @@ |
398 | extern char const* const lttng_opt_value; |
399 | |
400 | extern char const* const platform_graphics_lib; |
401 | +extern char const* const platform_graphics_path; |
402 | |
403 | class Configuration |
404 | { |
405 | |
406 | === removed file 'include/platform/mir/shared_library_loader.h' |
407 | --- include/platform/mir/shared_library_loader.h 2014-03-19 17:57:45 +0000 |
408 | +++ include/platform/mir/shared_library_loader.h 1970-01-01 00:00:00 +0000 |
409 | @@ -1,28 +0,0 @@ |
410 | -/* |
411 | - * Copyright © 2013 Canonical Ltd. |
412 | - * |
413 | - * This program is free software: you can redistribute it and/or modify it |
414 | - * under the terms of the GNU Lesser General Public License version 3, |
415 | - * as published by the Free Software Foundation. |
416 | - * |
417 | - * This program is distributed in the hope that it will be useful, |
418 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
419 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
420 | - * GNU Lesser General Public License for more details. |
421 | - * |
422 | - * You should have received a copy of the GNU Lesser General Public License |
423 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
424 | - * |
425 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
426 | - */ |
427 | - |
428 | -#ifndef MIR_SHARED_LIBRARY_LOADER_H_ |
429 | -#define MIR_SHARED_LIBRARY_LOADER_H_ |
430 | - |
431 | -#include <string> |
432 | -namespace mir |
433 | -{ |
434 | -class SharedLibrary; |
435 | -SharedLibrary const* load_library(std::string const& libname); |
436 | -} |
437 | -#endif |
438 | |
439 | === modified file 'include/server/mir/default_server_configuration.h' |
440 | --- include/server/mir/default_server_configuration.h 2014-08-07 10:27:18 +0000 |
441 | +++ include/server/mir/default_server_configuration.h 2014-08-29 01:18:58 +0000 |
442 | @@ -35,6 +35,7 @@ |
443 | namespace mir |
444 | { |
445 | class ServerActionQueue; |
446 | +class SharedLibraryProberReport; |
447 | |
448 | namespace compositor |
449 | { |
450 | @@ -307,6 +308,7 @@ |
451 | |
452 | virtual std::shared_ptr<time::Clock> the_clock(); |
453 | virtual std::shared_ptr<ServerActionQueue> the_server_action_queue(); |
454 | + virtual std::shared_ptr<SharedLibraryProberReport> the_shared_library_prober_report(); |
455 | |
456 | protected: |
457 | std::shared_ptr<options::Option> the_options() const; |
458 | @@ -407,6 +409,7 @@ |
459 | CachedPtr<scene::SessionCoordinator> session_coordinator; |
460 | CachedPtr<EmergencyCleanup> emergency_cleanup; |
461 | CachedPtr<shell::HostLifecycleEventListener> host_lifecycle_event_listener; |
462 | + CachedPtr<SharedLibraryProberReport> shared_library_prober_report; |
463 | |
464 | private: |
465 | std::shared_ptr<options::Configuration> const configuration_options; |
466 | |
467 | === added file 'include/shared/mir/logging/null_shared_library_prober_report.h' |
468 | --- include/shared/mir/logging/null_shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
469 | +++ include/shared/mir/logging/null_shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
470 | @@ -0,0 +1,49 @@ |
471 | +/* |
472 | + * Copyright © 2014 Canonical Ltd. |
473 | + * |
474 | + * This program is free software: you can redistribute it and/or modify |
475 | + * it under the terms of the GNU Lesser General Public License version 3 as |
476 | + * published by the Free Software Foundation. |
477 | + * |
478 | + * This program is distributed in the hope that it will be useful, |
479 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
480 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
481 | + * GNU Lesser General Public License for more details. |
482 | + * |
483 | + * You should have received a copy of the GNU Lesser General Public License |
484 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
485 | + * |
486 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
487 | + */ |
488 | + |
489 | +#ifndef MIR_LOGGING_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ |
490 | +#define MIR_LOGGING_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ |
491 | + |
492 | +#include "mir/shared_library_prober_report.h" |
493 | + |
494 | +namespace mir |
495 | +{ |
496 | +namespace logging |
497 | +{ |
498 | + |
499 | +class NullSharedLibraryProberReport : public mir::SharedLibraryProberReport |
500 | +{ |
501 | +public: |
502 | + void probing_path(boost::filesystem::path const& /*path*/) override |
503 | + { |
504 | + } |
505 | + void probing_failed(boost::filesystem::path const& /*path*/, std::exception const& /*error*/) override |
506 | + { |
507 | + } |
508 | + void loading_library(boost::filesystem::path const& /*filename*/) override |
509 | + { |
510 | + } |
511 | + void loading_failed(boost::filesystem::path const& /*filename*/, std::exception const& /*error*/) override |
512 | + { |
513 | + } |
514 | +}; |
515 | + |
516 | +} |
517 | +} |
518 | + |
519 | +#endif /* MIR_LOGGING_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ */ |
520 | |
521 | === added file 'include/shared/mir/logging/shared_library_prober_report.h' |
522 | --- include/shared/mir/logging/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
523 | +++ include/shared/mir/logging/shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
524 | @@ -0,0 +1,48 @@ |
525 | +/* |
526 | + * Copyright © 2014 Canonical Ltd. |
527 | + * |
528 | + * This program is free software: you can redistribute it and/or modify |
529 | + * it under the terms of the GNU Lesser General Public License version 3 as |
530 | + * published by the Free Software Foundation. |
531 | + * |
532 | + * This program is distributed in the hope that it will be useful, |
533 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
534 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
535 | + * GNU Lesser General Public License for more details. |
536 | + * |
537 | + * You should have received a copy of the GNU Lesser General Public License |
538 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
539 | + * |
540 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
541 | + */ |
542 | + |
543 | +#ifndef MIR_LOGGING_SHARED_LIBRARY_PROBER_REPORT_H_ |
544 | +#define MIR_LOGGING_SHARED_LIBRARY_PROBER_REPORT_H_ |
545 | + |
546 | +#include "mir/shared_library_prober_report.h" |
547 | +#include <memory> |
548 | + |
549 | +namespace mir |
550 | +{ |
551 | +namespace logging |
552 | +{ |
553 | +class Logger; |
554 | + |
555 | +class SharedLibraryProberReport : public mir::SharedLibraryProberReport |
556 | +{ |
557 | +public: |
558 | + SharedLibraryProberReport(std::shared_ptr<Logger> const& logger); |
559 | + |
560 | + void probing_path(boost::filesystem::path const& path) override; |
561 | + void probing_failed(boost::filesystem::path const& path, std::exception const& error) override; |
562 | + void loading_library(boost::filesystem::path const& filename) override; |
563 | + void loading_failed(boost::filesystem::path const& filename, std::exception const& error) override; |
564 | + |
565 | +private: |
566 | + std::shared_ptr<Logger> const logger; |
567 | +}; |
568 | + |
569 | +} |
570 | +} |
571 | + |
572 | +#endif /* MIR_LOGGING_SHARED_LIBRARY_PROBER_REPORT_H_ */ |
573 | |
574 | === added file 'include/shared/mir/shared_library_prober.h' |
575 | --- include/shared/mir/shared_library_prober.h 1970-01-01 00:00:00 +0000 |
576 | +++ include/shared/mir/shared_library_prober.h 2014-08-29 01:18:58 +0000 |
577 | @@ -0,0 +1,36 @@ |
578 | +/* |
579 | + * Copyright © 2014 Canonical Ltd. |
580 | + * |
581 | + * This program is free software: you can redistribute it and/or modify it |
582 | + * under the terms of the GNU Lesser General Public License version 3, |
583 | + * as published by the Free Software Foundation. |
584 | + * |
585 | + * This program is distributed in the hope that it will be useful, |
586 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
587 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
588 | + * GNU Lesser General Public License for more details. |
589 | + * |
590 | + * You should have received a copy of the GNU Lesser General Public License |
591 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
592 | + * |
593 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
594 | + */ |
595 | + |
596 | +#ifndef MIR_SHARED_LIBRARY_PROBER_H_ |
597 | +#define MIR_SHARED_LIBRARY_PROBER_H_ |
598 | + |
599 | +#include "shared_library_prober_report.h" |
600 | + |
601 | +#include <string> |
602 | +#include <vector> |
603 | +#include <memory> |
604 | + |
605 | +namespace mir |
606 | +{ |
607 | +class SharedLibrary; |
608 | + |
609 | +std::vector<std::shared_ptr<SharedLibrary>> libraries_for_path(std::string const& path, SharedLibraryProberReport& report); |
610 | +} |
611 | + |
612 | + |
613 | +#endif /* MIR_SHARED_LIBRARY_PROBER_H_ */ |
614 | |
615 | === added file 'include/shared/mir/shared_library_prober_report.h' |
616 | --- include/shared/mir/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
617 | +++ include/shared/mir/shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
618 | @@ -0,0 +1,44 @@ |
619 | +/* |
620 | + * Copyright © 2014 Canonical Ltd. |
621 | + * |
622 | + * This program is free software: you can redistribute it and/or modify it |
623 | + * under the terms of the GNU Lesser General Public License version 3, |
624 | + * as published by the Free Software Foundation. |
625 | + * |
626 | + * This program is distributed in the hope that it will be useful, |
627 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
628 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
629 | + * GNU Lesser General Public License for more details. |
630 | + * |
631 | + * You should have received a copy of the GNU Lesser General Public License |
632 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
633 | + * |
634 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
635 | + */ |
636 | + |
637 | +#ifndef MIR_SHARED_LIBRARY_PROBER_REPORT_H_ |
638 | +#define MIR_SHARED_LIBRARY_PROBER_REPORT_H_ |
639 | + |
640 | +#include <boost/filesystem.hpp> |
641 | + |
642 | +namespace mir |
643 | +{ |
644 | +class SharedLibraryProberReport |
645 | +{ |
646 | +public: |
647 | + virtual ~SharedLibraryProberReport() = default; |
648 | + |
649 | + virtual void probing_path(boost::filesystem::path const& path) = 0; |
650 | + virtual void probing_failed(boost::filesystem::path const& path, std::exception const& error) = 0; |
651 | + virtual void loading_library(boost::filesystem::path const& filename) = 0; |
652 | + virtual void loading_failed(boost::filesystem::path const& filename, std::exception const& error) = 0; |
653 | + |
654 | +protected: |
655 | + SharedLibraryProberReport() = default; |
656 | + SharedLibraryProberReport(SharedLibraryProberReport const&) = delete; |
657 | + SharedLibraryProberReport& operator=(SharedLibraryProberReport const&) = delete; |
658 | +}; |
659 | +} |
660 | + |
661 | + |
662 | +#endif /* MIR_SHARED_LIBRARY_PROBER_REPORT_H_ */ |
663 | |
664 | === modified file 'include/shared/mir_toolkit/mesa/native_display.h' |
665 | --- include/shared/mir_toolkit/mesa/native_display.h 2013-08-28 03:41:48 +0000 |
666 | +++ include/shared/mir_toolkit/mesa/native_display.h 2014-08-29 01:18:58 +0000 |
667 | @@ -39,7 +39,7 @@ |
668 | struct MirMesaEGLNativeDisplay |
669 | { |
670 | int (*display_get_platform)(MirMesaEGLNativeDisplay* display, |
671 | - MirPlatformPackage* package); |
672 | + MirPlatformPackage* package); |
673 | void *context; |
674 | }; |
675 | |
676 | @@ -47,9 +47,9 @@ |
677 | { |
678 | int (*surface_set_swapinterval)(MirMesaEGLNativeSurface* surface, int interval); |
679 | int (*surface_advance_buffer)(MirMesaEGLNativeSurface* surface, |
680 | - MirBufferPackage* buffer_package); |
681 | + MirBufferPackage* buffer_package); |
682 | int (*surface_get_parameters)(MirMesaEGLNativeSurface* surface, |
683 | - MirSurfaceParameters* surface_parameters); |
684 | + MirSurfaceParameters* surface_parameters); |
685 | }; |
686 | |
687 | typedef int (*MirMesaEGLNativeDisplayIsValidFunc)(MirMesaEGLNativeDisplay* display); |
688 | |
689 | === modified file 'include/test/mir_test_doubles/mock_android_alloc_device.h' |
690 | --- include/test/mir_test_doubles/mock_android_alloc_device.h 2013-06-18 08:00:49 +0000 |
691 | +++ include/test/mir_test_doubles/mock_android_alloc_device.h 2014-08-29 01:18:58 +0000 |
692 | @@ -19,7 +19,12 @@ |
693 | #define MIR_TEST_DOUBLES_MOCK_ANDROID_ALLOC_DEVICE_H_ |
694 | |
695 | #include <gmock/gmock.h> |
696 | + |
697 | +#pragma GCC diagnostic push |
698 | +#pragma GCC diagnostic ignored "-Wpedantic" |
699 | +#pragma GCC diagnostic ignored "-Wunused-parameter" |
700 | #include <hardware/gralloc.h> |
701 | +#pragma GCC diagnostic pop |
702 | |
703 | namespace mir |
704 | { |
705 | |
706 | === modified file 'include/test/mir_test_doubles/mock_android_hw.h' |
707 | --- include/test/mir_test_doubles/mock_android_hw.h 2013-05-20 15:55:48 +0000 |
708 | +++ include/test/mir_test_doubles/mock_android_hw.h 2014-08-29 01:18:58 +0000 |
709 | @@ -21,7 +21,12 @@ |
710 | #include "mir_test_doubles/mock_android_alloc_device.h" |
711 | #include "mir_test_doubles/mock_hwc_composer_device_1.h" |
712 | |
713 | +#pragma GCC diagnostic push |
714 | +#pragma GCC diagnostic ignored "-Wpedantic" |
715 | +#pragma GCC diagnostic ignored "-Wunused-parameter" |
716 | #include <hardware/hardware.h> |
717 | +#pragma GCC diagnostic pop |
718 | + |
719 | #include <gmock/gmock.h> |
720 | #include <memory> |
721 | |
722 | |
723 | === modified file 'include/test/mir_test_doubles/mock_hwc_composer_device_1.h' |
724 | --- include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-03-26 05:48:59 +0000 |
725 | +++ include/test/mir_test_doubles/mock_hwc_composer_device_1.h 2014-08-29 01:18:58 +0000 |
726 | @@ -19,7 +19,12 @@ |
727 | #ifndef MIR_TEST_DOUBLES_MOCK_HWC_COMPOSER_DEVICE_1_H_ |
728 | #define MIR_TEST_DOUBLES_MOCK_HWC_COMPOSER_DEVICE_1_H_ |
729 | |
730 | +#pragma GCC diagnostic push |
731 | +#pragma GCC diagnostic ignored "-Wpedantic" |
732 | +#pragma GCC diagnostic ignored "-Wunused-parameter" |
733 | #include <hardware/hwcomposer.h> |
734 | +#pragma GCC diagnostic pop |
735 | + |
736 | #include <gmock/gmock.h> |
737 | |
738 | namespace mir |
739 | |
740 | === added file 'include/test/mir_test_framework/client_platform_factory.h' |
741 | --- include/test/mir_test_framework/client_platform_factory.h 1970-01-01 00:00:00 +0000 |
742 | +++ include/test/mir_test_framework/client_platform_factory.h 2014-08-29 01:18:58 +0000 |
743 | @@ -0,0 +1,72 @@ |
744 | +/* |
745 | + * Copyright © 2014 Canonical Ltd. |
746 | + * |
747 | + * This program is free software: you can redistribute it and/or modify |
748 | + * it under the terms of the GNU General Public License version 3 as |
749 | + * published by the Free Software Foundation. |
750 | + * |
751 | + * This program is distributed in the hope that it will be useful, |
752 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
753 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
754 | + * GNU General Public License for more details. |
755 | + * |
756 | + * You should have received a copy of the GNU General Public License |
757 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
758 | + * |
759 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
760 | + */ |
761 | + |
762 | +#ifndef MIR_TEST_FRAMEWORK_CLIENT_PLATFORM_FACTORY_H_ |
763 | +#define MIR_TEST_FRAMEWORK_CLIENT_PLATFORM_FACTORY_H_ |
764 | + |
765 | + |
766 | +#include "mir/shared_library.h" |
767 | +#include "src/client/client_platform_factory.h" |
768 | +#include "executable_path.h" |
769 | +#include "mir_test_doubles/mock_client_context.h" |
770 | + |
771 | +namespace mtd = mir::test::doubles; |
772 | + |
773 | +namespace mir_test_framework |
774 | +{ |
775 | +std::shared_ptr<mir::SharedLibrary> platform_library; |
776 | + |
777 | +std::shared_ptr<mir::client::ClientPlatform> create_android_client_platform() |
778 | +{ |
779 | + using namespace testing; |
780 | + mtd::MockClientContext ctx; |
781 | + ON_CALL(ctx, populate(_)) |
782 | + .WillByDefault(Invoke([](MirPlatformPackage& package) { ::memset(&package, 0, sizeof(package)); })); |
783 | + platform_library = std::make_shared<mir::SharedLibrary>(library_path() + "/client-platform-android.so"); |
784 | + auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform"); |
785 | + return platform_factory(&ctx); |
786 | +} |
787 | + |
788 | +std::shared_ptr<mir::client::ClientPlatform> create_mesa_client_platform() |
789 | +{ |
790 | + using namespace testing; |
791 | + mtd::MockClientContext ctx; |
792 | + ON_CALL(ctx, populate(_)) |
793 | + .WillByDefault(Invoke([](MirPlatformPackage& package) |
794 | + { |
795 | + ::memset(&package, 0, sizeof(package)); |
796 | + package.fd_items = 1; |
797 | + })); |
798 | + platform_library = std::make_shared<mir::SharedLibrary>(library_path() + "/client-platform-mesa.so"); |
799 | + auto platform_factory = platform_library->load_function<mir::client::CreateClientPlatform>("create_client_platform"); |
800 | + return platform_factory(&ctx); |
801 | +} |
802 | + |
803 | +std::shared_ptr<mir::SharedLibrary> |
804 | +get_platform_library() |
805 | +{ |
806 | + if (!platform_library) |
807 | + { |
808 | + throw std::logic_error{"Must call one of create_*_client_platform() before calling get_platform_library()"}; |
809 | + } |
810 | + return platform_library; |
811 | +} |
812 | + |
813 | +} |
814 | + |
815 | +#endif // MIR_TEST_FRAMEWORK_CLIENT_PLATFORM_FACTORY_H_ |
816 | |
817 | === modified file 'include/test/mir_test_framework/executable_path.h' |
818 | --- include/test/mir_test_framework/executable_path.h 2014-07-29 12:28:04 +0000 |
819 | +++ include/test/mir_test_framework/executable_path.h 2014-08-29 01:18:58 +0000 |
820 | @@ -24,5 +24,7 @@ |
821 | namespace mir_test_framework |
822 | { |
823 | std::string executable_path(); |
824 | + |
825 | +std::string library_path(); |
826 | } |
827 | #endif /* MIR_TEST_FRAMEWORK_EXECUTABLE_PATH_H_ */ |
828 | |
829 | === added file 'include/test/mir_test_framework/stub_client_platform_factory.h' |
830 | --- include/test/mir_test_framework/stub_client_platform_factory.h 1970-01-01 00:00:00 +0000 |
831 | +++ include/test/mir_test_framework/stub_client_platform_factory.h 2014-08-29 01:18:58 +0000 |
832 | @@ -0,0 +1,33 @@ |
833 | +/* |
834 | + * Copyright © 2014 Canonical Ltd. |
835 | + * |
836 | + * This program is free software: you can redistribute it and/or modify it |
837 | + * under the terms of the GNU General Public License version 3, |
838 | + * as published by the Free Software Foundation. |
839 | + * |
840 | + * This program is distributed in the hope that it will be useful, |
841 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
842 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
843 | + * GNU General Public License for more details. |
844 | + * |
845 | + * You should have received a copy of the GNU General Public License |
846 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
847 | + * |
848 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
849 | + */ |
850 | + |
851 | +#ifndef MIR_TEST_FRAMEWORK_STUB_CLIENT_PLATFORM_FACTORY_ |
852 | +#define MIR_TEST_FRAMEWORK_STUB_CLIENT_PLATFORM_FACTORY_ |
853 | + |
854 | +#include "src/client/client_platform_factory.h" |
855 | + |
856 | +namespace mir_test_framework |
857 | +{ |
858 | + |
859 | +struct StubClientPlatformFactory : public mir::client::ClientPlatformFactory |
860 | +{ |
861 | + std::shared_ptr<mir::client::ClientPlatform> create_client_platform(mir::client::ClientContext* context) override; |
862 | +}; |
863 | + |
864 | +} |
865 | +#endif /* MIR_TEST_FRAMEWORK_STUB_CLIENT_PLATFORM_ */ |
866 | |
867 | === modified file 'platform-ABI-sha1sums' |
868 | --- platform-ABI-sha1sums 2014-08-26 20:03:10 +0000 |
869 | +++ platform-ABI-sha1sums 2014-08-29 01:18:58 +0000 |
870 | @@ -33,15 +33,14 @@ |
871 | 590572a9d86a9481b4531ad44414c6f76352fe7a include/platform/mir/graphics/nested_context.h |
872 | 27807b8ba288590f3749cfb32512eda4d0de6c7d include/platform/mir/graphics/overlapping_output_grouping.h |
873 | 32c70ee44b8dc9372dec0c54471aa8d831adcb1c include/platform/mir/graphics/pixel_format_utils.h |
874 | -656a7e1ae3b246930431a6174526fbdc2c76649e include/platform/mir/graphics/platform.h |
875 | +e317f93ccaf160d507908b92a91745e61e550793 include/platform/mir/graphics/platform.h |
876 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h |
877 | 15f201741a465de33e55ffc1ea775b507a5be950 include/platform/mir/graphics/renderable.h |
878 | 4b640ec72b04cc2de7671afd7c78942fb9e775a7 include/platform/mir/graphics/tessellation_helpers.h |
879 | -8f172d1449f9aa7bbcb1eebb463b0cab4cab38fe include/platform/mir/options/configuration.h |
880 | +d84a16fe115bdc37b2177aa1dbf078da78ba08ac include/platform/mir/options/configuration.h |
881 | 3a961c5e85b0b9d20eadddd938677776288c06c6 include/platform/mir/options/default_configuration.h |
882 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
883 | 1133726e66a246bd3988616e205e186278a64731 include/platform/mir/options/program_option.h |
884 | -5d0213652adc4821a2a180ced74808ca0bbf2c45 include/platform/mir/shared_library_loader.h |
885 | 6ad1f35928df9ffd917fbf17cbcdd533a8b5b27d include/shared/mir/basic_observers.h |
886 | 3329ada91412ded2f127aee9a92f065e57b81cb2 include/shared/mir/cached_ptr.h |
887 | 691278e8b89265fa7f11db78dc8a9b530cef6e99 include/shared/mir/default_configuration.h |
888 | @@ -72,18 +71,22 @@ |
889 | 2319b60bf87801a93af636d3bbfbae420f6776a4 include/shared/mir/logging/dumb_console_logger.h |
890 | 52cb642982f7f4fa623cf041b11eca126a3df0f4 include/shared/mir/logging/input_timestamp.h |
891 | 72e20902d70588af73bea7a524337264b853bf0a include/shared/mir/logging/logger.h |
892 | +2697f3edce3b3120983b402d383bbdead10f5487 include/shared/mir/logging/null_shared_library_prober_report.h |
893 | +e9e5f22fe9deb8965946be0f85ea3d255baca740 include/shared/mir/logging/shared_library_prober_report.h |
894 | f199066a30882b22be901de0c4e6aa62e320e593 include/shared/mir/protobuf/google_protobuf_guard.h |
895 | 4b4b8d7ae1cd870aeec6399afd6dbd56205c80b2 include/shared/mir/raii.h |
896 | bb27ec04b2861d128f420698491941f71e1aefc0 include/shared/mir/recursive_read_write_mutex.h |
897 | 903210453b98267e47c03ab2920c1db047ba0457 include/shared/mir/report/lttng/mir_tracepoint.h |
898 | 52b6b60543a361e91dbeaa2549114239f57b6b4e include/shared/mir/report/lttng/tracepoint_provider.h |
899 | dc80f8a57f133276dd5a72f4d0360a7b71154d16 include/shared/mir/shared_library.h |
900 | +4d80544bf59ef452979b934d664ac592aff58c82 include/shared/mir/shared_library_prober.h |
901 | +53e4159f2a0b564cb39a7785b4e229f6f7424779 include/shared/mir/shared_library_prober_report.h |
902 | b4e96264b9a57a1f2ceceb700c5379658905ded7 include/shared/mir/thread_name.h |
903 | 9907751d046e4aea81881cf19e5df52c7a6a813e include/shared/mir_toolkit/client_types.h |
904 | 183d9e5e6cfe48b3d9145a28541dd4202ff6137b include/shared/mir_toolkit/common.h |
905 | fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/shared/mir_toolkit/cursors.h |
906 | bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/shared/mir_toolkit/event.h |
907 | -99ef5f3bf548508fae24c60f74be1dea018a6e8c include/shared/mir_toolkit/mesa/native_display.h |
908 | +4975998aa1056ed0d39dcc538127453e516ad8e9 include/shared/mir_toolkit/mesa/native_display.h |
909 | 101017c17714a57db57d79b7b5e7df40a3568236 include/shared/mir_toolkit/mir_native_buffer.h |
910 | 9f646fa12eaca5fc3b7a8fde6208673c071c8ef3 include/shared/mir/udev/wrapper.h |
911 | 9fd77ab693cc4c9a200e44804f5493733528a674 include/shared/mir/variable_length_array.h |
912 | |
913 | === modified file 'server-ABI-sha1sums' |
914 | --- server-ABI-sha1sums 2014-08-26 20:03:10 +0000 |
915 | +++ server-ABI-sha1sums 2014-08-29 01:18:58 +0000 |
916 | @@ -33,15 +33,14 @@ |
917 | 590572a9d86a9481b4531ad44414c6f76352fe7a include/platform/mir/graphics/nested_context.h |
918 | 27807b8ba288590f3749cfb32512eda4d0de6c7d include/platform/mir/graphics/overlapping_output_grouping.h |
919 | 32c70ee44b8dc9372dec0c54471aa8d831adcb1c include/platform/mir/graphics/pixel_format_utils.h |
920 | -656a7e1ae3b246930431a6174526fbdc2c76649e include/platform/mir/graphics/platform.h |
921 | +e317f93ccaf160d507908b92a91745e61e550793 include/platform/mir/graphics/platform.h |
922 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h |
923 | 15f201741a465de33e55ffc1ea775b507a5be950 include/platform/mir/graphics/renderable.h |
924 | 4b640ec72b04cc2de7671afd7c78942fb9e775a7 include/platform/mir/graphics/tessellation_helpers.h |
925 | -8f172d1449f9aa7bbcb1eebb463b0cab4cab38fe include/platform/mir/options/configuration.h |
926 | +d84a16fe115bdc37b2177aa1dbf078da78ba08ac include/platform/mir/options/configuration.h |
927 | 3a961c5e85b0b9d20eadddd938677776288c06c6 include/platform/mir/options/default_configuration.h |
928 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
929 | 1133726e66a246bd3988616e205e186278a64731 include/platform/mir/options/program_option.h |
930 | -5d0213652adc4821a2a180ced74808ca0bbf2c45 include/platform/mir/shared_library_loader.h |
931 | 505444aeb61d0f55893a7ba0998b25c2041f76c4 include/server/mir/asio_main_loop.h |
932 | a4c8f0b0c30784ea6930a8ee6651f1d6efa47231 include/server/mir/compositor/buffer_stream.h |
933 | f4030e400baf8baa9c38e7c6ec6b4a5ad7134aeb include/server/mir/compositor/compositor.h |
934 | @@ -58,7 +57,7 @@ |
935 | 51391bd29f7499f8cbb89e4ba33acf2b72d93592 include/server/mir/compositor/renderer.h |
936 | 686a839fd0cd5fa469344dc49190ff9d578efc25 include/server/mir/compositor/scene_element.h |
937 | 4fcf34e424128b87ddc76733594e32e09ebbd486 include/server/mir/compositor/scene.h |
938 | -f102d38fd8afd63b636d76005f9b80f3adda0858 include/server/mir/default_server_configuration.h |
939 | +d69ff1401221ffa9adce7f8d85074a6f8b234baf include/server/mir/default_server_configuration.h |
940 | bbb15c910dbc8d7c9a4cc982890486b7e16197e4 include/server/mir/default_server_status_listener.h |
941 | 215f6cf88826381cd3ec37a6d2179a70093c0bc5 include/server/mir/display_changer.h |
942 | af1ff0714be973ac76d56006a2e5991f68cd1dec include/server/mir/display_server.h |
943 | @@ -181,18 +180,22 @@ |
944 | 2319b60bf87801a93af636d3bbfbae420f6776a4 include/shared/mir/logging/dumb_console_logger.h |
945 | 52cb642982f7f4fa623cf041b11eca126a3df0f4 include/shared/mir/logging/input_timestamp.h |
946 | 72e20902d70588af73bea7a524337264b853bf0a include/shared/mir/logging/logger.h |
947 | +2697f3edce3b3120983b402d383bbdead10f5487 include/shared/mir/logging/null_shared_library_prober_report.h |
948 | +e9e5f22fe9deb8965946be0f85ea3d255baca740 include/shared/mir/logging/shared_library_prober_report.h |
949 | f199066a30882b22be901de0c4e6aa62e320e593 include/shared/mir/protobuf/google_protobuf_guard.h |
950 | 4b4b8d7ae1cd870aeec6399afd6dbd56205c80b2 include/shared/mir/raii.h |
951 | bb27ec04b2861d128f420698491941f71e1aefc0 include/shared/mir/recursive_read_write_mutex.h |
952 | 903210453b98267e47c03ab2920c1db047ba0457 include/shared/mir/report/lttng/mir_tracepoint.h |
953 | 52b6b60543a361e91dbeaa2549114239f57b6b4e include/shared/mir/report/lttng/tracepoint_provider.h |
954 | dc80f8a57f133276dd5a72f4d0360a7b71154d16 include/shared/mir/shared_library.h |
955 | +4d80544bf59ef452979b934d664ac592aff58c82 include/shared/mir/shared_library_prober.h |
956 | +53e4159f2a0b564cb39a7785b4e229f6f7424779 include/shared/mir/shared_library_prober_report.h |
957 | b4e96264b9a57a1f2ceceb700c5379658905ded7 include/shared/mir/thread_name.h |
958 | 9907751d046e4aea81881cf19e5df52c7a6a813e include/shared/mir_toolkit/client_types.h |
959 | 183d9e5e6cfe48b3d9145a28541dd4202ff6137b include/shared/mir_toolkit/common.h |
960 | fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/shared/mir_toolkit/cursors.h |
961 | bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/shared/mir_toolkit/event.h |
962 | -99ef5f3bf548508fae24c60f74be1dea018a6e8c include/shared/mir_toolkit/mesa/native_display.h |
963 | +4975998aa1056ed0d39dcc538127453e516ad8e9 include/shared/mir_toolkit/mesa/native_display.h |
964 | 101017c17714a57db57d79b7b5e7df40a3568236 include/shared/mir_toolkit/mir_native_buffer.h |
965 | 9f646fa12eaca5fc3b7a8fde6208673c071c8ef3 include/shared/mir/udev/wrapper.h |
966 | 9fd77ab693cc4c9a200e44804f5493733528a674 include/shared/mir/variable_length_array.h |
967 | |
968 | === modified file 'src/client/CMakeLists.txt' |
969 | --- src/client/CMakeLists.txt 2014-08-25 03:11:01 +0000 |
970 | +++ src/client/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
971 | @@ -16,6 +16,16 @@ |
972 | ${DRM_INCLUDE_DIRS} |
973 | ) |
974 | |
975 | +set(MIRCLIENT_ABI 8) |
976 | +set(MIRCLIENT_PLATFORM_ABI 1) |
977 | +set(symbol_map ${CMAKE_SOURCE_DIR}/src/client/symbols.map) |
978 | + |
979 | +set(MIR_CLIENT_PLATFORM_PATH |
980 | + ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/mir/client-platform-${MIRCLIENT_PLATFORM_ABI} |
981 | +) |
982 | + |
983 | +add_definitions(-DMIR_CLIENT_PLATFORM_PATH="${MIR_CLIENT_PLATFORM_PATH}/") |
984 | + |
985 | add_subdirectory(rpc/) |
986 | add_subdirectory(lttng/) |
987 | |
988 | @@ -54,6 +64,7 @@ |
989 | mir_prompt_session.cpp |
990 | mir_prompt_session_api.cpp |
991 | mir_event_distributor.cpp |
992 | + probing_client_platform_factory.cpp |
993 | ) |
994 | |
995 | add_library( |
996 | @@ -62,9 +73,6 @@ |
997 | $<TARGET_OBJECTS:mirclientobjects> |
998 | ) |
999 | |
1000 | -set(MIRCLIENT_ABI 8) |
1001 | -set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
1002 | - |
1003 | set_target_properties( |
1004 | mirclient |
1005 | |
1006 | @@ -73,8 +81,9 @@ |
1007 | LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
1008 | ) |
1009 | |
1010 | -set( |
1011 | - MIR_CLIENT_LIBRARIES |
1012 | +target_link_libraries( |
1013 | + mirclient |
1014 | + |
1015 | mirclientrpc |
1016 | mirclientlttngstatic |
1017 | mircommon |
1018 | @@ -84,12 +93,6 @@ |
1019 | ${XKBCOMMON_LIBRARIES} |
1020 | ) |
1021 | |
1022 | -target_link_libraries( |
1023 | - mirclient |
1024 | - |
1025 | - ${MIR_CLIENT_LIBRARIES} |
1026 | -) |
1027 | - |
1028 | install( |
1029 | TARGETS mirclient |
1030 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
1031 | |
1032 | === modified file 'src/client/android/CMakeLists.txt' |
1033 | --- src/client/android/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
1034 | +++ src/client/android/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
1035 | @@ -15,17 +15,17 @@ |
1036 | ) |
1037 | |
1038 | add_library( |
1039 | - mirclientplatformandroid SHARED |
1040 | - |
1041 | + mirclientplatformandroid MODULE |
1042 | + |
1043 | $<TARGET_OBJECTS:mirclientplatformandroidobjects> |
1044 | $<TARGET_OBJECTS:mirclient_platformimpl> |
1045 | ) |
1046 | |
1047 | set_target_properties( |
1048 | mirclientplatformandroid PROPERTIES |
1049 | - OUTPUT_NAME mirclientplatform |
1050 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android |
1051 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
1052 | + OUTPUT_NAME client-platform-android |
1053 | + PREFIX "" |
1054 | + LINK_FLAGS "-Wl,--version-script,${symbol_map}" |
1055 | ) |
1056 | |
1057 | target_link_libraries( |
1058 | @@ -35,20 +35,4 @@ |
1059 | ${LIBHARDWARE_LIBRARIES} |
1060 | ) |
1061 | |
1062 | -install(TARGETS mirclientplatformandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/android) |
1063 | - |
1064 | -if (MIR_TEST_PLATFORM STREQUAL "android") |
1065 | - add_custom_command(TARGET mirclientplatformandroid |
1066 | - POST_BUILD |
1067 | - COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so |
1068 | - COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirclientplatformandroid> libmirclientplatform.so |
1069 | - WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
1070 | - ) |
1071 | - |
1072 | - install(CODE |
1073 | - "execute_process( |
1074 | - COMMAND ln -sf mir/clientplatform/android/libmirclientplatform.so |
1075 | - WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
1076 | - )" |
1077 | - ) |
1078 | -endif() |
1079 | +install(TARGETS mirclientplatformandroid LIBRARY DESTINATION ${MIR_CLIENT_PLATFORM_PATH}) |
1080 | |
1081 | === modified file 'src/client/android/android_native_display_container.cpp' |
1082 | --- src/client/android/android_native_display_container.cpp 2014-07-17 13:56:20 +0000 |
1083 | +++ src/client/android/android_native_display_container.cpp 2014-08-29 01:18:58 +0000 |
1084 | @@ -62,16 +62,28 @@ |
1085 | bool |
1086 | mcla::AndroidNativeDisplayContainer::validate(MirEGLNativeDisplayType display) const |
1087 | { |
1088 | - return mir_connection_is_valid(static_cast<MirConnection*>(display)); |
1089 | + std::lock_guard<std::mutex> lg(guard); |
1090 | + return (valid_displays.find(display) != valid_displays.end()); |
1091 | } |
1092 | |
1093 | MirEGLNativeDisplayType |
1094 | -mcla::AndroidNativeDisplayContainer::create(MirConnection* connection) |
1095 | +mcla::AndroidNativeDisplayContainer::create(ClientContext* context) |
1096 | { |
1097 | - return static_cast<MirEGLNativeDisplayType>(connection); |
1098 | + std::lock_guard<std::mutex> lg(guard); |
1099 | + auto egl_display = static_cast<MirEGLNativeDisplayType>(context); |
1100 | + valid_displays.insert(egl_display); |
1101 | + |
1102 | + return egl_display; |
1103 | } |
1104 | |
1105 | void |
1106 | -mcla::AndroidNativeDisplayContainer::release(MirEGLNativeDisplayType /* display */) |
1107 | +mcla::AndroidNativeDisplayContainer::release(MirEGLNativeDisplayType display) |
1108 | { |
1109 | + std::lock_guard<std::mutex> lg(guard); |
1110 | + |
1111 | + auto it = valid_displays.find(display); |
1112 | + if (it == valid_displays.end()) |
1113 | + return; |
1114 | + |
1115 | + valid_displays.erase(it); |
1116 | } |
1117 | |
1118 | === modified file 'src/client/android/android_native_display_container.h' |
1119 | --- src/client/android/android_native_display_container.h 2013-05-02 00:11:18 +0000 |
1120 | +++ src/client/android/android_native_display_container.h 2014-08-29 01:18:58 +0000 |
1121 | @@ -23,6 +23,9 @@ |
1122 | |
1123 | #include "mir_toolkit/client_types.h" |
1124 | |
1125 | +#include <unordered_set> |
1126 | +#include <mutex> |
1127 | + |
1128 | namespace mir |
1129 | { |
1130 | namespace client |
1131 | @@ -36,7 +39,7 @@ |
1132 | AndroidNativeDisplayContainer(); |
1133 | virtual ~AndroidNativeDisplayContainer(); |
1134 | |
1135 | - MirEGLNativeDisplayType create(MirConnection* connection); |
1136 | + MirEGLNativeDisplayType create(ClientContext* context) override; |
1137 | void release(MirEGLNativeDisplayType display); |
1138 | |
1139 | bool validate(MirEGLNativeDisplayType display) const; |
1140 | @@ -44,6 +47,10 @@ |
1141 | protected: |
1142 | AndroidNativeDisplayContainer(AndroidNativeDisplayContainer const&) = delete; |
1143 | AndroidNativeDisplayContainer& operator=(AndroidNativeDisplayContainer const&) = delete; |
1144 | + |
1145 | +private: |
1146 | + std::mutex mutable guard; |
1147 | + std::unordered_set<MirEGLNativeDisplayType> valid_displays; |
1148 | }; |
1149 | |
1150 | } |
1151 | |
1152 | === modified file 'src/client/android/client_platform_factory.cpp' |
1153 | --- src/client/android/client_platform_factory.cpp 2014-02-07 15:43:41 +0000 |
1154 | +++ src/client/android/client_platform_factory.cpp 2014-08-29 01:18:58 +0000 |
1155 | @@ -16,19 +16,35 @@ |
1156 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
1157 | */ |
1158 | |
1159 | -#include "client_platform_factory.h" |
1160 | +#include "../client_platform_factory.h" |
1161 | +#include "mir_toolkit/client_types.h" |
1162 | +#include "../client_context.h" |
1163 | #include "android_client_platform.h" |
1164 | |
1165 | +#include <stdexcept> |
1166 | + |
1167 | namespace mcl = mir::client; |
1168 | namespace mcla = mcl::android; |
1169 | |
1170 | -std::shared_ptr<mcl::ClientPlatform> |
1171 | -mcla::ClientPlatformFactory::create_client_platform(mcl::ClientContext* /*context*/) |
1172 | +extern "C" std::shared_ptr<mcl::ClientPlatform> |
1173 | +mcl::create_client_platform(mcl::ClientContext* context) |
1174 | { |
1175 | + MirPlatformPackage platform; |
1176 | + context->populate(platform); |
1177 | + if (platform.data_items != 0 || platform.fd_items != 0) |
1178 | + { |
1179 | + throw new std::runtime_error{"Attempted to create Android client platform on non-Android server"}; |
1180 | + } |
1181 | return std::make_shared<mcla::AndroidClientPlatform>(); |
1182 | } |
1183 | |
1184 | -extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory() |
1185 | +extern "C" bool |
1186 | +mcl::is_appropriate_module(mcl::ClientContext* context) |
1187 | { |
1188 | - return std::make_shared<mcla::ClientPlatformFactory>(); |
1189 | + MirPlatformPackage platform; |
1190 | + context->populate(platform); |
1191 | + // TODO: Actually check what platform we're using, rather than blindly |
1192 | + // hope we can distinguish them from the stuff they've put in the |
1193 | + // PlatformPackage. |
1194 | + return platform.data_items == 0 && platform.fd_items == 0; |
1195 | } |
1196 | |
1197 | === modified file 'src/client/android/client_platform_factory.h' |
1198 | --- src/client/android/client_platform_factory.h 2014-02-07 15:43:41 +0000 |
1199 | +++ src/client/android/client_platform_factory.h 2014-08-29 01:18:58 +0000 |
1200 | @@ -28,11 +28,8 @@ |
1201 | namespace android |
1202 | { |
1203 | |
1204 | -class ClientPlatformFactory : public client::ClientPlatformFactory |
1205 | -{ |
1206 | -public: |
1207 | - std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override; |
1208 | -}; |
1209 | +extern "C" std::shared_ptr<ClientPlatform> |
1210 | +create_client_platform(ClientContext* context); |
1211 | |
1212 | } |
1213 | } |
1214 | |
1215 | === modified file 'src/client/android/symbols.map' |
1216 | --- src/client/android/symbols.map 2014-08-25 03:11:01 +0000 |
1217 | +++ src/client/android/symbols.map 2014-08-29 01:18:58 +0000 |
1218 | @@ -1,5 +1,6 @@ |
1219 | MIR_CLIENTPLATFORM_1 { |
1220 | global: |
1221 | - create_client_platform_factory; |
1222 | + create_client_platform; |
1223 | + is_appropriate_module; |
1224 | local: *; |
1225 | }; |
1226 | \ No newline at end of file |
1227 | |
1228 | === modified file 'src/client/client_platform_factory.h' |
1229 | --- src/client/client_platform_factory.h 2014-03-06 06:05:17 +0000 |
1230 | +++ src/client/client_platform_factory.h 2014-08-29 01:18:58 +0000 |
1231 | @@ -41,8 +41,11 @@ |
1232 | ClientPlatformFactory& operator=(ClientPlatformFactory const& p) = delete; |
1233 | }; |
1234 | |
1235 | -extern "C" typedef std::shared_ptr<ClientPlatformFactory>(*CreateClientPlatformFactory)(); |
1236 | -extern "C" std::shared_ptr<ClientPlatformFactory> create_client_platform_factory(); |
1237 | +extern "C" typedef std::shared_ptr<ClientPlatform>(*CreateClientPlatform)(ClientContext* context); |
1238 | +extern "C" std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context); |
1239 | + |
1240 | +extern "C" typedef bool (*ClientPlatformProbe)(ClientContext* context); |
1241 | +extern "C" bool is_appropriate_module(ClientContext* context); |
1242 | |
1243 | } |
1244 | } |
1245 | |
1246 | === modified file 'src/client/default_connection_configuration.cpp' |
1247 | --- src/client/default_connection_configuration.cpp 2014-08-26 13:38:23 +0000 |
1248 | +++ src/client/default_connection_configuration.cpp 2014-08-29 01:18:58 +0000 |
1249 | @@ -26,13 +26,18 @@ |
1250 | #include "mir/input/null_input_receiver_report.h" |
1251 | #include "logging/rpc_report.h" |
1252 | #include "logging/input_receiver_report.h" |
1253 | +#include "mir/logging/shared_library_prober_report.h" |
1254 | +#include "mir/logging/null_shared_library_prober_report.h" |
1255 | #include "lttng/rpc_report.h" |
1256 | #include "lttng/input_receiver_report.h" |
1257 | +#include "lttng/shared_library_prober_report.h" |
1258 | #include "connection_surface_map.h" |
1259 | #include "lifecycle_control.h" |
1260 | #include "mir/shared_library.h" |
1261 | #include "client_platform_factory.h" |
1262 | +#include "probing_client_platform_factory.h" |
1263 | #include "mir_event_distributor.h" |
1264 | +#include "mir/shared_library_prober.h" |
1265 | |
1266 | namespace mcl = mir::client; |
1267 | |
1268 | @@ -41,7 +46,14 @@ |
1269 | std::string const off_opt_val{"off"}; |
1270 | std::string const log_opt_val{"log"}; |
1271 | std::string const lttng_opt_val{"lttng"}; |
1272 | +<<<<<<< TREE |
1273 | std::string const default_platform_lib{"libmirclientplatform.so"}; |
1274 | +======= |
1275 | + |
1276 | +// Shove this here until we properly manage the lifetime of our |
1277 | +// loadable modules |
1278 | +std::shared_ptr<mcl::ProbingClientPlatformFactory> the_platform_prober; |
1279 | +>>>>>>> MERGE-SOURCE |
1280 | } |
1281 | |
1282 | mcl::DefaultConnectionConfiguration::DefaultConnectionConfiguration( |
1283 | @@ -86,11 +98,30 @@ |
1284 | return client_platform_factory( |
1285 | [this] |
1286 | { |
1287 | +<<<<<<< TREE |
1288 | auto const create_client_platform_factory = |
1289 | the_platform_library()->load_function<mcl::CreateClientPlatformFactory>( |
1290 | "create_client_platform_factory"); |
1291 | |
1292 | return create_client_platform_factory(); |
1293 | +======= |
1294 | + auto const platform_override = getenv("MIR_CLIENT_PLATFORM_LIB"); |
1295 | + std::vector<std::shared_ptr<mir::SharedLibrary>> platform_plugins; |
1296 | + if (platform_override) |
1297 | + { |
1298 | + platform_plugins.push_back(std::make_shared<mir::SharedLibrary>(platform_override)); |
1299 | + } |
1300 | + else |
1301 | + { |
1302 | + auto const platform_path_override = getenv("MIR_CLIENT_PLATFORM_PATH"); |
1303 | + auto const platform_path = platform_path_override ? platform_path_override : MIR_CLIENT_PLATFORM_PATH; |
1304 | + platform_plugins = mir::libraries_for_path(platform_path, *the_shared_library_prober_report()); |
1305 | + } |
1306 | + |
1307 | + the_platform_prober = std::make_shared<mcl::ProbingClientPlatformFactory>(platform_plugins); |
1308 | + |
1309 | + return the_platform_prober; |
1310 | +>>>>>>> MERGE-SOURCE |
1311 | }); |
1312 | } |
1313 | |
1314 | @@ -181,6 +212,7 @@ |
1315 | return std::make_shared<MirEventDistributor>(); |
1316 | }); |
1317 | } |
1318 | +<<<<<<< TREE |
1319 | |
1320 | std::shared_ptr<mir::SharedLibrary> mcl::DefaultConnectionConfiguration::the_platform_library() |
1321 | { |
1322 | @@ -193,3 +225,22 @@ |
1323 | |
1324 | return platform_library; |
1325 | } |
1326 | +======= |
1327 | + |
1328 | +std::shared_ptr<mir::SharedLibraryProberReport> mir::client::DefaultConnectionConfiguration::the_shared_library_prober_report() |
1329 | +{ |
1330 | + return shared_library_prober_report( |
1331 | + [this] () -> std::shared_ptr<mir::SharedLibraryProberReport> |
1332 | + { |
1333 | + auto val_raw = getenv("MIR_CLIENT_SHARED_LIBRARY_PROBER_REPORT"); |
1334 | + std::string const val{val_raw ? val_raw : off_opt_val}; |
1335 | + |
1336 | + if (val == log_opt_val) |
1337 | + return std::make_shared<mir::logging::SharedLibraryProberReport>(the_logger()); |
1338 | + else if (val == lttng_opt_val) |
1339 | + return std::make_shared<mcl::lttng::SharedLibraryProberReport>(); |
1340 | + else |
1341 | + return std::make_shared<mir::logging::NullSharedLibraryProberReport>(); |
1342 | + }); |
1343 | +} |
1344 | +>>>>>>> MERGE-SOURCE |
1345 | |
1346 | === modified file 'src/client/default_connection_configuration.h' |
1347 | --- src/client/default_connection_configuration.h 2014-08-26 13:38:23 +0000 |
1348 | +++ src/client/default_connection_configuration.h 2014-08-29 01:18:58 +0000 |
1349 | @@ -27,6 +27,8 @@ |
1350 | |
1351 | namespace mir |
1352 | { |
1353 | +class SharedLibraryProberReport; |
1354 | + |
1355 | namespace input |
1356 | { |
1357 | namespace receiver |
1358 | @@ -57,7 +59,11 @@ |
1359 | std::shared_ptr<LifecycleControl> the_lifecycle_control(); |
1360 | std::shared_ptr<EventSink> the_event_sink(); |
1361 | std::shared_ptr<EventHandlerRegister> the_event_handler_register(); |
1362 | +<<<<<<< TREE |
1363 | std::shared_ptr<SharedLibrary> the_platform_library() override; |
1364 | +======= |
1365 | + std::shared_ptr<mir::SharedLibraryProberReport> the_shared_library_prober_report(); |
1366 | +>>>>>>> MERGE-SOURCE |
1367 | |
1368 | virtual std::string the_socket_file(); |
1369 | virtual std::shared_ptr<rpc::RpcReport> the_rpc_report(); |
1370 | @@ -78,6 +84,7 @@ |
1371 | |
1372 | CachedPtr<rpc::RpcReport> rpc_report; |
1373 | CachedPtr<input::receiver::InputReceiverReport> input_receiver_report; |
1374 | + CachedPtr<mir::SharedLibraryProberReport> shared_library_prober_report; |
1375 | |
1376 | private: |
1377 | std::string const socket_file; |
1378 | |
1379 | === modified file 'src/client/egl_native_display_container.h' |
1380 | --- src/client/egl_native_display_container.h 2014-03-06 06:05:17 +0000 |
1381 | +++ src/client/egl_native_display_container.h 2014-08-29 01:18:58 +0000 |
1382 | @@ -26,12 +26,14 @@ |
1383 | namespace client |
1384 | { |
1385 | |
1386 | +class ClientContext; |
1387 | + |
1388 | class EGLNativeDisplayContainer |
1389 | { |
1390 | public: |
1391 | virtual ~EGLNativeDisplayContainer() {} |
1392 | |
1393 | - virtual MirEGLNativeDisplayType create(MirConnection* connection) = 0; |
1394 | + virtual MirEGLNativeDisplayType create(ClientContext* context) = 0; |
1395 | virtual void release(MirEGLNativeDisplayType display) = 0; |
1396 | |
1397 | virtual bool validate(MirEGLNativeDisplayType display) const = 0; |
1398 | |
1399 | === modified file 'src/client/lttng/CMakeLists.txt' |
1400 | --- src/client/lttng/CMakeLists.txt 2014-08-22 02:56:00 +0000 |
1401 | +++ src/client/lttng/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
1402 | @@ -6,6 +6,7 @@ |
1403 | client_tracepoint_provider.cpp |
1404 | rpc_report.cpp |
1405 | input_receiver_report.cpp |
1406 | + shared_library_prober_report.cpp |
1407 | ) |
1408 | |
1409 | add_library(mirclientlttng SHARED tracepoints.c) |
1410 | |
1411 | === added file 'src/client/lttng/shared_library_prober_report.cpp' |
1412 | --- src/client/lttng/shared_library_prober_report.cpp 1970-01-01 00:00:00 +0000 |
1413 | +++ src/client/lttng/shared_library_prober_report.cpp 2014-08-29 01:18:58 +0000 |
1414 | @@ -0,0 +1,50 @@ |
1415 | +/* |
1416 | + * Copyright © 2014 Canonical Ltd. |
1417 | + * |
1418 | + * This program is free software: you can redistribute it and/or modify |
1419 | + * it under the terms of the GNU Lesser General Public License version 3 as |
1420 | + * published by the Free Software Foundation. |
1421 | + * |
1422 | + * This program is distributed in the hope that it will be useful, |
1423 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1424 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1425 | + * GNU Lesser General Public License for more details. |
1426 | + * |
1427 | + * You should have received a copy of the GNU Lesser General Public License |
1428 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1429 | + * |
1430 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
1431 | + */ |
1432 | + |
1433 | +#include "shared_library_prober_report.h" |
1434 | +#include "mir/report/lttng/mir_tracepoint.h" |
1435 | + |
1436 | +#define TRACEPOINT_DEFINE |
1437 | +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE |
1438 | +#include "shared_library_prober_report_tp.h" |
1439 | + |
1440 | +namespace mcl = mir::client; |
1441 | + |
1442 | +void mcl::lttng::SharedLibraryProberReport::probing_path(boost::filesystem::path const& path) |
1443 | +{ |
1444 | + mir_tracepoint(mir_client_shared_library_prober, probing_path, |
1445 | + path.string().c_str()); |
1446 | +} |
1447 | + |
1448 | +void mcl::lttng::SharedLibraryProberReport::probing_failed(boost::filesystem::path const& path, std::exception const& error) |
1449 | +{ |
1450 | + mir_tracepoint(mir_client_shared_library_prober, probing_failed, |
1451 | + path.string().c_str(), error.what()); |
1452 | +} |
1453 | + |
1454 | +void mcl::lttng::SharedLibraryProberReport::loading_library(boost::filesystem::path const& filename) |
1455 | +{ |
1456 | + mir_tracepoint(mir_client_shared_library_prober, loading_library, |
1457 | + filename.string().c_str()); |
1458 | +} |
1459 | + |
1460 | +void mcl::lttng::SharedLibraryProberReport::loading_failed(boost::filesystem::path const& filename, std::exception const& error) |
1461 | +{ |
1462 | + mir_tracepoint(mir_client_shared_library_prober, loading_failed, |
1463 | + filename.string().c_str(), error.what()); |
1464 | +} |
1465 | |
1466 | === added file 'src/client/lttng/shared_library_prober_report.h' |
1467 | --- src/client/lttng/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
1468 | +++ src/client/lttng/shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
1469 | @@ -0,0 +1,55 @@ |
1470 | +/* |
1471 | + * Copyright © 2014 Canonical Ltd. |
1472 | + * |
1473 | + * This program is free software: you can redistribute it and/or modify |
1474 | + * it under the terms of the GNU Lesser General Public License version 3 as |
1475 | + * published by the Free Software Foundation. |
1476 | + * |
1477 | + * This program is distributed in the hope that it will be useful, |
1478 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1479 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1480 | + * GNU Lesser General Public License for more details. |
1481 | + * |
1482 | + * You should have received a copy of the GNU Lesser General Public License |
1483 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1484 | + * |
1485 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
1486 | + */ |
1487 | + |
1488 | +#ifndef MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
1489 | +#define MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
1490 | + |
1491 | +#include "mir/shared_library_prober_report.h" |
1492 | +#include "client_tracepoint_provider.h" |
1493 | + |
1494 | +namespace mir |
1495 | +{ |
1496 | +namespace client |
1497 | +{ |
1498 | +namespace lttng |
1499 | +{ |
1500 | + |
1501 | +class SharedLibraryProberReport : public mir::SharedLibraryProberReport |
1502 | +{ |
1503 | +public: |
1504 | + void probing_path(boost::filesystem::path const& path) override; |
1505 | + void probing_failed(boost::filesystem::path const& path, std::exception const& error) override; |
1506 | + void loading_library(boost::filesystem::path const& filename) override; |
1507 | + void loading_failed(boost::filesystem::path const& filename, std::exception const& error) override; |
1508 | + |
1509 | +private: |
1510 | + ClientTracepointProvider tp_provider; |
1511 | +}; |
1512 | + |
1513 | +} |
1514 | +} |
1515 | +} |
1516 | + |
1517 | +#endif /* MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ */ |
1518 | + |
1519 | + |
1520 | +#ifndef SHARED_LIBRARY_PROBER_REPORT_H |
1521 | +#define SHARED_LIBRARY_PROBER_REPORT_H |
1522 | + |
1523 | + |
1524 | +#endif // SHARED_LIBRARY_PROBER_REPORT_H |
1525 | |
1526 | === added file 'src/client/lttng/shared_library_prober_report_tp.h' |
1527 | --- src/client/lttng/shared_library_prober_report_tp.h 1970-01-01 00:00:00 +0000 |
1528 | +++ src/client/lttng/shared_library_prober_report_tp.h 2014-08-29 01:18:58 +0000 |
1529 | @@ -0,0 +1,85 @@ |
1530 | +/* |
1531 | + * Copyright © 2014 Canonical Ltd. |
1532 | + * |
1533 | + * This program is free software: you can redistribute it and/or modify |
1534 | + * it under the terms of the GNU Lesser General Public License version 3 as |
1535 | + * published by the Free Software Foundation. |
1536 | + * |
1537 | + * This program is distributed in the hope that it will be useful, |
1538 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1539 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1540 | + * GNU Lesser General Public License for more details. |
1541 | + * |
1542 | + * You should have received a copy of the GNU Lesser General Public License |
1543 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1544 | + * |
1545 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
1546 | + */ |
1547 | + |
1548 | +#undef TRACEPOINT_PROVIDER |
1549 | +#define TRACEPOINT_PROVIDER mir_client_shared_library_prober |
1550 | + |
1551 | +#undef TRACEPOINT_INCLUDE |
1552 | +#define TRACEPOINT_INCLUDE "./shared_library_prober_report_tp.h" |
1553 | + |
1554 | +#if !defined(MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ) |
1555 | +#define MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ |
1556 | + |
1557 | +#include <lttng/tracepoint.h> |
1558 | +#include <stdint.h> |
1559 | + |
1560 | +#ifdef __clang__ |
1561 | +/* |
1562 | + * TRACEPOINT_EVENT defines functions; since we disable tracepoints under clang |
1563 | + * these functions are unused and so generate fatal warnings. |
1564 | + * (see mir_tracepoint.h and http://sourceware.org/bugzilla/show_bug.cgi?id=13974) |
1565 | + */ |
1566 | +#pragma clang diagnostic push |
1567 | +#pragma clang diagnostic warning "-Wunused-function" |
1568 | +#endif |
1569 | + |
1570 | +TRACEPOINT_EVENT( |
1571 | + mir_client_shared_library_prober, |
1572 | + probing_path, |
1573 | + TP_ARGS(const char*, path), |
1574 | + TP_FIELDS( |
1575 | + ctf_string(path, path) |
1576 | + ) |
1577 | +) |
1578 | + |
1579 | +TRACEPOINT_EVENT( |
1580 | + mir_client_shared_library_prober, |
1581 | + probing_failed, |
1582 | + TP_ARGS(const char*, path, const char*, message), |
1583 | + TP_FIELDS( |
1584 | + ctf_string(path, path) |
1585 | + ctf_string(message, message) |
1586 | + ) |
1587 | +) |
1588 | + |
1589 | +TRACEPOINT_EVENT( |
1590 | + mir_client_shared_library_prober, |
1591 | + loading_library, |
1592 | + TP_ARGS(const char*, path), |
1593 | + TP_FIELDS( |
1594 | + ctf_string(path, path) |
1595 | + ) |
1596 | +) |
1597 | + |
1598 | +TRACEPOINT_EVENT( |
1599 | + mir_client_shared_library_prober, |
1600 | + loading_failed, |
1601 | + TP_ARGS(const char*, path, const char*, message), |
1602 | + TP_FIELDS( |
1603 | + ctf_string(path, path) |
1604 | + ctf_string(message, message) |
1605 | + ) |
1606 | +) |
1607 | + |
1608 | +#ifdef __clang__ |
1609 | +#pragma clang diagnostic pop |
1610 | +#endif |
1611 | + |
1612 | +#endif /* MIR_CLIENT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ */ |
1613 | + |
1614 | +#include <lttng/tracepoint-event.h> |
1615 | |
1616 | === modified file 'src/client/mesa/CMakeLists.txt' |
1617 | --- src/client/mesa/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
1618 | +++ src/client/mesa/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
1619 | @@ -17,7 +17,7 @@ |
1620 | ) |
1621 | |
1622 | add_library( |
1623 | - mirclientplatformmesa SHARED |
1624 | + mirclientplatformmesa MODULE |
1625 | |
1626 | $<TARGET_OBJECTS:mirclientplatformmesaobjects> |
1627 | $<TARGET_OBJECTS:mirclient_platformimpl> |
1628 | @@ -25,9 +25,9 @@ |
1629 | |
1630 | set_target_properties( |
1631 | mirclientplatformmesa PROPERTIES |
1632 | - OUTPUT_NAME mirclientplatform |
1633 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/mesa |
1634 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
1635 | + OUTPUT_NAME client-platform-mesa |
1636 | + PREFIX "" |
1637 | + LINK_FLAGS "-Wl,--version-script,${symbol_map}" |
1638 | ) |
1639 | |
1640 | target_link_libraries( |
1641 | @@ -36,21 +36,4 @@ |
1642 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
1643 | ) |
1644 | |
1645 | -install(TARGETS mirclientplatformmesa LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/clientplatform/mesa) |
1646 | - |
1647 | -if (MIR_TEST_PLATFORM STREQUAL "mesa") |
1648 | - add_custom_command(TARGET mirclientplatformmesa |
1649 | - POST_BUILD |
1650 | - COMMAND ${CMAKE_COMMAND} -E remove libmirclientplatform.so |
1651 | - COMMAND ${CMAKE_COMMAND} -E create_symlink mesa/$<TARGET_FILE_NAME:mirclientplatformmesa> libmirclientplatform.so |
1652 | - WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
1653 | - ) |
1654 | - |
1655 | - install(CODE |
1656 | - "execute_process( |
1657 | - COMMAND ln -sf mir/clientplatform/mesa/libmirclientplatform.so |
1658 | - WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
1659 | - )" |
1660 | - ) |
1661 | -endif() |
1662 | - |
1663 | +install(TARGETS mirclientplatformmesa LIBRARY DESTINATION ${MIR_CLIENT_PLATFORM_PATH}) |
1664 | |
1665 | === modified file 'src/client/mesa/client_platform.cpp' |
1666 | --- src/client/mesa/client_platform.cpp 2014-03-06 06:05:17 +0000 |
1667 | +++ src/client/mesa/client_platform.cpp 2014-08-29 01:18:58 +0000 |
1668 | @@ -95,7 +95,7 @@ |
1669 | std::shared_ptr<EGLNativeDisplayType> mclm::ClientPlatform::create_egl_native_display() |
1670 | { |
1671 | MirEGLNativeDisplayType *mir_native_display = new MirEGLNativeDisplayType; |
1672 | - *mir_native_display = display_container.create(context->mir_connection()); |
1673 | + *mir_native_display = display_container.create(context); |
1674 | auto egl_native_display = reinterpret_cast<EGLNativeDisplayType*>(mir_native_display); |
1675 | |
1676 | return std::shared_ptr<EGLNativeDisplayType>(egl_native_display, NativeDisplayDeleter(display_container)); |
1677 | |
1678 | === modified file 'src/client/mesa/client_platform_factory.cpp' |
1679 | --- src/client/mesa/client_platform_factory.cpp 2014-02-07 15:43:41 +0000 |
1680 | +++ src/client/mesa/client_platform_factory.cpp 2014-08-29 01:18:58 +0000 |
1681 | @@ -16,13 +16,16 @@ |
1682 | * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
1683 | */ |
1684 | |
1685 | -#include "client_platform_factory.h" |
1686 | +#include "../client_platform_factory.h" |
1687 | #include "client_platform.h" |
1688 | +#include "mir_toolkit/client_types.h" |
1689 | +#include "../client_context.h" |
1690 | #include "buffer_file_ops.h" |
1691 | #include "../egl_native_display_container.h" |
1692 | |
1693 | #include <sys/mman.h> |
1694 | #include <unistd.h> |
1695 | +#include <stdexcept> |
1696 | |
1697 | namespace mcl = mir::client; |
1698 | namespace mclm = mcl::mesa; |
1699 | @@ -57,15 +60,26 @@ |
1700 | |
1701 | } |
1702 | |
1703 | -std::shared_ptr<mcl::ClientPlatform> |
1704 | -mclm::ClientPlatformFactory::create_client_platform(mcl::ClientContext* context) |
1705 | +extern "C" std::shared_ptr<mcl::ClientPlatform> mcl::create_client_platform(mcl::ClientContext* context) |
1706 | { |
1707 | - auto buffer_file_ops = std::make_shared<RealBufferFileOps>(); |
1708 | + MirPlatformPackage package; |
1709 | + context->populate(package); |
1710 | + if (package.data_items != 0 || package.fd_items != 1) |
1711 | + { |
1712 | + throw std::runtime_error{"Attempted to create Mesa client platform on non-Mesa server"}; |
1713 | + } |
1714 | +; auto buffer_file_ops = std::make_shared<RealBufferFileOps>(); |
1715 | return std::make_shared<mclm::ClientPlatform>( |
1716 | context, buffer_file_ops, mcl::EGLNativeDisplayContainer::instance()); |
1717 | } |
1718 | |
1719 | -extern "C" std::shared_ptr<mcl::ClientPlatformFactory> mcl::create_client_platform_factory() |
1720 | +extern "C" bool |
1721 | +mcl::is_appropriate_module(mcl::ClientContext* context) |
1722 | { |
1723 | - return std::make_shared<mclm::ClientPlatformFactory>(); |
1724 | + MirPlatformPackage platform; |
1725 | + context->populate(platform); |
1726 | + // TODO: Actually check what platform we're using, rather than blindly |
1727 | + // hope we can distinguish them from the stuff they've put in the |
1728 | + // PlatformPackage. |
1729 | + return platform.data_items == 0 && platform.fd_items == 1; |
1730 | } |
1731 | |
1732 | === modified file 'src/client/mesa/client_platform_factory.h' |
1733 | --- src/client/mesa/client_platform_factory.h 2014-02-07 15:43:41 +0000 |
1734 | +++ src/client/mesa/client_platform_factory.h 2014-08-29 01:18:58 +0000 |
1735 | @@ -28,11 +28,6 @@ |
1736 | namespace mesa |
1737 | { |
1738 | |
1739 | -class ClientPlatformFactory : public client::ClientPlatformFactory |
1740 | -{ |
1741 | -public: |
1742 | - std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context) override; |
1743 | -}; |
1744 | |
1745 | } |
1746 | } |
1747 | |
1748 | === modified file 'src/client/mesa/mesa_native_display_container.cpp' |
1749 | --- src/client/mesa/mesa_native_display_container.cpp 2014-07-17 12:32:21 +0000 |
1750 | +++ src/client/mesa/mesa_native_display_container.cpp 2014-08-29 01:18:58 +0000 |
1751 | @@ -18,7 +18,7 @@ |
1752 | |
1753 | #include "mesa_native_display_container.h" |
1754 | |
1755 | -#include "mir_toolkit/mir_client_library.h" |
1756 | +#include "../client_context.h" |
1757 | |
1758 | #include <cstring> |
1759 | #include <unordered_set> |
1760 | @@ -35,8 +35,8 @@ |
1761 | static int egl_display_get_platform(MirMesaEGLNativeDisplay* display, |
1762 | MirPlatformPackage* package) |
1763 | { |
1764 | - auto connection = static_cast<MirConnection*>(display->context); |
1765 | - mir_connection_get_platform(connection, package); |
1766 | + auto context = static_cast<mcl::ClientContext*>(display->context); |
1767 | + context->populate(*package); |
1768 | return MIR_MESA_TRUE; |
1769 | } |
1770 | |
1771 | @@ -93,11 +93,11 @@ |
1772 | } |
1773 | |
1774 | MirEGLNativeDisplayType |
1775 | -mclm::MesaNativeDisplayContainer::create(MirConnection* connection) |
1776 | +mclm::MesaNativeDisplayContainer::create(ClientContext* context) |
1777 | { |
1778 | MirMesaEGLNativeDisplay* display = new MirMesaEGLNativeDisplay(); |
1779 | display->display_get_platform = egl_display_get_platform; |
1780 | - display->context = connection; |
1781 | + display->context = context; |
1782 | |
1783 | std::lock_guard<std::mutex> lg(guard); |
1784 | auto egl_display = static_cast<MirEGLNativeDisplayType>(display); |
1785 | |
1786 | === modified file 'src/client/mesa/mesa_native_display_container.h' |
1787 | --- src/client/mesa/mesa_native_display_container.h 2014-03-06 06:05:17 +0000 |
1788 | +++ src/client/mesa/mesa_native_display_container.h 2014-08-29 01:18:58 +0000 |
1789 | @@ -40,7 +40,7 @@ |
1790 | MesaNativeDisplayContainer(); |
1791 | virtual ~MesaNativeDisplayContainer(); |
1792 | |
1793 | - MirEGLNativeDisplayType create(MirConnection* connection); |
1794 | + MirEGLNativeDisplayType create(ClientContext* context); |
1795 | void release(MirEGLNativeDisplayType display); |
1796 | |
1797 | bool validate(MirEGLNativeDisplayType display) const; |
1798 | |
1799 | === modified file 'src/client/mesa/native_surface.cpp' |
1800 | --- src/client/mesa/native_surface.cpp 2014-08-05 07:09:05 +0000 |
1801 | +++ src/client/mesa/native_surface.cpp 2014-08-29 01:18:58 +0000 |
1802 | @@ -20,7 +20,6 @@ |
1803 | #include "../client_buffer.h" |
1804 | #include "native_surface.h" |
1805 | |
1806 | -#include <iostream> |
1807 | #include <boost/exception/diagnostic_information.hpp> |
1808 | |
1809 | namespace mclm=mir::client::mesa; |
1810 | |
1811 | === modified file 'src/client/mesa/symbols.map' |
1812 | --- src/client/mesa/symbols.map 2014-08-25 03:11:01 +0000 |
1813 | +++ src/client/mesa/symbols.map 2014-08-29 01:18:58 +0000 |
1814 | @@ -1,7 +1,9 @@ |
1815 | MIR_CLIENTPLATFORM_1 { |
1816 | global: |
1817 | - create_client_platform_factory; |
1818 | + create_client_platform; |
1819 | + is_appropriate_module; |
1820 | # Needed by our Mesa EGL platform |
1821 | mir_client_mesa_egl_native_display_is_valid; |
1822 | - local: *; |
1823 | + local: |
1824 | + *; |
1825 | }; |
1826 | |
1827 | === modified file 'src/client/mir_connection.cpp' |
1828 | --- src/client/mir_connection.cpp 2014-08-26 13:38:23 +0000 |
1829 | +++ src/client/mir_connection.cpp 2014-08-29 01:18:58 +0000 |
1830 | @@ -98,6 +98,7 @@ |
1831 | channel(conf.the_rpc_channel()), |
1832 | server(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), |
1833 | logger(conf.the_logger()), |
1834 | + connect_done{false}, |
1835 | client_platform_factory(conf.the_client_platform_factory()), |
1836 | input_platform(conf.the_input_platform()), |
1837 | display_configuration(conf.the_display_configuration()), |
1838 | @@ -249,6 +250,9 @@ |
1839 | set_error_message("Connect failed"); |
1840 | } |
1841 | } |
1842 | + |
1843 | + connect_done = true; |
1844 | + |
1845 | /* |
1846 | * We need to create the client platform after the connection has been |
1847 | * established, to ensure that the client platform has access to all |
1848 | @@ -353,9 +357,9 @@ |
1849 | |
1850 | void MirConnection::populate(MirPlatformPackage& platform_package) |
1851 | { |
1852 | - std::lock_guard<decltype(mutex)> lock(mutex); |
1853 | - |
1854 | - if (!connect_result.has_error() && connect_result.has_platform()) |
1855 | + // connect_result is write-once: once it's valid, we don't need to lock |
1856 | + // to use it. |
1857 | + if (connect_done && !connect_result.has_error() && connect_result.has_platform()) |
1858 | { |
1859 | auto const& platform = connect_result.platform(); |
1860 | |
1861 | |
1862 | === modified file 'src/client/mir_connection.h' |
1863 | --- src/client/mir_connection.h 2014-08-26 13:38:23 +0000 |
1864 | +++ src/client/mir_connection.h 2014-08-29 01:18:58 +0000 |
1865 | @@ -22,6 +22,7 @@ |
1866 | #include <memory> |
1867 | #include <unordered_set> |
1868 | #include <unordered_map> |
1869 | +#include <atomic> |
1870 | |
1871 | #include <mutex> |
1872 | |
1873 | @@ -149,8 +150,9 @@ |
1874 | std::shared_ptr<google::protobuf::RpcChannel> const channel; |
1875 | mir::protobuf::DisplayServer::Stub server; |
1876 | std::shared_ptr<mir::logging::Logger> const logger; |
1877 | - mir::protobuf::Void void_response; |
1878 | + mir::protobuf::Void void_response; |
1879 | mir::protobuf::Connection connect_result; |
1880 | + std::atomic<bool> connect_done; |
1881 | mir::protobuf::Void ignored; |
1882 | mir::protobuf::ConnectParameters connect_parameters; |
1883 | mir::protobuf::DRMAuthMagicStatus drm_auth_magic_status; |
1884 | |
1885 | === added file 'src/client/probing_client_platform_factory.cpp' |
1886 | --- src/client/probing_client_platform_factory.cpp 1970-01-01 00:00:00 +0000 |
1887 | +++ src/client/probing_client_platform_factory.cpp 2014-08-29 01:18:58 +0000 |
1888 | @@ -0,0 +1,29 @@ |
1889 | +#include "probing_client_platform_factory.h" |
1890 | + |
1891 | +#include <stdexcept> |
1892 | + |
1893 | +namespace mcl = mir::client; |
1894 | + |
1895 | +mcl::ProbingClientPlatformFactory::ProbingClientPlatformFactory(std::vector<std::shared_ptr<mir::SharedLibrary>> const& modules) |
1896 | + : platform_modules{modules} |
1897 | +{ |
1898 | + if (modules.empty()) |
1899 | + { |
1900 | + throw std::runtime_error{"Attempted to create a ClientPlatformFactory with no platform modules"}; |
1901 | + } |
1902 | +} |
1903 | + |
1904 | +std::shared_ptr<mcl::ClientPlatform> |
1905 | +mcl::ProbingClientPlatformFactory::create_client_platform(mcl::ClientContext* context) |
1906 | +{ |
1907 | + for (auto& module : platform_modules) |
1908 | + { |
1909 | + auto probe = module->load_function<mir::client::ClientPlatformProbe>("is_appropriate_module"); |
1910 | + if (probe(context)) |
1911 | + { |
1912 | + auto factory = module->load_function<mir::client::CreateClientPlatform>("create_client_platform"); |
1913 | + return factory(context); |
1914 | + } |
1915 | + } |
1916 | + throw std::runtime_error{"No appropriate client platform module found"}; |
1917 | +} |
1918 | |
1919 | === added file 'src/client/probing_client_platform_factory.h' |
1920 | --- src/client/probing_client_platform_factory.h 1970-01-01 00:00:00 +0000 |
1921 | +++ src/client/probing_client_platform_factory.h 2014-08-29 01:18:58 +0000 |
1922 | @@ -0,0 +1,27 @@ |
1923 | +#ifndef MIR_CLIENT_PROBING_CLIENT_PLATFORM_FACTORY_H_ |
1924 | +#define MIR_CLIENT_PROBING_CLIENT_PLATFORM_FACTORY_H_ |
1925 | + |
1926 | +#include <vector> |
1927 | + |
1928 | +#include "client_platform_factory.h" |
1929 | +#include "mir/shared_library.h" |
1930 | + |
1931 | +namespace mir |
1932 | +{ |
1933 | +namespace client |
1934 | +{ |
1935 | +class ProbingClientPlatformFactory : public ClientPlatformFactory |
1936 | +{ |
1937 | +public: |
1938 | + ProbingClientPlatformFactory(std::vector<std::shared_ptr<SharedLibrary>> const& modules); |
1939 | + |
1940 | + std::shared_ptr<ClientPlatform> create_client_platform(ClientContext *context) override; |
1941 | +private: |
1942 | + std::vector<std::shared_ptr<SharedLibrary>> platform_modules; |
1943 | +}; |
1944 | + |
1945 | + |
1946 | +} |
1947 | +} |
1948 | + |
1949 | +#endif // MIR_CLIENT_PROBING_CLIENT_PLATFORM_FACTORY_H_ |
1950 | |
1951 | === modified file 'src/platform/CMakeLists.txt' |
1952 | --- src/platform/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
1953 | +++ src/platform/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
1954 | @@ -4,12 +4,21 @@ |
1955 | |
1956 | set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
1957 | |
1958 | -add_library(mirplatformobjects OBJECT |
1959 | - shared_library_loader.cpp |
1960 | -) |
1961 | +# This needs to change whenever the much smaller ABI between the platform |
1962 | +# modules and the server changes in an incompatible way. |
1963 | +set(MIR_PLATFORM_PLUGIN_ABI 1) |
1964 | + |
1965 | +set(MIR_SERVER_PLATFORM_PLUGIN_PATH |
1966 | + ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/mir/server-platform-${MIR_PLATFORM_PLUGIN_ABI} |
1967 | +) |
1968 | +set(MIR_SERVER_PLATFORM_PLUGIN_PATH |
1969 | + ${MIR_SERVER_PLATFORM_PLUGIN_PATH} |
1970 | + PARENT_SCOPE |
1971 | +) |
1972 | + |
1973 | +add_definitions(-DMIR_SERVER_PLATFORM_PLUGIN_PATH="${MIR_SERVER_PLATFORM_PLUGIN_PATH}") |
1974 | |
1975 | set(MIR_PLATFORM_OBJECTS |
1976 | - $<TARGET_OBJECTS:mirplatformobjects> |
1977 | $<TARGET_OBJECTS:mirplatformgraphicscommon> |
1978 | $<TARGET_OBJECTS:miroptions> |
1979 | $<TARGET_OBJECTS:mirfatal> |
1980 | @@ -28,17 +37,19 @@ |
1981 | ) |
1982 | |
1983 | target_link_libraries(mirplatform |
1984 | + |
1985 | mircommon |
1986 | ${MIR_PLATFORM_REFERENCES} |
1987 | ) |
1988 | |
1989 | -set_target_properties(mirplatform |
1990 | +set_target_properties( |
1991 | + mirplatform |
1992 | + |
1993 | PROPERTIES |
1994 | SOVERSION ${MIRPLATFORM_ABI} |
1995 | LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
1996 | ) |
1997 | |
1998 | - |
1999 | install(TARGETS mirplatform LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
2000 | |
2001 | add_subdirectory(graphics/) |
2002 | |
2003 | === modified file 'src/platform/graphics/CMakeLists.txt' |
2004 | --- src/platform/graphics/CMakeLists.txt 2014-08-04 08:58:40 +0000 |
2005 | +++ src/platform/graphics/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2006 | @@ -14,6 +14,7 @@ |
2007 | gl_program.cpp |
2008 | gl_texture.cpp |
2009 | tessellation_helpers.cpp |
2010 | + platform_probe.cpp |
2011 | ) |
2012 | |
2013 | add_library(mirplatformgraphicscommon OBJECT |
2014 | |
2015 | === modified file 'src/platform/graphics/android/CMakeLists.txt' |
2016 | --- src/platform/graphics/android/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
2017 | +++ src/platform/graphics/android/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2018 | @@ -8,7 +8,9 @@ |
2019 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") |
2020 | add_definitions( -DANDROID ) |
2021 | |
2022 | -add_library(mirplatformgraphicsandroidobjects OBJECT |
2023 | +add_library( |
2024 | + mirplatformgraphicsandroidobjects OBJECT |
2025 | + |
2026 | android_platform.cpp |
2027 | android_buffer_allocator.cpp |
2028 | buffer.cpp |
2029 | @@ -36,17 +38,12 @@ |
2030 | real_hwc_wrapper.cpp |
2031 | hwc_fallback_gl_renderer.cpp |
2032 | ) |
2033 | + |
2034 | add_library(mirplatformgraphicsandroid SHARED |
2035 | + |
2036 | $<TARGET_OBJECTS:mirplatformgraphicsandroidobjects> |
2037 | ) |
2038 | |
2039 | -set_target_properties( |
2040 | - mirplatformgraphicsandroid PROPERTIES |
2041 | - OUTPUT_NAME mirplatformgraphics |
2042 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/android |
2043 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
2044 | -) |
2045 | - |
2046 | target_link_libraries( |
2047 | mirplatformgraphicsandroid |
2048 | |
2049 | @@ -59,20 +56,13 @@ |
2050 | ${ANDROID_PROPERTIES_LDFLAGS} |
2051 | ) |
2052 | |
2053 | -install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/platformgraphics/android) |
2054 | - |
2055 | -if (MIR_TEST_PLATFORM STREQUAL "android") |
2056 | - add_custom_command(TARGET mirplatformgraphicsandroid |
2057 | - POST_BUILD |
2058 | - COMMAND ${CMAKE_COMMAND} -E remove libmirplatformgraphics.so |
2059 | - COMMAND ${CMAKE_COMMAND} -E create_symlink android/$<TARGET_FILE_NAME:mirplatformgraphicsandroid> libmirplatformgraphics.so |
2060 | - WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
2061 | - ) |
2062 | - |
2063 | - install(CODE |
2064 | - "execute_process( |
2065 | - COMMAND ln -sf mir/platformgraphics/android/libmirplatformgraphics.so |
2066 | - WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
2067 | - )" |
2068 | - ) |
2069 | -endif() |
2070 | +set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
2071 | + |
2072 | +set_target_properties( |
2073 | + mirplatformgraphicsandroid PROPERTIES |
2074 | + OUTPUT_NAME platform-graphics-android |
2075 | + PREFIX "" |
2076 | + LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
2077 | +) |
2078 | + |
2079 | +install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${MIR_SERVER_PLATFORM_PLUGIN_PATH}) |
2080 | |
2081 | === modified file 'src/platform/graphics/android/android_platform.cpp' |
2082 | --- src/platform/graphics/android/android_platform.cpp 2014-08-07 13:22:53 +0000 |
2083 | +++ src/platform/graphics/android/android_platform.cpp 2014-08-29 01:18:58 +0000 |
2084 | @@ -187,3 +187,26 @@ |
2085 | boost::program_options::value<bool>()->default_value(true), //TODO: switch default to false |
2086 | "[platform-specific] Whether to disable overlay optimizations [{on,off}]"); |
2087 | } |
2088 | + |
2089 | +extern "C" mg::PlatformPriority probe_platform() |
2090 | +{ |
2091 | + int err; |
2092 | + hw_module_t const* hw_module; |
2093 | + |
2094 | + err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hw_module); |
2095 | + |
2096 | + // TODO: Yo! kdub! Is this totally insane? |
2097 | + // It *looks* like the hw_module_t is global, so we don't leak by |
2098 | + // not doing anything with it? |
2099 | + |
2100 | + return err < 0 ? mg::PlatformPriority::unsupported : mg::PlatformPriority::best; |
2101 | +} |
2102 | + |
2103 | +mg::ModuleProperties const description = { |
2104 | + "android" |
2105 | +}; |
2106 | + |
2107 | +extern "C" mg::ModuleProperties const* describe_module() |
2108 | +{ |
2109 | + return &description; |
2110 | +} |
2111 | |
2112 | === added file 'src/platform/graphics/android/symbols.map' |
2113 | --- src/platform/graphics/android/symbols.map 1970-01-01 00:00:00 +0000 |
2114 | +++ src/platform/graphics/android/symbols.map 2014-08-29 01:18:58 +0000 |
2115 | @@ -0,0 +1,8 @@ |
2116 | +MIR_GRAPHICS_PLATFORM_1 { |
2117 | + global: |
2118 | + add_platform_options; |
2119 | + create_platform; |
2120 | + create_native_platform; |
2121 | + probe_platform; |
2122 | + describe_module; |
2123 | +}; |
2124 | |
2125 | === modified file 'src/platform/graphics/mesa/CMakeLists.txt' |
2126 | --- src/platform/graphics/mesa/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
2127 | +++ src/platform/graphics/mesa/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2128 | @@ -11,7 +11,9 @@ |
2129 | string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) |
2130 | add_definitions(-D__GBM__) |
2131 | |
2132 | -add_library(mirplatformgraphicsmesaobjects OBJECT |
2133 | +add_library( |
2134 | + mirplatformgraphicsmesaobjects OBJECT |
2135 | + |
2136 | platform.cpp |
2137 | buffer_allocator.cpp |
2138 | gbm_buffer.cpp |
2139 | @@ -35,18 +37,14 @@ |
2140 | bypass.cpp |
2141 | ) |
2142 | |
2143 | -add_library(mirplatformgraphicsmesa SHARED |
2144 | +add_library( |
2145 | + mirplatformgraphicsmesa MODULE |
2146 | + |
2147 | $<TARGET_OBJECTS:mirplatformgraphicsmesaobjects> |
2148 | ) |
2149 | |
2150 | -set_target_properties( |
2151 | - mirplatformgraphicsmesa PROPERTIES |
2152 | - OUTPUT_NAME mirplatformgraphics |
2153 | - LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}/mesa |
2154 | - LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
2155 | -) |
2156 | - |
2157 | -target_link_libraries(mirplatformgraphicsmesa |
2158 | +target_link_libraries( |
2159 | + mirplatformgraphicsmesa |
2160 | |
2161 | ${Boost_PROGRAM_OPTIONS_LIBRARY} |
2162 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
2163 | @@ -55,20 +53,13 @@ |
2164 | ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
2165 | ) |
2166 | |
2167 | -install(TARGETS mirplatformgraphicsmesa LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/platformgraphics/mesa) |
2168 | - |
2169 | -if (MIR_TEST_PLATFORM STREQUAL "mesa") |
2170 | - add_custom_command(TARGET mirplatformgraphicsmesa |
2171 | - POST_BUILD |
2172 | - COMMAND ${CMAKE_COMMAND} -E remove libmirplatformgraphics.so |
2173 | - COMMAND ${CMAKE_COMMAND} -E create_symlink mesa/$<TARGET_FILE_NAME:mirplatformgraphicsmesa> libmirplatformgraphics.so |
2174 | - WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
2175 | - ) |
2176 | - |
2177 | - install(CODE |
2178 | - "execute_process( |
2179 | - COMMAND ln -sf mir/platformgraphics/mesa/libmirplatformgraphics.so |
2180 | - WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} |
2181 | - )" |
2182 | - ) |
2183 | -endif() |
2184 | +set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
2185 | + |
2186 | +set_target_properties( |
2187 | + mirplatformgraphicsmesa PROPERTIES |
2188 | + OUTPUT_NAME platform-graphics-mesa |
2189 | + PREFIX "" |
2190 | + LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
2191 | +) |
2192 | + |
2193 | +install(TARGETS mirplatformgraphicsmesa LIBRARY DESTINATION ${MIR_SERVER_PLATFORM_PLUGIN_PATH}) |
2194 | |
2195 | === modified file 'src/platform/graphics/mesa/platform.cpp' |
2196 | --- src/platform/graphics/mesa/platform.cpp 2014-08-07 13:22:53 +0000 |
2197 | +++ src/platform/graphics/mesa/platform.cpp 2014-08-29 01:18:58 +0000 |
2198 | @@ -28,6 +28,7 @@ |
2199 | #include "mir/options/option.h" |
2200 | #include "mir/graphics/native_buffer.h" |
2201 | #include "mir/emergency_cleanup_registry.h" |
2202 | +#include "mir/udev/wrapper.h" |
2203 | |
2204 | #include "drm_close_threadsafe.h" |
2205 | |
2206 | @@ -269,3 +270,30 @@ |
2207 | boost::program_options::value<bool>()->default_value(true), |
2208 | "[platform-specific] utilize the bypass optimization for fullscreen surfaces."); |
2209 | } |
2210 | + |
2211 | +extern "C" mg::PlatformPriority probe_platform() |
2212 | +{ |
2213 | + auto udev = std::make_shared<mir::udev::Context>(); |
2214 | + |
2215 | + mir::udev::Enumerator drm_devices{udev}; |
2216 | + drm_devices.match_subsystem("drm"); |
2217 | + drm_devices.match_sysname("card[0-9]*"); |
2218 | + drm_devices.scan_devices(); |
2219 | + |
2220 | + for(auto& device : drm_devices) |
2221 | + { |
2222 | + static_cast<void>(device); |
2223 | + return mg::PlatformPriority::best; |
2224 | + } |
2225 | + |
2226 | + return mg::PlatformPriority::unsupported; |
2227 | +} |
2228 | + |
2229 | +mg::ModuleProperties const description = { |
2230 | + "mesa" |
2231 | +}; |
2232 | + |
2233 | +extern "C" mg::ModuleProperties const* describe_module() |
2234 | +{ |
2235 | + return &description; |
2236 | +} |
2237 | |
2238 | === added file 'src/platform/graphics/mesa/symbols.map' |
2239 | --- src/platform/graphics/mesa/symbols.map 1970-01-01 00:00:00 +0000 |
2240 | +++ src/platform/graphics/mesa/symbols.map 2014-08-29 01:18:58 +0000 |
2241 | @@ -0,0 +1,8 @@ |
2242 | +MIR_GRAPHICS_PLATFORM_1 { |
2243 | + global: |
2244 | + add_platform_options; |
2245 | + create_platform; |
2246 | + create_native_platform; |
2247 | + probe_platform; |
2248 | + describe_module; |
2249 | +}; |
2250 | |
2251 | === added file 'src/platform/graphics/platform_probe.cpp' |
2252 | --- src/platform/graphics/platform_probe.cpp 1970-01-01 00:00:00 +0000 |
2253 | +++ src/platform/graphics/platform_probe.cpp 2014-08-29 01:18:58 +0000 |
2254 | @@ -0,0 +1,42 @@ |
2255 | +/* |
2256 | + * Copyright © 2014 Canonical Ltd. |
2257 | + * |
2258 | + * This program is free software: you can redistribute it and/or modify it |
2259 | + * under the terms of the GNU Lesser General Public License version 3, |
2260 | + * as published by the Free Software Foundation. |
2261 | + * |
2262 | + * This program is distributed in the hope that it will be useful, |
2263 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2264 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2265 | + * GNU Lesser General Public License for more details. |
2266 | + * |
2267 | + * You should have received a copy of the GNU Lesser General Public License |
2268 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2269 | + * |
2270 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2271 | + */ |
2272 | + |
2273 | +#include "mir/graphics/platform.h" |
2274 | +#include "platform_probe.h" |
2275 | + |
2276 | +std::shared_ptr<mir::SharedLibrary> |
2277 | +mir::graphics::module_for_device(std::vector<std::shared_ptr<SharedLibrary>> const& modules) |
2278 | +{ |
2279 | + mir::graphics::PlatformPriority best_priority_so_far = mir::graphics::unsupported; |
2280 | + std::shared_ptr<mir::SharedLibrary> best_module_so_far; |
2281 | + for(auto& module : modules) |
2282 | + { |
2283 | + auto probe = module->load_function<mir::graphics::PlatformProbe>("probe_platform"); |
2284 | + auto module_priority = probe(); |
2285 | + if (module_priority > best_priority_so_far) |
2286 | + { |
2287 | + best_priority_so_far = module_priority; |
2288 | + best_module_so_far = module; |
2289 | + } |
2290 | + } |
2291 | + if (best_priority_so_far > mir::graphics::unsupported) |
2292 | + { |
2293 | + return best_module_so_far; |
2294 | + } |
2295 | + throw std::runtime_error{"Failed to find platform for current system"}; |
2296 | +} |
2297 | |
2298 | === added file 'src/platform/graphics/platform_probe.h' |
2299 | --- src/platform/graphics/platform_probe.h 1970-01-01 00:00:00 +0000 |
2300 | +++ src/platform/graphics/platform_probe.h 2014-08-29 01:18:58 +0000 |
2301 | @@ -0,0 +1,37 @@ |
2302 | +/* |
2303 | + * Copyright © 2014 Canonical Ltd. |
2304 | + * |
2305 | + * This program is free software: you can redistribute it and/or modify it |
2306 | + * under the terms of the GNU Lesser General Public License version 3, |
2307 | + * as published by the Free Software Foundation. |
2308 | + * |
2309 | + * This program is distributed in the hope that it will be useful, |
2310 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2311 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2312 | + * GNU Lesser General Public License for more details. |
2313 | + * |
2314 | + * You should have received a copy of the GNU Lesser General Public License |
2315 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2316 | + * |
2317 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2318 | + */ |
2319 | + |
2320 | +#ifndef MIR_GRAPHICS_PLATFORM_PROBE_H_ |
2321 | +#define MIR_GRAPHICS_PLATFORM_PROBE_H_ |
2322 | + |
2323 | +#include <vector> |
2324 | +#include <memory> |
2325 | +#include "mir/shared_library.h" |
2326 | + |
2327 | +namespace mir |
2328 | +{ |
2329 | +namespace graphics |
2330 | +{ |
2331 | +class Platform; |
2332 | + |
2333 | +std::shared_ptr<SharedLibrary> module_for_device(std::vector<std::shared_ptr<SharedLibrary>> const& modules); |
2334 | + |
2335 | +} |
2336 | +} |
2337 | + |
2338 | +#endif // MIR_GRAPHICS_PLATFORM_PROBE_H_ |
2339 | |
2340 | === modified file 'src/platform/options/default_configuration.cpp' |
2341 | --- src/platform/options/default_configuration.cpp 2014-08-07 09:48:53 +0000 |
2342 | +++ src/platform/options/default_configuration.cpp 2014-08-29 01:18:58 +0000 |
2343 | @@ -17,11 +17,12 @@ |
2344 | */ |
2345 | |
2346 | #include "mir/shared_library.h" |
2347 | -#include "mir/shared_library_loader.h" |
2348 | #include "mir/options/default_configuration.h" |
2349 | #include "mir/graphics/platform.h" |
2350 | #include "mir/default_configuration.h" |
2351 | #include "mir/abnormal_exit.h" |
2352 | +#include "mir/shared_library_prober.h" |
2353 | +#include "../graphics/platform_probe.h" |
2354 | |
2355 | namespace mo = mir::options; |
2356 | |
2357 | @@ -37,6 +38,7 @@ |
2358 | char const* const mo::connector_report_opt = "connector-report"; |
2359 | char const* const mo::scene_report_opt = "scene-report"; |
2360 | char const* const mo::input_report_opt = "input-report"; |
2361 | +char const* const mo::shared_library_prober_report_opt = "shared-library-prober-report"; |
2362 | char const* const mo::host_socket_opt = "host-socket"; |
2363 | char const* const mo::frontend_threads_opt = "ipc-thread-pool"; |
2364 | char const* const mo::name_opt = "name"; |
2365 | @@ -53,6 +55,7 @@ |
2366 | char const* const mo::lttng_opt_value = "lttng"; |
2367 | |
2368 | char const* const mo::platform_graphics_lib = "platform-graphics-lib"; |
2369 | +char const* const mo::platform_graphics_path = "platform-graphics-path"; |
2370 | |
2371 | namespace |
2372 | { |
2373 | @@ -61,7 +64,8 @@ |
2374 | int const glog_minloglevel_default = 0; |
2375 | char const* const glog_log_dir_default = ""; |
2376 | bool const enable_input_default = true; |
2377 | -char const* const default_platform_graphics_lib = "libmirplatformgraphics.so"; |
2378 | + |
2379 | +std::shared_ptr<mir::SharedLibrary> graphics_lib; |
2380 | } |
2381 | |
2382 | mo::DefaultConfiguration::DefaultConfiguration(int argc, char const* argv[]) : |
2383 | @@ -102,8 +106,10 @@ |
2384 | "Socket filename [string:default=$XDG_RUNTIME_DIR/mir_socket or /tmp/mir_socket]") |
2385 | (no_server_socket_opt, "Do not provide a socket filename for client connections") |
2386 | (prompt_socket_opt, "Provide a \"..._trusted\" filename for prompt helper connections") |
2387 | - (platform_graphics_lib, po::value<std::string>()->default_value(default_platform_graphics_lib), |
2388 | - "Library to use for platform graphics support") |
2389 | + (platform_graphics_lib, po::value<std::string>(), |
2390 | + "Library to use for platform graphics support (default: autodetect)") |
2391 | + (platform_graphics_path, po::value<std::string>()->default_value(MIR_SERVER_PLATFORM_PLUGIN_PATH), |
2392 | + "Library to use for platform graphics support (default: " MIR_SERVER_PLATFORM_PLUGIN_PATH ")") |
2393 | (enable_input_opt, po::value<bool>()->default_value(enable_input_default), |
2394 | "Enable input.") |
2395 | (compositor_report_opt, po::value<std::string>()->default_value(off_opt_value), |
2396 | @@ -122,6 +128,8 @@ |
2397 | "How to handle the MessageProcessor report. [{log,lttng,off}]") |
2398 | (scene_report_opt, po::value<std::string>()->default_value(off_opt_value), |
2399 | "How to handle the scene report. [{log,lttng,off}]") |
2400 | + (shared_library_prober_report_opt, po::value<std::string>()->default_value(off_opt_value), |
2401 | + "How to handle the shared library prober report. [{log,lttng,off}]") |
2402 | (glog, |
2403 | "Use google::GLog for logging") |
2404 | (glog_stderrthreshold, po::value<int>()->default_value(glog_stderrthreshold_default), |
2405 | @@ -149,30 +157,72 @@ |
2406 | add_platform_options(); |
2407 | } |
2408 | |
2409 | +namespace |
2410 | +{ |
2411 | +class NullSharedLibraryProberReport : public mir::SharedLibraryProberReport |
2412 | +{ |
2413 | +public: |
2414 | + void probing_path(boost::filesystem::path const& /*path*/) override |
2415 | + { |
2416 | + } |
2417 | + void probing_failed(boost::filesystem::path const& /*path*/, std::exception const& /*error*/) override |
2418 | + { |
2419 | + } |
2420 | + void loading_library(boost::filesystem::path const& /*filename*/) override |
2421 | + { |
2422 | + } |
2423 | + void loading_failed(boost::filesystem::path const& /*filename*/, std::exception const& /*error*/) override |
2424 | + { |
2425 | + } |
2426 | +}; |
2427 | +} |
2428 | + |
2429 | void mo::DefaultConfiguration::add_platform_options() |
2430 | { |
2431 | namespace po = boost::program_options; |
2432 | po::options_description program_options; |
2433 | program_options.add_options() |
2434 | (platform_graphics_lib, |
2435 | - po::value<std::string>()->default_value(default_platform_graphics_lib), ""); |
2436 | + po::value<std::string>(), ""); |
2437 | + program_options.add_options() |
2438 | + (platform_graphics_path, |
2439 | + po::value<std::string>()->default_value(MIR_SERVER_PLATFORM_PLUGIN_PATH), |
2440 | + ""); |
2441 | mo::ProgramOption options; |
2442 | options.parse_arguments(program_options, argc, argv); |
2443 | |
2444 | - std::string graphics_libname; |
2445 | + // TODO: We should just load all the platform plugins we can and present their options. |
2446 | auto env_libname = ::getenv("MIR_SERVER_PLATFORM_GRAPHICS_LIB"); |
2447 | - if (!options.is_set(platform_graphics_lib) && env_libname) |
2448 | - { |
2449 | - graphics_libname = std::string{env_libname}; |
2450 | - } |
2451 | - else |
2452 | - { |
2453 | - graphics_libname = options.get<std::string>(platform_graphics_lib); |
2454 | - } |
2455 | + auto env_libpath = ::getenv("MIR_SERVER_PLATFORM_GRAPHICS_PATH"); |
2456 | + try |
2457 | + { |
2458 | + if (options.is_set(platform_graphics_lib)) |
2459 | + { |
2460 | + graphics_lib = std::make_shared<mir::SharedLibrary>(options.get<std::string>(platform_graphics_lib)); |
2461 | + } |
2462 | + else if (env_libname) |
2463 | + { |
2464 | + graphics_lib = std::make_shared<mir::SharedLibrary>(std::string{env_libname}); |
2465 | + } |
2466 | + else |
2467 | + { |
2468 | + auto const plugin_path = env_libpath ? env_libpath : options.get<std::string>(platform_graphics_path); |
2469 | + NullSharedLibraryProberReport nuller; |
2470 | + auto plugins = mir::libraries_for_path(plugin_path, nuller); |
2471 | + graphics_lib = mir::graphics::module_for_device(plugins); |
2472 | + } |
2473 | |
2474 | - auto graphics_lib = load_library(graphics_libname); |
2475 | - auto add_platform_options = graphics_lib->load_function<mir::graphics::AddPlatformOptions>(std::string("add_platform_options")); |
2476 | - add_platform_options(*this->program_options); |
2477 | + auto add_platform_options = graphics_lib->load_function<mir::graphics::AddPlatformOptions>(std::string("add_platform_options")); |
2478 | + add_platform_options(*this->program_options); |
2479 | + } |
2480 | + catch(...) |
2481 | + { |
2482 | + // We don't actually care at this point if this failed. |
2483 | + // Maybe we've been pointed at the wrong place. Maybe this platform doesn't actually |
2484 | + // *have* platform-specific options. |
2485 | + // Regardless, if we need a platform and can't find one then we'll bail later |
2486 | + // in startup with a useful error. |
2487 | + } |
2488 | } |
2489 | |
2490 | boost::program_options::options_description_easy_init mo::DefaultConfiguration::add_options() |
2491 | |
2492 | === removed file 'src/platform/shared_library_loader.cpp' |
2493 | --- src/platform/shared_library_loader.cpp 2014-03-20 16:49:52 +0000 |
2494 | +++ src/platform/shared_library_loader.cpp 1970-01-01 00:00:00 +0000 |
2495 | @@ -1,38 +0,0 @@ |
2496 | -/* |
2497 | - * Copyright © 2013 Canonical Ltd. |
2498 | - * |
2499 | - * This program is free software: you can redistribute it and/or modify it |
2500 | - * under the terms of the GNU Lesser General Public License version 3, |
2501 | - * as published by the Free Software Foundation. |
2502 | - * |
2503 | - * This program is distributed in the hope that it will be useful, |
2504 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2505 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2506 | - * GNU Lesser General Public License for more details. |
2507 | - * |
2508 | - * You should have received a copy of the GNU Lesser General Public License |
2509 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2510 | - * |
2511 | - * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
2512 | - */ |
2513 | - |
2514 | -#include "mir/shared_library_loader.h" |
2515 | -#include "mir/shared_library.h" |
2516 | -#include <memory> |
2517 | -#include <map> |
2518 | - |
2519 | -mir::SharedLibrary const* mir::load_library(std::string const& libname) |
2520 | -{ |
2521 | - // There's no point in loading twice, and it isn't safe to unload... |
2522 | - static std::map<std::string, std::shared_ptr<mir::SharedLibrary>> libraries_cache; |
2523 | - |
2524 | - if (auto& ptr = libraries_cache[libname]) |
2525 | - { |
2526 | - return ptr.get(); |
2527 | - } |
2528 | - else |
2529 | - { |
2530 | - ptr = std::make_shared<mir::SharedLibrary>(libname); |
2531 | - return ptr.get(); |
2532 | - } |
2533 | -} |
2534 | |
2535 | === modified file 'src/platform/symbols.map' |
2536 | --- src/platform/symbols.map 2014-08-25 03:11:01 +0000 |
2537 | +++ src/platform/symbols.map 2014-08-29 01:18:58 +0000 |
2538 | @@ -155,6 +155,7 @@ |
2539 | mir::graphics::InternalSurface::pixel_format*; |
2540 | mir::graphics::InternalSurface::size*; |
2541 | mir::graphics::InternalSurface::swap_buffers*; |
2542 | + mir::graphics::module_for_device*; |
2543 | mir::graphics::NativePlatform::create_buffer_allocator*; |
2544 | mir::graphics::NativePlatform::create_internal_client*; |
2545 | mir::graphics::NativePlatform::fill_buffer_package*; |
2546 | @@ -225,6 +226,7 @@ |
2547 | mir::options::glog_log_dir*; |
2548 | mir::options::glog_minloglevel*; |
2549 | mir::options::glog_stderrthreshold*; |
2550 | + mir::options::platform_graphics_path*; |
2551 | mir::options::host_socket_opt*; |
2552 | mir::options::input_report_opt*; |
2553 | mir::options::legacy_input_report_opt*; |
2554 | @@ -252,6 +254,7 @@ |
2555 | mir::options::scene_report_opt*; |
2556 | mir::options::server_socket_opt*; |
2557 | mir::options::session_mediator_report_opt*; |
2558 | + mir::options::shared_library_prober_report_opt*; |
2559 | typeinfo?for?mir::AbnormalExit; |
2560 | typeinfo?for?mir::EmergencyCleanupRegistry; |
2561 | typeinfo?for?mir::FatalErrorStrategy; |
2562 | |
2563 | === modified file 'src/server/CMakeLists.txt' |
2564 | --- src/server/CMakeLists.txt 2014-08-18 09:05:55 +0000 |
2565 | +++ src/server/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2566 | @@ -2,6 +2,8 @@ |
2567 | ${PROJECT_SOURCE_DIR}/include/platform |
2568 | ${PROJECT_SOURCE_DIR}/include/server) |
2569 | |
2570 | +add_definitions(-DMIR_SERVER_PLATFORM_PLUGIN_PATH="${MIR_SERVER_PLATFORM_PLUGIN_PATH}") |
2571 | + |
2572 | add_subdirectory(compositor/) |
2573 | add_subdirectory(graphics/) |
2574 | add_subdirectory(input/) |
2575 | @@ -65,8 +67,9 @@ |
2576 | ) |
2577 | |
2578 | target_link_libraries(mirserver LINK_PUBLIC |
2579 | + |
2580 | + mirclient |
2581 | mirplatform |
2582 | - mirclient |
2583 | mircommon |
2584 | 3rd_party |
2585 | xcursorloader |
2586 | |
2587 | === modified file 'src/server/graphics/CMakeLists.txt' |
2588 | --- src/server/graphics/CMakeLists.txt 2014-08-06 12:22:34 +0000 |
2589 | +++ src/server/graphics/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2590 | @@ -1,4 +1,4 @@ |
2591 | -include_directories(${GLESv2_INCLUDE_DIRS}) |
2592 | +include_directories(${GLESv2_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}) |
2593 | |
2594 | add_library( |
2595 | mirgraphics OBJECT |
2596 | |
2597 | === modified file 'src/server/graphics/default_configuration.cpp' |
2598 | --- src/server/graphics/default_configuration.cpp 2014-07-30 15:25:54 +0000 |
2599 | +++ src/server/graphics/default_configuration.cpp 2014-08-29 01:18:58 +0000 |
2600 | @@ -28,10 +28,11 @@ |
2601 | #include "mir/graphics/buffer_initializer.h" |
2602 | #include "mir/graphics/gl_config.h" |
2603 | #include "mir/graphics/cursor.h" |
2604 | +#include "src/platform/graphics/platform_probe.h" |
2605 | #include "program_factory.h" |
2606 | |
2607 | #include "mir/shared_library.h" |
2608 | -#include "mir/shared_library_loader.h" |
2609 | +#include "mir/shared_library_prober.h" |
2610 | #include "mir/abnormal_exit.h" |
2611 | #include "mir/emergency_cleanup.h" |
2612 | |
2613 | @@ -43,6 +44,12 @@ |
2614 | |
2615 | namespace mg = mir::graphics; |
2616 | |
2617 | +namespace |
2618 | +{ |
2619 | +// TODO: Temporary, until we actually manage module lifetimes |
2620 | +static std::shared_ptr<mir::SharedLibrary> platform_library; |
2621 | +} |
2622 | + |
2623 | std::shared_ptr<mg::BufferInitializer> |
2624 | mir::DefaultServerConfiguration::the_buffer_initializer() |
2625 | { |
2626 | @@ -71,14 +78,26 @@ |
2627 | if (!the_options()->is_set(options::host_socket_opt)) |
2628 | { |
2629 | // fallback to standalone if host socket is unset |
2630 | - auto graphics_lib = mir::load_library(the_options()->get<std::string>(options::platform_graphics_lib)); |
2631 | - auto create_platform = graphics_lib->load_function<mg::CreatePlatform>("create_platform"); |
2632 | + if (the_options()->is_set(options::platform_graphics_lib)) |
2633 | + { |
2634 | + platform_library = std::make_shared<mir::SharedLibrary>(the_options()->get<std::string>(options::platform_graphics_lib)); |
2635 | + } |
2636 | + else |
2637 | + { |
2638 | + auto platforms = mir::libraries_for_path(the_options()->get<std::string>(options::platform_graphics_path), *the_shared_library_prober_report()); |
2639 | + if (platforms.empty()) |
2640 | + { |
2641 | + throw std::runtime_error("Failed to find any platform plugins in: " MIR_SERVER_PLATFORM_PLUGIN_PATH); |
2642 | + } |
2643 | + platform_library = mir::graphics::module_for_device(platforms); |
2644 | + } |
2645 | + auto create_platform = platform_library->load_function<mg::CreatePlatform>("create_platform"); |
2646 | return create_platform(the_options(), the_emergency_cleanup(), the_display_report()); |
2647 | } |
2648 | |
2649 | return std::make_shared<mir::graphics::nested::NestedPlatform>( |
2650 | the_host_connection(), |
2651 | - the_input_dispatcher(), |
2652 | + the_input_dispatcher(), |
2653 | the_display_report(), |
2654 | the_graphics_native_platform()); |
2655 | }); |
2656 | @@ -89,8 +108,20 @@ |
2657 | return graphics_native_platform( |
2658 | [this]() |
2659 | { |
2660 | - auto graphics_lib = mir::load_library(the_options()->get<std::string>(options::platform_graphics_lib)); |
2661 | - auto create_native_platform = graphics_lib->load_function<mg::CreateNativePlatform>("create_native_platform"); |
2662 | + if (the_options()->is_set(options::platform_graphics_lib)) |
2663 | + { |
2664 | + platform_library = std::make_shared<mir::SharedLibrary>(the_options()->get<std::string>(options::platform_graphics_lib)); |
2665 | + } |
2666 | + else |
2667 | + { |
2668 | + auto platforms = mir::libraries_for_path(the_options()->get<std::string>(options::platform_graphics_path), *the_shared_library_prober_report()); |
2669 | + if (platforms.empty()) |
2670 | + { |
2671 | + throw std::runtime_error("Failed to find any platform plugins in: " MIR_SERVER_PLATFORM_PLUGIN_PATH); |
2672 | + } |
2673 | + platform_library = mir::graphics::module_for_device(platforms); |
2674 | + } |
2675 | + auto create_native_platform = platform_library->load_function<mg::CreateNativePlatform>("create_native_platform"); |
2676 | |
2677 | return create_native_platform(the_display_report()); |
2678 | }); |
2679 | |
2680 | === modified file 'src/server/logging/CMakeLists.txt' |
2681 | --- src/server/logging/CMakeLists.txt 2014-08-06 12:36:12 +0000 |
2682 | +++ src/server/logging/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2683 | @@ -12,4 +12,3 @@ |
2684 | |
2685 | ${LOGGING_SOURCES} |
2686 | ) |
2687 | - |
2688 | |
2689 | === modified file 'src/server/report/default_server_configuration.cpp' |
2690 | --- src/server/report/default_server_configuration.cpp 2014-03-06 06:05:17 +0000 |
2691 | +++ src/server/report/default_server_configuration.cpp 2014-08-29 01:18:58 +0000 |
2692 | @@ -117,3 +117,12 @@ |
2693 | return report_factory(options::scene_report_opt)->create_scene_report(); |
2694 | }); |
2695 | } |
2696 | + |
2697 | +auto mir::DefaultServerConfiguration::the_shared_library_prober_report() -> std::shared_ptr<SharedLibraryProberReport> |
2698 | +{ |
2699 | + return shared_library_prober_report( |
2700 | + [this]()->std::shared_ptr<SharedLibraryProberReport> |
2701 | + { |
2702 | + return report_factory(options::shared_library_prober_report_opt)->create_shared_library_prober_report(); |
2703 | + }); |
2704 | +} |
2705 | |
2706 | === modified file 'src/server/report/logging/CMakeLists.txt' |
2707 | --- src/server/report/logging/CMakeLists.txt 2014-08-06 12:22:34 +0000 |
2708 | +++ src/server/report/logging/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2709 | @@ -18,4 +18,3 @@ |
2710 | |
2711 | ${LOGGING_SOURCES} |
2712 | ) |
2713 | - |
2714 | |
2715 | === modified file 'src/server/report/logging/logging_report_factory.cpp' |
2716 | --- src/server/report/logging/logging_report_factory.cpp 2014-02-11 15:18:07 +0000 |
2717 | +++ src/server/report/logging/logging_report_factory.cpp 2014-08-29 01:18:58 +0000 |
2718 | @@ -25,6 +25,7 @@ |
2719 | #include "scene_report.h" |
2720 | #include "session_mediator_report.h" |
2721 | #include "input_report.h" |
2722 | +#include "mir/logging/shared_library_prober_report.h" |
2723 | |
2724 | #include "mir/default_server_configuration.h" |
2725 | |
2726 | @@ -72,4 +73,7 @@ |
2727 | return std::make_shared<logging::InputReport>(logger); |
2728 | } |
2729 | |
2730 | - |
2731 | +std::shared_ptr<mir::SharedLibraryProberReport> mr::LoggingReportFactory::create_shared_library_prober_report() |
2732 | +{ |
2733 | + return std::make_shared<mir::logging::SharedLibraryProberReport>(logger); |
2734 | +} |
2735 | |
2736 | === modified file 'src/server/report/logging_report_factory.h' |
2737 | --- src/server/report/logging_report_factory.h 2014-02-11 15:18:07 +0000 |
2738 | +++ src/server/report/logging_report_factory.h 2014-08-29 01:18:58 +0000 |
2739 | @@ -47,6 +47,8 @@ |
2740 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
2741 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
2742 | std::shared_ptr<input::InputReport> create_input_report() override; |
2743 | + std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override; |
2744 | + |
2745 | |
2746 | private: |
2747 | std::shared_ptr<mir::logging::Logger> const logger; |
2748 | |
2749 | === modified file 'src/server/report/lttng/CMakeLists.txt' |
2750 | --- src/server/report/lttng/CMakeLists.txt 2014-08-06 12:22:34 +0000 |
2751 | +++ src/server/report/lttng/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2752 | @@ -17,6 +17,7 @@ |
2753 | session_mediator_report.cpp |
2754 | scene_report.cpp |
2755 | server_tracepoint_provider.cpp |
2756 | + shared_library_prober_report.cpp |
2757 | ) |
2758 | |
2759 | add_library( |
2760 | |
2761 | === modified file 'src/server/report/lttng/lttng_report_factory.cpp' |
2762 | --- src/server/report/lttng/lttng_report_factory.cpp 2014-02-11 15:18:07 +0000 |
2763 | +++ src/server/report/lttng/lttng_report_factory.cpp 2014-08-29 01:18:58 +0000 |
2764 | @@ -25,6 +25,7 @@ |
2765 | #include "message_processor_report.h" |
2766 | #include "scene_report.h" |
2767 | #include "session_mediator_report.h" |
2768 | +#include "shared_library_prober_report.h" |
2769 | |
2770 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::LttngReportFactory::create_compositor_report() |
2771 | { |
2772 | @@ -61,4 +62,8 @@ |
2773 | return std::make_shared<lttng::InputReport>(); |
2774 | } |
2775 | |
2776 | +std::shared_ptr<mir::SharedLibraryProberReport> mir::report::LttngReportFactory::create_shared_library_prober_report() |
2777 | +{ |
2778 | + return std::make_shared<lttng::SharedLibraryProberReport>(); |
2779 | +} |
2780 | |
2781 | |
2782 | === added file 'src/server/report/lttng/shared_library_prober_report.cpp' |
2783 | --- src/server/report/lttng/shared_library_prober_report.cpp 1970-01-01 00:00:00 +0000 |
2784 | +++ src/server/report/lttng/shared_library_prober_report.cpp 2014-08-29 01:18:58 +0000 |
2785 | @@ -0,0 +1,48 @@ |
2786 | +/* |
2787 | + * Copyright © 2014 Canonical Ltd. |
2788 | + * |
2789 | + * This program is free software: you can redistribute it and/or modify it |
2790 | + * under the terms of the GNU General Public License version 3, |
2791 | + * as published by the Free Software Foundation. |
2792 | + * |
2793 | + * This program is distributed in the hope that it will be useful, |
2794 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2795 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2796 | + * GNU General Public License for more details. |
2797 | + * |
2798 | + * You should have received a copy of the GNU General Public License |
2799 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2800 | + * |
2801 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2802 | + */ |
2803 | + |
2804 | +#include "shared_library_prober_report.h" |
2805 | +#include "mir/report/lttng/mir_tracepoint.h" |
2806 | + |
2807 | +#define TRACEPOINT_DEFINE |
2808 | +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE |
2809 | +#include "shared_library_prober_report_tp.h" |
2810 | + |
2811 | +void mir::report::lttng::SharedLibraryProberReport::probing_path(boost::filesystem::path const& path) |
2812 | +{ |
2813 | + mir_tracepoint(mir_server_shared_library_prober, probing_path, |
2814 | + path.string().c_str()); |
2815 | +} |
2816 | + |
2817 | +void mir::report::lttng::SharedLibraryProberReport::probing_failed(boost::filesystem::path const& path, std::exception const& error) |
2818 | +{ |
2819 | + mir_tracepoint(mir_server_shared_library_prober, probing_failed, |
2820 | + path.string().c_str(), error.what()); |
2821 | +} |
2822 | + |
2823 | +void mir::report::lttng::SharedLibraryProberReport::loading_library(boost::filesystem::path const& filename) |
2824 | +{ |
2825 | + mir_tracepoint(mir_server_shared_library_prober, loading_library, |
2826 | + filename.string().c_str()); |
2827 | +} |
2828 | + |
2829 | +void mir::report::lttng::SharedLibraryProberReport::loading_failed(boost::filesystem::path const& filename, std::exception const& error) |
2830 | +{ |
2831 | + mir_tracepoint(mir_server_shared_library_prober, loading_failed, |
2832 | + filename.string().c_str(), error.what()); |
2833 | +} |
2834 | |
2835 | === added file 'src/server/report/lttng/shared_library_prober_report.h' |
2836 | --- src/server/report/lttng/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
2837 | +++ src/server/report/lttng/shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
2838 | @@ -0,0 +1,52 @@ |
2839 | +/* |
2840 | + * Copyright © 2014 Canonical Ltd. |
2841 | + * |
2842 | + * This program is free software: you can redistribute it and/or modify it |
2843 | + * under the terms of the GNU General Public License version 3, |
2844 | + * as published by the Free Software Foundation. |
2845 | + * |
2846 | + * This program is distributed in the hope that it will be useful, |
2847 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2848 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2849 | + * GNU General Public License for more details. |
2850 | + * |
2851 | + * You should have received a copy of the GNU General Public License |
2852 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2853 | + * |
2854 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2855 | + */ |
2856 | + |
2857 | +#ifndef MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
2858 | +#define MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
2859 | + |
2860 | +#include "server_tracepoint_provider.h" |
2861 | + |
2862 | +#include "mir/shared_library_prober_report.h" |
2863 | + |
2864 | +#include <stdexcept> |
2865 | +#include <string> |
2866 | + |
2867 | +namespace mir |
2868 | +{ |
2869 | +namespace report |
2870 | +{ |
2871 | +namespace lttng |
2872 | +{ |
2873 | + |
2874 | +class SharedLibraryProberReport : public mir::SharedLibraryProberReport |
2875 | +{ |
2876 | +public: |
2877 | + void probing_path(boost::filesystem::path const& path) override; |
2878 | + void probing_failed(boost::filesystem::path const& path, std::exception const& error) override; |
2879 | + void loading_library(boost::filesystem::path const& filename) override; |
2880 | + void loading_failed(boost::filesystem::path const& filename, std::exception const& error) override; |
2881 | + |
2882 | +private: |
2883 | + ServerTracepointProvider tp_provider; |
2884 | +}; |
2885 | + |
2886 | +} |
2887 | +} |
2888 | +} |
2889 | + |
2890 | +#endif // MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_H_ |
2891 | |
2892 | === added file 'src/server/report/lttng/shared_library_prober_report_tp.h' |
2893 | --- src/server/report/lttng/shared_library_prober_report_tp.h 1970-01-01 00:00:00 +0000 |
2894 | +++ src/server/report/lttng/shared_library_prober_report_tp.h 2014-08-29 01:18:58 +0000 |
2895 | @@ -0,0 +1,71 @@ |
2896 | +/* |
2897 | + * Copyright © 2014 Canonical Ltd. |
2898 | + * |
2899 | + * This program is free software: you can redistribute it and/or modify it |
2900 | + * under the terms of the GNU General Public License version 3, |
2901 | + * as published by the Free Software Foundation. |
2902 | + * |
2903 | + * This program is distributed in the hope that it will be useful, |
2904 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2905 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2906 | + * GNU General Public License for more details. |
2907 | + * |
2908 | + * You should have received a copy of the GNU General Public License |
2909 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2910 | + * |
2911 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
2912 | + */ |
2913 | + |
2914 | +#undef TRACEPOINT_PROVIDER |
2915 | +#define TRACEPOINT_PROVIDER mir_server_shared_library_prober |
2916 | + |
2917 | +#undef TRACEPOINT_INCLUDE |
2918 | +#define TRACEPOINT_INCLUDE "./shared_library_prober_report_tp.h" |
2919 | + |
2920 | +#if !defined(MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_) || defined(TRACEPOINT_HEADER_MULTI_READ) |
2921 | +#define MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ |
2922 | + |
2923 | +#include <lttng/tracepoint.h> |
2924 | +#include <stdint.h> |
2925 | + |
2926 | +TRACEPOINT_EVENT( |
2927 | + mir_server_shared_library_prober, |
2928 | + probing_path, |
2929 | + TP_ARGS(const char*, path), |
2930 | + TP_FIELDS( |
2931 | + ctf_string(path, path) |
2932 | + ) |
2933 | +) |
2934 | + |
2935 | +TRACEPOINT_EVENT( |
2936 | + mir_server_shared_library_prober, |
2937 | + probing_failed, |
2938 | + TP_ARGS(const char*, path, const char*, message), |
2939 | + TP_FIELDS( |
2940 | + ctf_string(path, path) |
2941 | + ctf_string(message, message) |
2942 | + ) |
2943 | +) |
2944 | + |
2945 | +TRACEPOINT_EVENT( |
2946 | + mir_server_shared_library_prober, |
2947 | + loading_library, |
2948 | + TP_ARGS(const char*, path), |
2949 | + TP_FIELDS( |
2950 | + ctf_string(path, path) |
2951 | + ) |
2952 | +) |
2953 | + |
2954 | +TRACEPOINT_EVENT( |
2955 | + mir_server_shared_library_prober, |
2956 | + loading_failed, |
2957 | + TP_ARGS(const char*, path, const char*, message), |
2958 | + TP_FIELDS( |
2959 | + ctf_string(path, path) |
2960 | + ctf_string(message, message) |
2961 | + ) |
2962 | +) |
2963 | + |
2964 | +#endif /* MIR_REPORT_LTTNG_SHARED_LIBRARY_PROBER_REPORT_TP_H_ */ |
2965 | + |
2966 | +#include <lttng/tracepoint-event.h> |
2967 | |
2968 | === modified file 'src/server/report/lttng_report_factory.h' |
2969 | --- src/server/report/lttng_report_factory.h 2014-02-11 15:18:07 +0000 |
2970 | +++ src/server/report/lttng_report_factory.h 2014-08-29 01:18:58 +0000 |
2971 | @@ -35,6 +35,7 @@ |
2972 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
2973 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
2974 | std::shared_ptr<input::InputReport> create_input_report() override; |
2975 | + std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override; |
2976 | }; |
2977 | } |
2978 | } |
2979 | |
2980 | === modified file 'src/server/report/null/CMakeLists.txt' |
2981 | --- src/server/report/null/CMakeLists.txt 2014-08-06 12:22:34 +0000 |
2982 | +++ src/server/report/null/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
2983 | @@ -9,4 +9,5 @@ |
2984 | null_report_factory.cpp |
2985 | scene_report.cpp |
2986 | session_mediator_report.cpp |
2987 | + shared_library_prober_report.cpp |
2988 | ) |
2989 | |
2990 | === modified file 'src/server/report/null/null_report_factory.cpp' |
2991 | --- src/server/report/null/null_report_factory.cpp 2014-02-17 22:35:23 +0000 |
2992 | +++ src/server/report/null/null_report_factory.cpp 2014-08-29 01:18:58 +0000 |
2993 | @@ -25,6 +25,7 @@ |
2994 | #include "display_report.h" |
2995 | #include "input_report.h" |
2996 | #include "scene_report.h" |
2997 | +#include "shared_library_prober_report.h" |
2998 | |
2999 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::NullReportFactory::create_compositor_report() |
3000 | { |
3001 | @@ -61,6 +62,11 @@ |
3002 | return std::make_shared<null::InputReport>(); |
3003 | } |
3004 | |
3005 | +std::shared_ptr<mir::SharedLibraryProberReport> mir::report::NullReportFactory::create_shared_library_prober_report() |
3006 | +{ |
3007 | + return std::make_shared<null::SharedLibraryProberReport>(); |
3008 | +} |
3009 | + |
3010 | std::shared_ptr<mir::compositor::CompositorReport> mir::report::null_compositor_report() |
3011 | { |
3012 | return NullReportFactory{}.create_compositor_report(); |
3013 | @@ -90,3 +96,8 @@ |
3014 | { |
3015 | return NullReportFactory{}.create_input_report(); |
3016 | } |
3017 | + |
3018 | +std::shared_ptr<mir::SharedLibraryProberReport> mir::report::null_shared_library_prober_report() |
3019 | +{ |
3020 | + return NullReportFactory{}.create_shared_library_prober_report(); |
3021 | +} |
3022 | |
3023 | === added file 'src/server/report/null/shared_library_prober_report.cpp' |
3024 | --- src/server/report/null/shared_library_prober_report.cpp 1970-01-01 00:00:00 +0000 |
3025 | +++ src/server/report/null/shared_library_prober_report.cpp 2014-08-29 01:18:58 +0000 |
3026 | @@ -0,0 +1,35 @@ |
3027 | +/* |
3028 | + * Copyright © 2014 Canonical Ltd. |
3029 | + * |
3030 | + * This program is free software: you can redistribute it and/or modify it |
3031 | + * under the terms of the GNU General Public License version 3, |
3032 | + * as published by the Free Software Foundation. |
3033 | + * |
3034 | + * This program is distributed in the hope that it will be useful, |
3035 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3036 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3037 | + * GNU General Public License for more details. |
3038 | + * |
3039 | + * You should have received a copy of the GNU General Public License |
3040 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3041 | + * |
3042 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3043 | + */ |
3044 | + |
3045 | +#include "shared_library_prober_report.h" |
3046 | + |
3047 | +void mir::report::null::SharedLibraryProberReport::probing_path(boost::filesystem::path const& /*path*/) |
3048 | +{ |
3049 | +} |
3050 | + |
3051 | +void mir::report::null::SharedLibraryProberReport::probing_failed(boost::filesystem::path const& /*path*/, std::exception const& /*error*/) |
3052 | +{ |
3053 | +} |
3054 | + |
3055 | +void mir::report::null::SharedLibraryProberReport::loading_library(boost::filesystem::path const& /*filename*/) |
3056 | +{ |
3057 | +} |
3058 | + |
3059 | +void mir::report::null::SharedLibraryProberReport::loading_failed(boost::filesystem::path const& /*filename*/, std::exception const& /*error*/) |
3060 | +{ |
3061 | +} |
3062 | |
3063 | === added file 'src/server/report/null/shared_library_prober_report.h' |
3064 | --- src/server/report/null/shared_library_prober_report.h 1970-01-01 00:00:00 +0000 |
3065 | +++ src/server/report/null/shared_library_prober_report.h 2014-08-29 01:18:58 +0000 |
3066 | @@ -0,0 +1,43 @@ |
3067 | +/* |
3068 | + * Copyright © 2014 Canonical Ltd. |
3069 | + * |
3070 | + * This program is free software: you can redistribute it and/or modify it |
3071 | + * under the terms of the GNU General Public License version 3, |
3072 | + * as published by the Free Software Foundation. |
3073 | + * |
3074 | + * This program is distributed in the hope that it will be useful, |
3075 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3076 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3077 | + * GNU General Public License for more details. |
3078 | + * |
3079 | + * You should have received a copy of the GNU General Public License |
3080 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3081 | + * |
3082 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3083 | + */ |
3084 | + |
3085 | +#ifndef MIR_REPORT_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ |
3086 | +#define MIR_REPORT_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ |
3087 | + |
3088 | +#include "mir/shared_library_prober_report.h" |
3089 | + |
3090 | +namespace mir |
3091 | +{ |
3092 | +namespace report |
3093 | +{ |
3094 | +namespace null |
3095 | +{ |
3096 | +class SharedLibraryProberReport : public mir::SharedLibraryProberReport |
3097 | +{ |
3098 | +public: |
3099 | + void probing_path(boost::filesystem::path const& path); |
3100 | + void probing_failed(boost::filesystem::path const& path, std::exception const& error); |
3101 | + void loading_library(boost::filesystem::path const& filename); |
3102 | + void loading_failed(boost::filesystem::path const& filename, std::exception const& error); |
3103 | +}; |
3104 | + |
3105 | +} |
3106 | +} |
3107 | +} |
3108 | + |
3109 | +#endif // MIR_REPORT_NULL_SHARED_LIBRARY_PROBER_REPORT_H_ |
3110 | |
3111 | === modified file 'src/server/report/null_report_factory.h' |
3112 | --- src/server/report/null_report_factory.h 2014-02-17 22:35:23 +0000 |
3113 | +++ src/server/report/null_report_factory.h 2014-08-29 01:18:58 +0000 |
3114 | @@ -35,6 +35,7 @@ |
3115 | std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() override; |
3116 | std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() override; |
3117 | std::shared_ptr<input::InputReport> create_input_report() override; |
3118 | + std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() override; |
3119 | }; |
3120 | |
3121 | std::shared_ptr<compositor::CompositorReport> null_compositor_report(); |
3122 | @@ -44,7 +45,7 @@ |
3123 | std::shared_ptr<frontend::SessionMediatorReport> null_session_mediator_report(); |
3124 | std::shared_ptr<frontend::MessageProcessorReport> null_message_processor_report(); |
3125 | std::shared_ptr<input::InputReport> null_input_report(); |
3126 | - |
3127 | +std::shared_ptr<SharedLibraryProberReport> null_shared_library_prober_report(); |
3128 | } |
3129 | } |
3130 | |
3131 | |
3132 | === modified file 'src/server/report/report_factory.h' |
3133 | --- src/server/report/report_factory.h 2014-02-11 15:18:07 +0000 |
3134 | +++ src/server/report/report_factory.h 2014-08-29 01:18:58 +0000 |
3135 | @@ -23,6 +23,8 @@ |
3136 | |
3137 | namespace mir |
3138 | { |
3139 | + |
3140 | +class SharedLibraryProberReport; |
3141 | namespace compositor |
3142 | { |
3143 | class CompositorReport; |
3144 | @@ -59,6 +61,7 @@ |
3145 | virtual std::shared_ptr<frontend::SessionMediatorReport> create_session_mediator_report() = 0; |
3146 | virtual std::shared_ptr<frontend::MessageProcessorReport> create_message_processor_report() = 0; |
3147 | virtual std::shared_ptr<input::InputReport> create_input_report() = 0; |
3148 | + virtual std::shared_ptr<SharedLibraryProberReport> create_shared_library_prober_report() = 0; |
3149 | |
3150 | protected: |
3151 | ReportFactory() = default; |
3152 | |
3153 | === modified file 'src/shared/graphics/android/mir_native_window.cpp' |
3154 | --- src/shared/graphics/android/mir_native_window.cpp 2014-08-20 23:58:45 +0000 |
3155 | +++ src/shared/graphics/android/mir_native_window.cpp 2014-08-29 01:18:58 +0000 |
3156 | @@ -20,7 +20,6 @@ |
3157 | #include "mir/graphics/android/android_driver_interpreter.h" |
3158 | #include "mir/graphics/android/sync_fence.h" |
3159 | |
3160 | -#include <iostream> |
3161 | #include <boost/exception/diagnostic_information.hpp> |
3162 | |
3163 | namespace mg=mir::graphics; |
3164 | |
3165 | === modified file 'src/shared/logging/CMakeLists.txt' |
3166 | --- src/shared/logging/CMakeLists.txt 2014-07-24 11:30:35 +0000 |
3167 | +++ src/shared/logging/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3168 | @@ -17,7 +17,8 @@ |
3169 | add_library(mirsharedlogging OBJECT |
3170 | dumb_console_logger.cpp |
3171 | input_timestamp.cpp |
3172 | -) |
3173 | + shared_library_prober_report.cpp |
3174 | +) |
3175 | |
3176 | list(APPEND MIR_COMMON_SOURCES |
3177 | $<TARGET_OBJECTS:mirsharedlogging> |
3178 | |
3179 | === added file 'src/shared/logging/shared_library_prober_report.cpp' |
3180 | --- src/shared/logging/shared_library_prober_report.cpp 1970-01-01 00:00:00 +0000 |
3181 | +++ src/shared/logging/shared_library_prober_report.cpp 2014-08-29 01:18:58 +0000 |
3182 | @@ -0,0 +1,58 @@ |
3183 | + |
3184 | +/* |
3185 | + * Copyright © 2014 Canonical Ltd. |
3186 | + * |
3187 | + * This program is free software: you can redistribute it and/or modify |
3188 | + * it under the terms of the GNU Lesser General Public License version 3 as |
3189 | + * published by the Free Software Foundation. |
3190 | + * |
3191 | + * This program is distributed in the hope that it will be useful, |
3192 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3193 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3194 | + * GNU Lesser General Public License for more details. |
3195 | + * |
3196 | + * You should have received a copy of the GNU Lesser General Public License |
3197 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3198 | + * |
3199 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3200 | + */ |
3201 | + |
3202 | +#include "mir/logging/shared_library_prober_report.h" |
3203 | +#include "mir/logging/logger.h" |
3204 | + |
3205 | +namespace ml = mir::logging; |
3206 | + |
3207 | +ml::SharedLibraryProberReport::SharedLibraryProberReport(std::shared_ptr<Logger> const& logger) |
3208 | + : logger{logger} |
3209 | +{ |
3210 | +} |
3211 | + |
3212 | +void ml::SharedLibraryProberReport::probing_path(boost::filesystem::path const& path) |
3213 | +{ |
3214 | + logger->log(ml::Logger::Severity::informational, |
3215 | + std::string("Loading modules from: ") + path.string(), |
3216 | + "Loader"); |
3217 | +} |
3218 | + |
3219 | +void ml::SharedLibraryProberReport::probing_failed(boost::filesystem::path const& path, std::exception const& error) |
3220 | +{ |
3221 | + logger->log(ml::Logger::Severity::error, |
3222 | + std::string("Failed to load libraries from path: ") + path.string() + |
3223 | + " (error was:" + error.what() + ")", |
3224 | + "Loader"); |
3225 | +} |
3226 | + |
3227 | +void ml::SharedLibraryProberReport::loading_library(boost::filesystem::path const& filename) |
3228 | +{ |
3229 | + logger->log(ml::Logger::Severity::informational, |
3230 | + std::string("Loading module: ") + filename.string(), |
3231 | + "Loader"); |
3232 | +} |
3233 | + |
3234 | +void ml::SharedLibraryProberReport::loading_failed(boost::filesystem::path const& filename, std::exception const& error) |
3235 | +{ |
3236 | + logger->log(ml::Logger::Severity::warning, |
3237 | + std::string("Failed to load module: ") + filename.string() + |
3238 | + " (error was:" + error.what() + ")", |
3239 | + "Loader"); |
3240 | +} |
3241 | |
3242 | === modified file 'src/shared/sharedlibrary/CMakeLists.txt' |
3243 | --- src/shared/sharedlibrary/CMakeLists.txt 2014-07-24 11:30:35 +0000 |
3244 | +++ src/shared/sharedlibrary/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3245 | @@ -16,13 +16,17 @@ |
3246 | |
3247 | add_library(mirsharedsharedlibrary OBJECT |
3248 | shared_library.cpp |
3249 | + shared_library_prober.cpp |
3250 | ) |
3251 | |
3252 | list(APPEND MIR_COMMON_SOURCES |
3253 | $<TARGET_OBJECTS:mirsharedsharedlibrary> |
3254 | ) |
3255 | |
3256 | -list(APPEND MIR_COMMON_REFERENCES dl) |
3257 | +list(APPEND MIR_COMMON_REFERENCES |
3258 | + dl |
3259 | + ${Boost_LIBRARIES} |
3260 | +) |
3261 | |
3262 | set(MIR_COMMON_SOURCES ${MIR_COMMON_SOURCES} PARENT_SCOPE) |
3263 | set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE) |
3264 | |
3265 | === added file 'src/shared/sharedlibrary/shared_library_prober.cpp' |
3266 | --- src/shared/sharedlibrary/shared_library_prober.cpp 1970-01-01 00:00:00 +0000 |
3267 | +++ src/shared/sharedlibrary/shared_library_prober.cpp 2014-08-29 01:18:58 +0000 |
3268 | @@ -0,0 +1,63 @@ |
3269 | +/* |
3270 | + * Copyright © 2014 Canonical Ltd. |
3271 | + * |
3272 | + * This program is free software: you can redistribute it and/or modify it |
3273 | + * under the terms of the GNU Lesser General Public License version 3, |
3274 | + * as published by the Free Software Foundation. |
3275 | + * |
3276 | + * This program is distributed in the hope that it will be useful, |
3277 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3278 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3279 | + * GNU Lesser General Public License for more details. |
3280 | + * |
3281 | + * You should have received a copy of the GNU Lesser General Public License |
3282 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3283 | + * |
3284 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3285 | + */ |
3286 | + |
3287 | +#include "mir/shared_library_prober.h" |
3288 | +#include "mir/shared_library.h" |
3289 | + |
3290 | +#include <system_error> |
3291 | +#include <boost/filesystem.hpp> |
3292 | + |
3293 | +std::vector<std::shared_ptr<mir::SharedLibrary>> |
3294 | +mir::libraries_for_path(std::string const& path, mir::SharedLibraryProberReport& report) |
3295 | +{ |
3296 | + report.probing_path(path); |
3297 | + // We use the error_code overload because we want to throw a std::system_error |
3298 | + boost::system::error_code ec; |
3299 | + boost::filesystem::directory_iterator iterator{path, ec}; |
3300 | + if (ec) |
3301 | + { |
3302 | + // *Of course* there's no good way to go from a boost::error_code to a std::error_code |
3303 | + if (ec.category() == boost::system::system_category()) |
3304 | + { |
3305 | + std::system_error error{ec.value(), std::system_category()}; |
3306 | + report.probing_failed(path, error); |
3307 | + throw error; |
3308 | + } |
3309 | + else |
3310 | + { |
3311 | + throw std::runtime_error{"Boost error from unknown category"}; |
3312 | + } |
3313 | + } |
3314 | + std::vector<std::shared_ptr<mir::SharedLibrary>> libraries; |
3315 | + for (; iterator != boost::filesystem::directory_iterator() ; ++iterator) |
3316 | + { |
3317 | + if (iterator->path().extension().string() == ".so") |
3318 | + { |
3319 | + try |
3320 | + { |
3321 | + report.loading_library(iterator->path()); |
3322 | + libraries.emplace_back(std::make_shared<mir::SharedLibrary>(iterator->path().string())); |
3323 | + } |
3324 | + catch (std::runtime_error const& err) |
3325 | + { |
3326 | + report.loading_failed(iterator->path(), err); |
3327 | + } |
3328 | + } |
3329 | + } |
3330 | + return libraries; |
3331 | +} |
3332 | |
3333 | === modified file 'src/shared/symbols.map' |
3334 | --- src/shared/symbols.map 2014-08-25 11:03:32 +0000 |
3335 | +++ src/shared/symbols.map 2014-08-29 01:18:58 +0000 |
3336 | @@ -130,12 +130,19 @@ |
3337 | mir::input::receiver::XKBMapper::update_state_and_map_event*; |
3338 | mir::input::receiver::XKBMapper::?XKBMapper*; |
3339 | mir::input::receiver::XKBMapper::XKBMapper*; |
3340 | + mir::libraries_for_path*; |
3341 | mir::logging::DumbConsoleLogger::log*; |
3342 | mir::logging::input_timestamp*; |
3343 | mir::logging::Logger::log*; |
3344 | mir::logging::Logger::?Logger*; |
3345 | mir::logging::Logger::Logger*; |
3346 | mir::logging::Logger::operator*; |
3347 | + mir::logging::SharedLibraryProberReport::?SharedLibraryProberReport*; |
3348 | + mir::logging::SharedLibraryProberReport::SharedLibraryProberReport*; |
3349 | + mir::logging::SharedLibraryProberReport::probing_path*; |
3350 | + mir::logging::SharedLibraryProberReport::probing_failed*; |
3351 | + mir::logging::SharedLibraryProberReport::loading_library*; |
3352 | + mir::logging::SharedLibraryProberReport::loading_failed*; |
3353 | mir_omnidirectional_resize_cursor_name*; |
3354 | mir_open_hand_cursor_name*; |
3355 | mir_pointing_hand_cursor_name*; |
3356 | @@ -807,6 +814,7 @@ |
3357 | typeinfo?for?MirKeyEvent; |
3358 | typeinfo?for?mir::logging::DumbConsoleLogger; |
3359 | typeinfo?for?mir::logging::Logger; |
3360 | + typeinfo?for?mir::logging::SharedLibraryProberReport; |
3361 | typeinfo?for?MirMesaEGLNativeDisplay; |
3362 | typeinfo?for?MirMesaEGLNativeSurface; |
3363 | typeinfo?for?MirMotionEvent; |
3364 | @@ -899,6 +907,7 @@ |
3365 | vtable?for?MirKeyEvent; |
3366 | vtable?for?mir::logging::DumbConsoleLogger; |
3367 | vtable?for?mir::logging::Logger; |
3368 | + vtable?for?mir::logging::SharedLibraryProberReport; |
3369 | vtable?for?MirMesaEGLNativeDisplay; |
3370 | vtable?for?MirMesaEGLNativeSurface; |
3371 | vtable?for?MirMotionEvent; |
3372 | |
3373 | === modified file 'tests/acceptance-tests/CMakeLists.txt' |
3374 | --- tests/acceptance-tests/CMakeLists.txt 2014-08-06 15:15:35 +0000 |
3375 | +++ tests/acceptance-tests/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3376 | @@ -90,8 +90,10 @@ |
3377 | "MIR_BUILD_ACCEPTANCE_TESTS" |
3378 | OFF) |
3379 | |
3380 | +set (MIR_CLIENT_PLATFORM client-platform-dummy.so) |
3381 | + |
3382 | if (MIR_RUN_ACCEPTANCE_TESTS) |
3383 | - mir_discover_tests(mir_acceptance_tests) |
3384 | + mir_discover_tests(mir_acceptance_tests MIR_CLIENT_PLATFORM_LIB=${LIBRARY_OUTPUT_PATH}/${MIR_CLIENT_PLATFORM}) |
3385 | endif (MIR_RUN_ACCEPTANCE_TESTS) |
3386 | |
3387 | install( |
3388 | |
3389 | === modified file 'tests/acceptance-tests/test_symbols_required_by_mesa.cpp' |
3390 | --- tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2014-07-30 13:19:36 +0000 |
3391 | +++ tests/acceptance-tests/test_symbols_required_by_mesa.cpp 2014-08-29 01:18:58 +0000 |
3392 | @@ -23,9 +23,9 @@ |
3393 | |
3394 | using namespace testing; |
3395 | |
3396 | -TEST(SymbolsRequiredByMesa, are_exported_by_libmirclientplatform) |
3397 | +TEST(SymbolsRequiredByMesa, are_exported_by_client_platform_mesa) |
3398 | { |
3399 | - auto const handle = dlopen("libmirclientplatform.so", RTLD_LAZY); |
3400 | + auto const handle = dlopen("client-platform-mesa.so", RTLD_LAZY); |
3401 | ASSERT_THAT(handle, NotNull()); |
3402 | |
3403 | auto const sym = dlsym(handle, "mir_client_mesa_egl_native_display_is_valid"); |
3404 | @@ -36,7 +36,7 @@ |
3405 | |
3406 | TEST(SymbolsRequiredByMesa, are_exported_by_libmirplatformgraphics) |
3407 | { |
3408 | - auto const handle = dlopen("libmirplatformgraphics.so", RTLD_LAZY); |
3409 | + auto const handle = dlopen("platform-graphics-mesa.so", RTLD_LAZY); |
3410 | ASSERT_THAT(handle, NotNull()); |
3411 | |
3412 | auto const sym = dlsym(handle, "mir_server_mesa_egl_native_display_is_valid"); |
3413 | |
3414 | === modified file 'tests/integration-tests/CMakeLists.txt' |
3415 | --- tests/integration-tests/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
3416 | +++ tests/integration-tests/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3417 | @@ -71,6 +71,15 @@ |
3418 | ${GTEST_BOTH_LIBRARIES} |
3419 | ${GMOCK_LIBRARY} |
3420 | ${GMOCK_MAIN_LIBRARY} |
3421 | + # Mesa platform dependencies |
3422 | + ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
3423 | + ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
3424 | + # Android platform dependencies |
3425 | + ${LIBHARDWARE_LIBRARIES} |
3426 | + ${ANDROID_PROPERTIES_LIBRARIES} |
3427 | + # Shared platform dependencies |
3428 | + ${EGL_LDFLAGS} ${EGL_LIBRARIES} |
3429 | + ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
3430 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
3431 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
3432 | ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
3433 | @@ -79,7 +88,7 @@ |
3434 | ${MIR_SERVER_REFERENCES} |
3435 | ) |
3436 | |
3437 | -if (MIR_TEST_PLATFORM STREQUAL "android") |
3438 | +if (MIR_BUILD_PLATFORM_ANDROID) |
3439 | target_link_libraries(mir_integration_tests |
3440 | mirsharedandroid |
3441 | ${ANDROID_PROPERTIES_LDFLAGS} |
3442 | @@ -93,8 +102,18 @@ |
3443 | "MIR_BUILD_INTEGRATION_TESTS" |
3444 | OFF) |
3445 | |
3446 | +set (MIR_CLIENT_MODULE "client-platform-dummy.so") |
3447 | + |
3448 | +if (MIR_TEST_PLATFORM STREQUAL "android") |
3449 | + # Android platform integration tests have Android-specific tests |
3450 | + # requiring a real platform |
3451 | + set (MIR_CLIENT_MODULE "client-platform-android.so") |
3452 | +endif() |
3453 | + |
3454 | if (MIR_RUN_INTEGRATION_TESTS) |
3455 | - mir_discover_tests(mir_integration_tests) |
3456 | + mir_discover_tests(mir_integration_tests |
3457 | + MIR_CLIENT_PLATFORM_LIB=${LIBRARY_OUTPUT_PATH}/${MIR_CLIENT_MODULE} |
3458 | + ) |
3459 | endif (MIR_RUN_INTEGRATION_TESTS) |
3460 | |
3461 | install( |
3462 | |
3463 | === modified file 'tests/mir_test_doubles/CMakeLists.txt' |
3464 | --- tests/mir_test_doubles/CMakeLists.txt 2014-08-15 15:04:40 +0000 |
3465 | +++ tests/mir_test_doubles/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3466 | @@ -23,16 +23,19 @@ |
3467 | ${CMAKE_CURRENT_SOURCE_DIR}/mock_gl.cpp |
3468 | ) |
3469 | |
3470 | -if (MIR_TEST_PLATFORM STREQUAL "mesa") |
3471 | -include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
3472 | -list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
3473 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_drm.cpp |
3474 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_gbm.cpp |
3475 | -) |
3476 | -elseif (MIR_TEST_PLATFORM STREQUAL "android") |
3477 | -list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
3478 | - ${CMAKE_CURRENT_SOURCE_DIR}/mock_android_hw.cpp |
3479 | -) |
3480 | +if (MIR_BUILD_PLATFORM_MESA) |
3481 | + include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
3482 | + list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
3483 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_drm.cpp |
3484 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_gbm.cpp |
3485 | + ) |
3486 | +endif() |
3487 | + |
3488 | +if (MIR_BUILD_PLATFORM_ANDROID) |
3489 | + include_directories(${ANDROID_HEADERS_INCLUDE_DIRS}) |
3490 | + list(APPEND MIR_TEST_DOUBLES_PLATFORM_SRCS |
3491 | + ${CMAKE_CURRENT_SOURCE_DIR}/mock_android_hw.cpp |
3492 | + ) |
3493 | endif() |
3494 | |
3495 | add_library( |
3496 | |
3497 | === modified file 'tests/mir_test_framework/CMakeLists.txt' |
3498 | --- tests/mir_test_framework/CMakeLists.txt 2014-08-15 15:04:40 +0000 |
3499 | +++ tests/mir_test_framework/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3500 | @@ -3,6 +3,7 @@ |
3501 | ${GLESv2_INCLUDE_DIRS} |
3502 | ${CMAKE_SOURCE_DIR} |
3503 | ${UMOCKDEV_INCLUDE_DIRS} |
3504 | + ${ANDROID_HEADERS_INCLUDE_DIRS} |
3505 | ) |
3506 | |
3507 | set( |
3508 | @@ -23,6 +24,7 @@ |
3509 | using_stub_client_platform.cpp |
3510 | udev_environment.cpp |
3511 | declarative_placement_strategy.cpp |
3512 | + stub_client_platform_factory.cpp |
3513 | ) |
3514 | |
3515 | list(APPEND TEST_FRAMEWORK_SRCS |
3516 | @@ -52,6 +54,42 @@ |
3517 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
3518 | ) |
3519 | |
3520 | +set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols-client.map) |
3521 | + |
3522 | +add_library( |
3523 | + mirclientplatformstub MODULE |
3524 | + |
3525 | + stub_client_platform_module.cpp |
3526 | +) |
3527 | + |
3528 | +target_link_libraries( |
3529 | + mirclientplatformstub |
3530 | + |
3531 | + mir-test-framework |
3532 | +) |
3533 | + |
3534 | +set_target_properties( |
3535 | + mirclientplatformstub PROPERTIES; |
3536 | + OUTPUT_NAME client-platform-dummy |
3537 | + PREFIX "" |
3538 | + LINK_FLAGS "-Wl,--version-script,${symbol_map}" |
3539 | +) |
3540 | + |
3541 | +set(server_symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols-server.map) |
3542 | +add_library( |
3543 | + mirplatformgraphicsstub MODULE |
3544 | + |
3545 | + platform_graphics_dummy.cpp |
3546 | +) |
3547 | + |
3548 | +set_target_properties( |
3549 | + mirplatformgraphicsstub PROPERTIES; |
3550 | + OUTPUT_NAME platform-graphics-dummy |
3551 | + PREFIX "" |
3552 | + LINK_FLAGS "-Wl,--version-script,${server_symbol_map}" |
3553 | +) |
3554 | + |
3555 | + |
3556 | add_custom_command(TARGET mir-test-framework POST_BUILD |
3557 | COMMAND ${CMAKE_COMMAND} -E copy_directory |
3558 | ${CMAKE_CURRENT_SOURCE_DIR}/udev_recordings ${CMAKE_BINARY_DIR}/bin/udev_recordings |
3559 | |
3560 | === modified file 'tests/mir_test_framework/executable_path.cpp' |
3561 | --- tests/mir_test_framework/executable_path.cpp 2014-07-29 12:28:04 +0000 |
3562 | +++ tests/mir_test_framework/executable_path.cpp 2014-08-29 01:18:58 +0000 |
3563 | @@ -38,3 +38,8 @@ |
3564 | buf[tmp] = '\0'; |
3565 | return dirname(buf); |
3566 | } |
3567 | + |
3568 | +std::string mir_test_framework::library_path() |
3569 | +{ |
3570 | + return executable_path() + "/../lib"; |
3571 | +} |
3572 | |
3573 | === added file 'tests/mir_test_framework/platform_graphics_dummy.cpp' |
3574 | --- tests/mir_test_framework/platform_graphics_dummy.cpp 1970-01-01 00:00:00 +0000 |
3575 | +++ tests/mir_test_framework/platform_graphics_dummy.cpp 2014-08-29 01:18:58 +0000 |
3576 | @@ -0,0 +1,33 @@ |
3577 | +/* |
3578 | + * Copyright © 2014 Canonical Ltd. |
3579 | + * |
3580 | + * This program is free software: you can redistribute it and/or modify it |
3581 | + * under the terms of the GNU General Public License version 3, |
3582 | + * as published by the Free Software Foundation. |
3583 | + * |
3584 | + * This program is distributed in the hope that it will be useful, |
3585 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3586 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3587 | + * GNU General Public License for more details. |
3588 | + * |
3589 | + * You should have received a copy of the GNU General Public License |
3590 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3591 | + * |
3592 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>> |
3593 | + */ |
3594 | + |
3595 | +#include "mir/graphics/platform.h" |
3596 | + |
3597 | +extern "C" mir::graphics::PlatformPriority probe_platform() |
3598 | +{ |
3599 | + return mir::graphics::supported; |
3600 | +} |
3601 | + |
3602 | +mir::graphics::ModuleProperties const description { |
3603 | + "dummy" |
3604 | +}; |
3605 | + |
3606 | +extern "C" mir::graphics::ModuleProperties const* describe_module() |
3607 | +{ |
3608 | + return &description; |
3609 | +} |
3610 | |
3611 | === added file 'tests/mir_test_framework/stub_client_platform_factory.cpp' |
3612 | --- tests/mir_test_framework/stub_client_platform_factory.cpp 1970-01-01 00:00:00 +0000 |
3613 | +++ tests/mir_test_framework/stub_client_platform_factory.cpp 2014-08-29 01:18:58 +0000 |
3614 | @@ -0,0 +1,143 @@ |
3615 | +/* |
3616 | + * Copyright © 2014 Canonical Ltd. |
3617 | + * |
3618 | + * This program is free software: you can redistribute it and/or modify it |
3619 | + * under the terms of the GNU General Public License version 3, |
3620 | + * as published by the Free Software Foundation. |
3621 | + * |
3622 | + * This program is distributed in the hope that it will be useful, |
3623 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3624 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3625 | + * GNU General Public License for more details. |
3626 | + * |
3627 | + * You should have received a copy of the GNU General Public License |
3628 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3629 | + * |
3630 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
3631 | + */ |
3632 | + |
3633 | +#include "mir_test_framework/stub_client_platform_factory.h" |
3634 | +#include "src/client/client_buffer_factory.h" |
3635 | +#include "src/client/client_buffer.h" |
3636 | +#include "src/client/client_platform.h" |
3637 | + |
3638 | +#include <string.h> |
3639 | + |
3640 | +namespace mcl = mir::client; |
3641 | +namespace geom = mir::geometry; |
3642 | +namespace mtf = mir_test_framework; |
3643 | + |
3644 | +namespace |
3645 | +{ |
3646 | +class StubClientBuffer : public mcl::ClientBuffer |
3647 | +{ |
3648 | +public: |
3649 | + StubClientBuffer(std::shared_ptr<MirBufferPackage> const& package) |
3650 | + { |
3651 | + static_cast<void>(package); |
3652 | +#ifndef ANDROID |
3653 | + native = package; |
3654 | +#endif |
3655 | + } |
3656 | + |
3657 | + std::shared_ptr<mcl::MemoryRegion> secure_for_cpu_write() |
3658 | + { |
3659 | + return nullptr; |
3660 | + } |
3661 | + |
3662 | + geom::Size size() const |
3663 | + { |
3664 | + return geom::Size{}; |
3665 | + } |
3666 | + |
3667 | + geom::Stride stride() const |
3668 | + { |
3669 | + return geom::Stride{}; |
3670 | + } |
3671 | + |
3672 | + MirPixelFormat pixel_format() const |
3673 | + { |
3674 | + return mir_pixel_format_abgr_8888; |
3675 | + } |
3676 | + |
3677 | + uint32_t age() const |
3678 | + { |
3679 | + return 0; |
3680 | + } |
3681 | + void increment_age() |
3682 | + { |
3683 | + } |
3684 | + void mark_as_submitted() |
3685 | + { |
3686 | + } |
3687 | + std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const |
3688 | + { |
3689 | +#ifdef ANDROID |
3690 | + return nullptr; |
3691 | +#else |
3692 | + return native; |
3693 | +#endif |
3694 | + } |
3695 | + void update_from(MirBufferPackage const& package) override |
3696 | + { |
3697 | + static_cast<void>(package); |
3698 | +#ifndef ANDROID |
3699 | + ::memcpy(native.get(), &package, sizeof(package)); |
3700 | +#endif |
3701 | + } |
3702 | +private: |
3703 | +#ifndef ANDROID |
3704 | + std::shared_ptr<mir::graphics::NativeBuffer> native; |
3705 | +#endif |
3706 | +}; |
3707 | + |
3708 | +struct StubClientBufferFactory : public mcl::ClientBufferFactory |
3709 | +{ |
3710 | + std::shared_ptr<mcl::ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package, |
3711 | + geom::Size, MirPixelFormat) |
3712 | + { |
3713 | + return std::make_shared<StubClientBuffer>(package); |
3714 | + } |
3715 | +}; |
3716 | + |
3717 | +struct StubClientPlatform : public mcl::ClientPlatform |
3718 | +{ |
3719 | + MirPlatformType platform_type() const |
3720 | + { |
3721 | + return mir_platform_type_gbm; |
3722 | + } |
3723 | + |
3724 | + std::shared_ptr<mcl::ClientBufferFactory> create_buffer_factory() |
3725 | + { |
3726 | + return std::make_shared<StubClientBufferFactory>(); |
3727 | + } |
3728 | + |
3729 | + std::shared_ptr<EGLNativeWindowType> create_egl_native_window(mcl::ClientSurface*) |
3730 | + { |
3731 | + auto fake_window = reinterpret_cast<EGLNativeWindowType>(0x12345678lu); |
3732 | + return std::make_shared<EGLNativeWindowType>(fake_window); |
3733 | + } |
3734 | + |
3735 | + std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() |
3736 | + { |
3737 | + auto fake_display = reinterpret_cast<EGLNativeDisplayType>(0x12345678lu); |
3738 | + return std::make_shared<EGLNativeDisplayType>(fake_display); |
3739 | + } |
3740 | + |
3741 | + MirNativeBuffer* convert_native_buffer(mir::graphics::NativeBuffer* buf) const |
3742 | + { |
3743 | + static_cast<void>(buf); |
3744 | +#ifndef ANDROID |
3745 | + return buf; |
3746 | +#else |
3747 | + return nullptr; |
3748 | +#endif |
3749 | + } |
3750 | +}; |
3751 | +} |
3752 | + |
3753 | +std::shared_ptr<mcl::ClientPlatform> |
3754 | +mtf::StubClientPlatformFactory::create_client_platform(mcl::ClientContext*) |
3755 | +{ |
3756 | + return std::make_shared<StubClientPlatform>(); |
3757 | +} |
3758 | |
3759 | === added file 'tests/mir_test_framework/stub_client_platform_module.cpp' |
3760 | --- tests/mir_test_framework/stub_client_platform_module.cpp 1970-01-01 00:00:00 +0000 |
3761 | +++ tests/mir_test_framework/stub_client_platform_module.cpp 2014-08-29 01:18:58 +0000 |
3762 | @@ -0,0 +1,35 @@ |
3763 | +/* |
3764 | + * Copyright © 2014 Canonical Ltd. |
3765 | + * |
3766 | + * This program is free software: you can redistribute it and/or modify it |
3767 | + * under the terms of the GNU General Public License version 3, |
3768 | + * as published by the Free Software Foundation. |
3769 | + * |
3770 | + * This program is distributed in the hope that it will be useful, |
3771 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3772 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3773 | + * GNU General Public License for more details. |
3774 | + * |
3775 | + * You should have received a copy of the GNU General Public License |
3776 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3777 | + * |
3778 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>> |
3779 | + */ |
3780 | + |
3781 | +#include "src/client/client_platform_factory.h" |
3782 | + |
3783 | +#include "mir_test_framework/stub_client_platform_factory.h" |
3784 | +#include <memory> |
3785 | + |
3786 | +namespace mtf = mir_test_framework; |
3787 | +namespace mcl = mir::client; |
3788 | + |
3789 | +extern "C" std::shared_ptr<mcl::ClientPlatform> create_client_platform(mcl::ClientContext* context) |
3790 | +{ |
3791 | + return mtf::StubClientPlatformFactory{}.create_client_platform(context); |
3792 | +} |
3793 | + |
3794 | +extern "C" bool is_appropriate_module(mcl::ClientContext* /*context*/) |
3795 | +{ |
3796 | + return true; |
3797 | +} |
3798 | |
3799 | === added file 'tests/mir_test_framework/symbols-client.map' |
3800 | --- tests/mir_test_framework/symbols-client.map 1970-01-01 00:00:00 +0000 |
3801 | +++ tests/mir_test_framework/symbols-client.map 2014-08-29 01:18:58 +0000 |
3802 | @@ -0,0 +1,7 @@ |
3803 | +MIR_CLIENTPLATFORM_1 { |
3804 | + global: |
3805 | + create_client_platform; |
3806 | + is_appropriate_module; |
3807 | + local: |
3808 | + *; |
3809 | +}; |
3810 | |
3811 | === added file 'tests/mir_test_framework/symbols-server.map' |
3812 | --- tests/mir_test_framework/symbols-server.map 1970-01-01 00:00:00 +0000 |
3813 | +++ tests/mir_test_framework/symbols-server.map 2014-08-29 01:18:58 +0000 |
3814 | @@ -0,0 +1,10 @@ |
3815 | +MIR_GRAPHICS_PLATFORM_1 { |
3816 | + global: |
3817 | + add_platform_options; |
3818 | + create_platform; |
3819 | + create_native_platform; |
3820 | + probe_platform; |
3821 | + describe_module; |
3822 | + local: |
3823 | + *; |
3824 | +}; |
3825 | |
3826 | === modified file 'tests/mir_test_framework/testing_client_options.cpp' |
3827 | --- tests/mir_test_framework/testing_client_options.cpp 2014-07-14 06:49:52 +0000 |
3828 | +++ tests/mir_test_framework/testing_client_options.cpp 2014-08-29 01:18:58 +0000 |
3829 | @@ -16,112 +16,12 @@ |
3830 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> |
3831 | */ |
3832 | |
3833 | -#include "mir_test_framework/testing_client_configuration.h" |
3834 | #include "mir_test_framework/stub_client_connection_configuration.h" |
3835 | -#include "mir/options/program_option.h" |
3836 | #include "src/client/default_connection_configuration.h" |
3837 | -#include "src/client/client_platform_factory.h" |
3838 | -#include "src/client/client_buffer_factory.h" |
3839 | -#include "src/client/client_buffer.h" |
3840 | -#include "src/client/client_platform.h" |
3841 | -#include "src/client/mir_connection.h" |
3842 | +#include "mir_test_framework/stub_client_platform_factory.h" |
3843 | |
3844 | namespace mcl = mir::client; |
3845 | -namespace mtf=mir_test_framework; |
3846 | -namespace geom = mir::geometry; |
3847 | - |
3848 | - |
3849 | -namespace |
3850 | -{ |
3851 | -class StubClientBuffer : public mcl::ClientBuffer |
3852 | -{ |
3853 | - std::shared_ptr<mcl::MemoryRegion> secure_for_cpu_write() |
3854 | - { |
3855 | - return nullptr; |
3856 | - } |
3857 | - |
3858 | - geom::Size size() const |
3859 | - { |
3860 | - return geom::Size{}; |
3861 | - } |
3862 | - |
3863 | - geom::Stride stride() const |
3864 | - { |
3865 | - return geom::Stride{}; |
3866 | - } |
3867 | - |
3868 | - MirPixelFormat pixel_format() const |
3869 | - { |
3870 | - return mir_pixel_format_abgr_8888; |
3871 | - } |
3872 | - |
3873 | - uint32_t age() const |
3874 | - { |
3875 | - return 0; |
3876 | - } |
3877 | - void increment_age() |
3878 | - { |
3879 | - } |
3880 | - void mark_as_submitted() |
3881 | - { |
3882 | - } |
3883 | - std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const |
3884 | - { |
3885 | - return nullptr; |
3886 | - } |
3887 | - void update_from(MirBufferPackage const&) override |
3888 | - { |
3889 | - } |
3890 | -}; |
3891 | - |
3892 | -struct StubClientBufferFactory : public mcl::ClientBufferFactory |
3893 | -{ |
3894 | - std::shared_ptr<mcl::ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const&, |
3895 | - geom::Size, MirPixelFormat) |
3896 | - { |
3897 | - return std::make_shared<StubClientBuffer>(); |
3898 | - } |
3899 | -}; |
3900 | - |
3901 | -struct StubClientPlatform : public mcl::ClientPlatform |
3902 | -{ |
3903 | - MirPlatformType platform_type() const |
3904 | - { |
3905 | - return mir_platform_type_gbm; |
3906 | - } |
3907 | - |
3908 | - std::shared_ptr<mcl::ClientBufferFactory> create_buffer_factory() |
3909 | - { |
3910 | - return std::make_shared<StubClientBufferFactory>(); |
3911 | - } |
3912 | - |
3913 | - std::shared_ptr<EGLNativeWindowType> create_egl_native_window(mcl::ClientSurface*) |
3914 | - { |
3915 | - auto fake_window = reinterpret_cast<EGLNativeWindowType>(0x12345678lu); |
3916 | - return std::make_shared<EGLNativeWindowType>(fake_window); |
3917 | - } |
3918 | - |
3919 | - std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() |
3920 | - { |
3921 | - auto fake_display = reinterpret_cast<EGLNativeDisplayType>(0x12345678lu); |
3922 | - return std::make_shared<EGLNativeDisplayType>(fake_display); |
3923 | - } |
3924 | - |
3925 | - MirNativeBuffer* convert_native_buffer(mir::graphics::NativeBuffer*) const |
3926 | - { |
3927 | - return nullptr; |
3928 | - } |
3929 | -}; |
3930 | - |
3931 | -struct StubClientPlatformFactory : public mcl::ClientPlatformFactory |
3932 | -{ |
3933 | - std::shared_ptr<mcl::ClientPlatform> create_client_platform(mcl::ClientContext*) |
3934 | - { |
3935 | - return std::make_shared<StubClientPlatform>(); |
3936 | - } |
3937 | -}; |
3938 | - |
3939 | -} |
3940 | +namespace mtf = mir_test_framework; |
3941 | |
3942 | mtf::StubConnectionConfiguration::StubConnectionConfiguration(std::string const& socket_file) |
3943 | : DefaultConnectionConfiguration(socket_file) |
3944 | |
3945 | === modified file 'tests/unit-tests/CMakeLists.txt' |
3946 | --- tests/unit-tests/CMakeLists.txt 2014-08-26 09:27:49 +0000 |
3947 | +++ tests/unit-tests/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
3948 | @@ -2,7 +2,23 @@ |
3949 | |
3950 | add_definitions(-DTEST_RECORDINGS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/input_recordings/") |
3951 | |
3952 | -include_directories(${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS} ${UMOCKDEV_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
3953 | +if (MIR_BUILD_PLATFORM_ANDROID) |
3954 | + add_definitions(-DMIR_BUILD_PLATFORM_ANDROID) |
3955 | +endif() |
3956 | + |
3957 | +if (MIR_BUILD_PLATFORM_MESA) |
3958 | + add_definitions(-DMIR_BUILD_PLATFORM_MESA) |
3959 | +endif() |
3960 | + |
3961 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") |
3962 | + |
3963 | +include_directories( |
3964 | + ${ANDROID_HEADERS_INCLUDE_DIRS} |
3965 | + ${DRM_INCLUDE_DIRS} |
3966 | + ${GBM_INCLUDE_DIRS} |
3967 | + ${UMOCKDEV_INCLUDE_DIRS} |
3968 | + ${CMAKE_SOURCE_DIR} |
3969 | +) |
3970 | # TODO: Aim to remove |
3971 | include_directories(${MIR_XCURSOR_INCLUDE_DIRECTORIES}) |
3972 | |
3973 | @@ -19,8 +35,10 @@ |
3974 | test_thread_name.cpp |
3975 | test_default_emergency_cleanup.cpp |
3976 | test_basic_observers.cpp |
3977 | + test_shared_library_prober.cpp |
3978 | test_fatal.cpp |
3979 | test_fd.cpp |
3980 | + test_shared_library_prober.cpp |
3981 | ) |
3982 | |
3983 | add_subdirectory(options/) |
3984 | @@ -71,6 +89,15 @@ |
3985 | ${GMOCK_MAIN_LIBRARY} |
3986 | ${Boost_LIBRARIES} |
3987 | ${UMOCKDEV_LIBRARIES} |
3988 | + # Mesa platform dependencies |
3989 | + ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
3990 | + ${GBM_LDFLAGS} ${GBM_LIBRARIES} |
3991 | + # Android platform dependencies |
3992 | + ${LIBHARDWARE_LIBRARIES} |
3993 | + ${ANDROID_PROPERTIES_LIBRARIES} |
3994 | + # Shared platform dependencies |
3995 | + ${EGL_LDFLAGS} ${EGL_LIBRARIES} |
3996 | + ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES} |
3997 | ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
3998 | ${LIBHARDWARE_LDFLAGS} ${LIBHARDWARE_LIBRARIES} |
3999 | ${DRM_LDFLAGS} ${DRM_LIBRARIES} |
4000 | @@ -79,7 +106,7 @@ |
4001 | ${MIR_SERVER_REFERENCES} |
4002 | ) |
4003 | |
4004 | -if (MIR_TEST_PLATFORM STREQUAL "android") |
4005 | +if (MIR_BUILD_PLATFORM_ANDROID) |
4006 | target_link_libraries(mir_unit_tests |
4007 | mirsharedandroid |
4008 | ${ANDROID_PROPERTIES_LDFLAGS} |
4009 | @@ -96,11 +123,23 @@ |
4010 | "MIR_BUILD_UNIT_TESTS" |
4011 | OFF) |
4012 | |
4013 | +set (MIR_CLIENT_PLATFORM client-platform-dummy.so) |
4014 | + |
4015 | if (MIR_RUN_UNIT_TESTS) |
4016 | - mir_discover_tests(mir_unit_tests LD_PRELOAD=libumockdev-preload.so.0 G_SLICE=always-malloc G_DEBUG=gc-friendly) |
4017 | + mir_discover_tests(mir_unit_tests |
4018 | + LD_PRELOAD=libumockdev-preload.so.0 |
4019 | + G_SLICE=always-malloc |
4020 | + G_DEBUG=gc-friendly |
4021 | + MIR_CLIENT_PLATFORM_LIB=${LIBRARY_OUTPUT_PATH}/${MIR_CLIENT_PLATFORM}) |
4022 | endif (MIR_RUN_UNIT_TESTS) |
4023 | |
4024 | install( |
4025 | TARGETS mir_unit_tests |
4026 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
4027 | ) |
4028 | + |
4029 | +add_custom_command(TARGET mir_unit_tests POST_BUILD |
4030 | + COMMAND ${CMAKE_COMMAND} -E copy_directory |
4031 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_data ${CMAKE_BINARY_DIR}/bin/test_data |
4032 | + COMMENT "Copying test data to build dir..." |
4033 | +) |
4034 | |
4035 | === modified file 'tests/unit-tests/client/CMakeLists.txt' |
4036 | --- tests/unit-tests/client/CMakeLists.txt 2014-07-30 15:25:54 +0000 |
4037 | +++ tests/unit-tests/client/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
4038 | @@ -12,6 +12,7 @@ |
4039 | ${CMAKE_CURRENT_SOURCE_DIR}/test_protobuf_rpc_channel.cpp |
4040 | ${CMAKE_CURRENT_SOURCE_DIR}/test_mir_prompt_session.cpp |
4041 | ${CMAKE_CURRENT_SOURCE_DIR}/test_event_distributor.cpp |
4042 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_probing_client_platform_factory.cpp |
4043 | ) |
4044 | |
4045 | if(MIR_TEST_PLATFORM STREQUAL "android") |
4046 | |
4047 | === modified file 'tests/unit-tests/client/android/test_android_client_platform.cpp' |
4048 | --- tests/unit-tests/client/android/test_android_client_platform.cpp 2014-03-06 06:05:17 +0000 |
4049 | +++ tests/unit-tests/client/android/test_android_client_platform.cpp 2014-08-29 01:18:58 +0000 |
4050 | @@ -17,9 +17,9 @@ |
4051 | */ |
4052 | |
4053 | #include "src/client/client_platform.h" |
4054 | -#include "src/client/android/client_platform_factory.h" |
4055 | #include "mir_test_doubles/mock_client_context.h" |
4056 | #include "mir_test_doubles/mock_client_surface.h" |
4057 | +#include "mir_test_framework/client_platform_factory.h" |
4058 | |
4059 | #include <EGL/egl.h> |
4060 | |
4061 | @@ -28,13 +28,12 @@ |
4062 | namespace mcl = mir::client; |
4063 | namespace mt = mir::test; |
4064 | namespace mtd = mt::doubles; |
4065 | +namespace mtf = mir_test_framework; |
4066 | |
4067 | TEST(AndroidClientPlatformTest, egl_native_display_is_egl_default_display) |
4068 | { |
4069 | - mtd::MockClientContext context; |
4070 | - mcl::android::ClientPlatformFactory factory; |
4071 | mtd::MockClientSurface surface; |
4072 | - auto platform = factory.create_client_platform(&context); |
4073 | + auto platform = mtf::create_android_client_platform(); |
4074 | auto mock_client_surface = std::make_shared<mtd::MockClientSurface>(); |
4075 | auto native_display = platform->create_egl_native_display(); |
4076 | EXPECT_EQ(EGL_DEFAULT_DISPLAY, *native_display); |
4077 | @@ -42,10 +41,8 @@ |
4078 | |
4079 | TEST(AndroidClientPlatformTest, egl_native_window_is_set) |
4080 | { |
4081 | - mtd::MockClientContext context; |
4082 | - mcl::android::ClientPlatformFactory factory; |
4083 | mtd::MockClientSurface surface; |
4084 | - auto platform = factory.create_client_platform(&context); |
4085 | + auto platform = mtf::create_android_client_platform(); |
4086 | auto mock_client_surface = std::make_shared<mtd::MockClientSurface>(); |
4087 | auto egl_native_window = platform->create_egl_native_window(&surface); |
4088 | EXPECT_NE(nullptr, egl_native_window); |
4089 | |
4090 | === modified file 'tests/unit-tests/client/mesa/test_client_platform.cpp' |
4091 | --- tests/unit-tests/client/mesa/test_client_platform.cpp 2014-03-06 06:05:17 +0000 |
4092 | +++ tests/unit-tests/client/mesa/test_client_platform.cpp 2014-08-29 01:18:58 +0000 |
4093 | @@ -17,9 +17,9 @@ |
4094 | */ |
4095 | |
4096 | #include "src/client/client_platform.h" |
4097 | -#include "src/client/mesa/client_platform_factory.h" |
4098 | +#include "mir/shared_library.h" |
4099 | #include "src/client/mesa/mesa_native_display_container.h" |
4100 | -#include "mir_test_doubles/mock_client_context.h" |
4101 | +#include "mir_test_framework/client_platform_factory.h" |
4102 | #include "mir_test_doubles/mock_client_surface.h" |
4103 | |
4104 | #include "mir_toolkit/mesa/native_display.h" |
4105 | @@ -30,19 +30,20 @@ |
4106 | namespace mclm = mir::client::mesa; |
4107 | namespace mt = mir::test; |
4108 | namespace mtd = mir::test::doubles; |
4109 | +namespace mtf = mir_test_framework; |
4110 | |
4111 | TEST(MesaClientPlatformTest, egl_native_display_is_valid_until_released) |
4112 | { |
4113 | - mtd::MockClientContext context; |
4114 | - mclm::ClientPlatformFactory factory; |
4115 | - auto platform = factory.create_client_platform(&context); |
4116 | + auto platform = mtf::create_mesa_client_platform(); |
4117 | + auto platform_lib = mtf::get_platform_library(); |
4118 | |
4119 | MirMesaEGLNativeDisplay* nd; |
4120 | { |
4121 | std::shared_ptr<EGLNativeDisplayType> native_display = platform->create_egl_native_display(); |
4122 | |
4123 | nd = reinterpret_cast<MirMesaEGLNativeDisplay*>(*native_display); |
4124 | - EXPECT_EQ(MIR_MESA_TRUE, mclm::mir_client_mesa_egl_native_display_is_valid(nd)); |
4125 | + auto validate = platform_lib->load_function<MirBool(*)(MirMesaEGLNativeDisplay*)>("mir_client_mesa_egl_native_display_is_valid"); |
4126 | + EXPECT_EQ(MIR_MESA_TRUE, validate(nd)); |
4127 | } |
4128 | EXPECT_EQ(MIR_MESA_FALSE, mclm::mir_client_mesa_egl_native_display_is_valid(nd)); |
4129 | } |
4130 | |
4131 | === modified file 'tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp' |
4132 | --- tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp 2014-03-06 06:05:17 +0000 |
4133 | +++ tests/unit-tests/client/mesa/test_mesa_native_display_container.cpp 2014-08-29 01:18:58 +0000 |
4134 | @@ -40,7 +40,7 @@ |
4135 | } |
4136 | |
4137 | std::shared_ptr<mclg::MesaNativeDisplayContainer> const container; |
4138 | - MirConnection* connection; |
4139 | + mir::client::ClientContext* connection; |
4140 | }; |
4141 | |
4142 | } |
4143 | |
4144 | === modified file 'tests/unit-tests/client/test_client_platform.cpp' |
4145 | --- tests/unit-tests/client/test_client_platform.cpp 2014-03-06 06:05:17 +0000 |
4146 | +++ tests/unit-tests/client/test_client_platform.cpp 2014-08-29 01:18:58 +0000 |
4147 | @@ -20,60 +20,140 @@ |
4148 | #include "src/client/mir_client_surface.h" |
4149 | #include "mir_test_doubles/mock_client_context.h" |
4150 | #include "mir_test_doubles/mock_client_surface.h" |
4151 | +#include "mir_test_framework/executable_path.h" |
4152 | |
4153 | -#ifdef ANDROID |
4154 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4155 | #include "mir_test_doubles/mock_android_hw.h" |
4156 | -#include "src/client/android/client_platform_factory.h" |
4157 | -#else |
4158 | -#include "src/client/mesa/client_platform_factory.h" |
4159 | #endif |
4160 | |
4161 | +#include "src/client/client_platform_factory.h" |
4162 | + |
4163 | +#include "mir/shared_library.h" |
4164 | + |
4165 | #include <gmock/gmock.h> |
4166 | #include <gtest/gtest.h> |
4167 | |
4168 | namespace mcl=mir::client; |
4169 | namespace mtd = mir::test::doubles; |
4170 | - |
4171 | -struct ClientPlatformTest : public ::testing::Test |
4172 | -{ |
4173 | +namespace mtf = mir_test_framework; |
4174 | + |
4175 | +namespace |
4176 | +{ |
4177 | +struct ClientPlatformTraits |
4178 | +{ |
4179 | + ClientPlatformTraits(std::string const& library, |
4180 | + std::function<void(MirPlatformPackage&)> populator, |
4181 | + MirPlatformType type) |
4182 | + : platform_library_name{library}, |
4183 | + populate_package_for{populator}, |
4184 | + platform_type{type} |
4185 | + { |
4186 | + } |
4187 | + |
4188 | + std::string const platform_library_name; |
4189 | + std::function<void(MirPlatformPackage&)> const populate_package_for; |
4190 | + MirPlatformType const platform_type; |
4191 | +}; |
4192 | + |
4193 | +struct ClientPlatformTest : public ::testing::TestWithParam<ClientPlatformTraits const*> |
4194 | +{ |
4195 | + ClientPlatformTest() |
4196 | + : platform_library{mtf::library_path() + "/" + GetParam()->platform_library_name}, |
4197 | + create_client_platform{platform_library.load_function<mcl::CreateClientPlatform>("create_client_platform")}, |
4198 | + probe{platform_library.load_function<mcl::ClientPlatformProbe>("is_appropriate_module")} |
4199 | + { |
4200 | + using namespace testing; |
4201 | + ON_CALL(context, populate(_)) |
4202 | + .WillByDefault(Invoke(GetParam()->populate_package_for)); |
4203 | + } |
4204 | + |
4205 | mtd::MockClientContext context; |
4206 | -#ifdef ANDROID |
4207 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4208 | testing::NiceMock<mtd::HardwareAccessMock> hw_access_mock; |
4209 | - mcl::android::ClientPlatformFactory factory; |
4210 | -#else |
4211 | - mcl::mesa::ClientPlatformFactory factory; |
4212 | #endif |
4213 | + mir::SharedLibrary platform_library; |
4214 | + mcl::CreateClientPlatform const create_client_platform; |
4215 | + mcl::ClientPlatformProbe const probe; |
4216 | }; |
4217 | |
4218 | -TEST_F(ClientPlatformTest, platform_name) |
4219 | -{ |
4220 | - auto platform = factory.create_client_platform(&context); |
4221 | -#ifdef ANDROID |
4222 | - auto type = mir_platform_type_android; |
4223 | -#else |
4224 | - auto type = mir_platform_type_gbm; |
4225 | -#endif |
4226 | - EXPECT_EQ(type, platform->platform_type()); |
4227 | -} |
4228 | - |
4229 | -TEST_F(ClientPlatformTest, platform_creates) |
4230 | -{ |
4231 | - auto platform = factory.create_client_platform(&context); |
4232 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4233 | +ClientPlatformTraits const android_platform{"client-platform-android.so", |
4234 | + [](MirPlatformPackage& pkg) |
4235 | + { |
4236 | + ::memset(&pkg, 0, sizeof(pkg)); |
4237 | + }, |
4238 | + mir_platform_type_android |
4239 | + }; |
4240 | + |
4241 | +INSTANTIATE_TEST_CASE_P(Android, |
4242 | + ClientPlatformTest, |
4243 | + ::testing::Values(&android_platform)); |
4244 | + |
4245 | +#endif |
4246 | + |
4247 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4248 | +ClientPlatformTraits const mesa_platform{"client-platform-mesa.so", |
4249 | + [](MirPlatformPackage& pkg) |
4250 | + { |
4251 | + ::memset(&pkg, 0, sizeof(pkg)); |
4252 | + pkg.fd_items = 1; |
4253 | + }, |
4254 | + mir_platform_type_gbm |
4255 | + }; |
4256 | + |
4257 | +INSTANTIATE_TEST_CASE_P(Mesa, |
4258 | + ClientPlatformTest, |
4259 | + ::testing::Values(&mesa_platform)); |
4260 | + |
4261 | +#endif |
4262 | +} |
4263 | + |
4264 | +TEST_P(ClientPlatformTest, platform_name) |
4265 | +{ |
4266 | + auto platform = create_client_platform(&context); |
4267 | + |
4268 | + EXPECT_EQ(GetParam()->platform_type, platform->platform_type()); |
4269 | +} |
4270 | + |
4271 | +TEST_P(ClientPlatformTest, platform_creates) |
4272 | +{ |
4273 | + auto platform = create_client_platform(&context); |
4274 | auto buffer_factory = platform->create_buffer_factory(); |
4275 | EXPECT_NE(buffer_factory.get(), (mcl::ClientBufferFactory*) NULL); |
4276 | } |
4277 | |
4278 | -TEST_F(ClientPlatformTest, platform_creates_native_window) |
4279 | +TEST_P(ClientPlatformTest, platform_creates_native_window) |
4280 | { |
4281 | - auto platform = factory.create_client_platform(&context); |
4282 | + auto platform = create_client_platform(&context); |
4283 | auto mock_client_surface = std::make_shared<mtd::MockClientSurface>(); |
4284 | auto native_window = platform->create_egl_native_window(mock_client_surface.get()); |
4285 | EXPECT_NE(*native_window, (EGLNativeWindowType) NULL); |
4286 | } |
4287 | |
4288 | -TEST_F(ClientPlatformTest, platform_creates_egl_native_display) |
4289 | +TEST_P(ClientPlatformTest, platform_creates_egl_native_display) |
4290 | { |
4291 | - auto platform = factory.create_client_platform(&context); |
4292 | + auto platform = create_client_platform(&context); |
4293 | auto native_display = platform->create_egl_native_display(); |
4294 | EXPECT_NE(nullptr, native_display.get()); |
4295 | } |
4296 | + |
4297 | +TEST_P(ClientPlatformTest, platform_probe_returns_success_when_matching) |
4298 | +{ |
4299 | + EXPECT_TRUE(probe(&context)); |
4300 | +} |
4301 | + |
4302 | +TEST_P(ClientPlatformTest, platform_probe_returns_false_when_not_matching) |
4303 | +{ |
4304 | + using namespace testing; |
4305 | + ON_CALL(context, populate(_)) |
4306 | + .WillByDefault(Invoke([](MirPlatformPackage& pkg) |
4307 | + { |
4308 | + //Mock up something that hopefully looks nothing like |
4309 | + //what the platform is expecting... |
4310 | + ::memset(&pkg, 0, sizeof(pkg)); |
4311 | + pkg.data_items = 0xdeadbeef; |
4312 | + pkg.fd_items = -23; |
4313 | + })); |
4314 | + |
4315 | + EXPECT_FALSE(probe(&context)); |
4316 | +} |
4317 | |
4318 | === added file 'tests/unit-tests/client/test_probing_client_platform_factory.cpp' |
4319 | --- tests/unit-tests/client/test_probing_client_platform_factory.cpp 1970-01-01 00:00:00 +0000 |
4320 | +++ tests/unit-tests/client/test_probing_client_platform_factory.cpp 2014-08-29 01:18:58 +0000 |
4321 | @@ -0,0 +1,116 @@ |
4322 | +/* |
4323 | + * Copyright © 2014 Canonical Ltd. |
4324 | + * |
4325 | + * This program is free software: you can redistribute it and/or modify |
4326 | + * it under the terms of the GNU General Public License version 3 as |
4327 | + * published by the Free Software Foundation. |
4328 | + * |
4329 | + * This program is distributed in the hope that it will be useful, |
4330 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4331 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4332 | + * GNU General Public License for more details. |
4333 | + * |
4334 | + * You should have received a copy of the GNU General Public License |
4335 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4336 | + * |
4337 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
4338 | + */ |
4339 | + |
4340 | +#include "src/client/client_platform.h" |
4341 | +#include "src/client/probing_client_platform_factory.h" |
4342 | + |
4343 | +#include "mir_test_doubles/mock_client_context.h" |
4344 | +#include "mir_test_framework/executable_path.h" |
4345 | + |
4346 | +#include <gmock/gmock.h> |
4347 | +#include <gtest/gtest.h> |
4348 | + |
4349 | +namespace mtf = mir_test_framework; |
4350 | +namespace mtd = mir::test::doubles; |
4351 | + |
4352 | +namespace |
4353 | +{ |
4354 | +std::vector<std::shared_ptr<mir::SharedLibrary>> |
4355 | +all_available_modules() |
4356 | +{ |
4357 | + std::vector<std::shared_ptr<mir::SharedLibrary>> modules; |
4358 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4359 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/client-platform-mesa.so")); |
4360 | +#endif |
4361 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4362 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/client-platform-android.so")); |
4363 | +#endif |
4364 | + return modules; |
4365 | +} |
4366 | +} |
4367 | + |
4368 | +TEST(ProbingClientPlatformFactory, ThrowsErrorWhenConstructedWithNoPlatforms) |
4369 | +{ |
4370 | + std::vector<std::shared_ptr<mir::SharedLibrary>> empty_modules; |
4371 | + EXPECT_THROW(mir::client::ProbingClientPlatformFactory{empty_modules}, |
4372 | + std::runtime_error); |
4373 | +} |
4374 | + |
4375 | +TEST(ProbingClientPlatformFactory, ThrowsErrorWhenNoPlatformPluginProbesSuccessfully) |
4376 | +{ |
4377 | + using namespace testing; |
4378 | + |
4379 | + mir::client::ProbingClientPlatformFactory factory{all_available_modules()}; |
4380 | + |
4381 | + mtd::MockClientContext context; |
4382 | + ON_CALL(context, populate(_)) |
4383 | + .WillByDefault(Invoke([](MirPlatformPackage& pkg) |
4384 | + { |
4385 | + ::memset(&pkg, 0, sizeof(MirPlatformPackage)); |
4386 | + // Mock up a platform package that looks nothing like |
4387 | + // either an Android or Mesa package |
4388 | + pkg.fd_items = 0xdeadbeef; |
4389 | + pkg.data_items = -23; |
4390 | + })); |
4391 | + |
4392 | + EXPECT_THROW(factory.create_client_platform(&context), |
4393 | + std::runtime_error); |
4394 | +} |
4395 | + |
4396 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4397 | +TEST(ProbingClientPlatformFactory, CreatesMesaPlatformWhenAppropriate) |
4398 | +{ |
4399 | + using namespace testing; |
4400 | + |
4401 | + mir::client::ProbingClientPlatformFactory factory{all_available_modules()}; |
4402 | + |
4403 | + mtd::MockClientContext context; |
4404 | + ON_CALL(context, populate(_)) |
4405 | + .WillByDefault(Invoke([](MirPlatformPackage& pkg) |
4406 | + { |
4407 | + ::memset(&pkg, 0, sizeof(MirPlatformPackage)); |
4408 | + // Mock up something that looks like a GBM platform package, |
4409 | + // until we send the actual platform type over the wire! |
4410 | + pkg.fd_items = 1; |
4411 | + pkg.fd[0] = 23; |
4412 | + })); |
4413 | + auto platform = factory.create_client_platform(&context); |
4414 | + EXPECT_EQ(mir_platform_type_gbm, platform->platform_type()); |
4415 | +} |
4416 | +#endif |
4417 | + |
4418 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4419 | +TEST(ProbingClientPlatformFactory, CreatesAndroidPlatformWhenAppropriate) |
4420 | +{ |
4421 | + using namespace testing; |
4422 | + |
4423 | + mir::client::ProbingClientPlatformFactory factory{all_available_modules()}; |
4424 | + |
4425 | + mtd::MockClientContext context; |
4426 | + ON_CALL(context, populate(_)) |
4427 | + .WillByDefault(Invoke([](MirPlatformPackage& pkg) |
4428 | + { |
4429 | + // Mock up something that looks like a Android platform package, |
4430 | + // until we send the actual platform type over the wire! |
4431 | + ::memset(&pkg, 0, sizeof(MirPlatformPackage)); |
4432 | + })); |
4433 | + |
4434 | + auto platform = factory.create_client_platform(&context); |
4435 | + EXPECT_EQ(mir_platform_type_android, platform->platform_type()); |
4436 | +} |
4437 | +#endif |
4438 | |
4439 | === modified file 'tests/unit-tests/graphics/CMakeLists.txt' |
4440 | --- tests/unit-tests/graphics/CMakeLists.txt 2014-07-02 06:29:24 +0000 |
4441 | +++ tests/unit-tests/graphics/CMakeLists.txt 2014-08-29 01:18:58 +0000 |
4442 | @@ -10,6 +10,7 @@ |
4443 | ${CMAKE_CURRENT_SOURCE_DIR}/test_surfaceless_egl_context.cpp |
4444 | ${CMAKE_CURRENT_SOURCE_DIR}/test_overlapping_output_grouping.cpp |
4445 | ${CMAKE_CURRENT_SOURCE_DIR}/test_program_factory.cpp |
4446 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_platform_prober.cpp |
4447 | ) |
4448 | |
4449 | add_subdirectory(nested/) |
4450 | |
4451 | === modified file 'tests/unit-tests/graphics/android/test_android_platform.cpp' |
4452 | --- tests/unit-tests/graphics/android/test_android_platform.cpp 2014-08-07 13:22:53 +0000 |
4453 | +++ tests/unit-tests/graphics/android/test_android_platform.cpp 2014-08-29 01:18:58 +0000 |
4454 | @@ -29,6 +29,8 @@ |
4455 | #include "mir_test_doubles/fd_matcher.h" |
4456 | #include "mir_test/fake_shared.h" |
4457 | #include "mir_test_doubles/mock_android_native_buffer.h" |
4458 | +#include "mir_test_framework/executable_path.h" |
4459 | +#include "mir/shared_library.h" |
4460 | #include <system/window.h> |
4461 | #include <gtest/gtest.h> |
4462 | |
4463 | @@ -39,6 +41,7 @@ |
4464 | namespace mr=mir::report; |
4465 | namespace geom=mir::geometry; |
4466 | namespace mo=mir::options; |
4467 | +namespace mtf=mir_test_framework; |
4468 | |
4469 | class PlatformBufferIPCPackaging : public ::testing::Test |
4470 | { |
4471 | @@ -154,6 +157,27 @@ |
4472 | EXPECT_EQ(EGL_DEFAULT_DISPLAY, platform.egl_native_display()); |
4473 | } |
4474 | |
4475 | +TEST(AndroidGraphicsPlatform, probe_returns_unsupported_when_no_hwaccess) |
4476 | +{ |
4477 | + using namespace testing; |
4478 | + NiceMock<mtd::HardwareAccessMock> hwaccess; |
4479 | + |
4480 | + ON_CALL(hwaccess, hw_get_module(_,_)).WillByDefault(Return(-1)); |
4481 | + |
4482 | + mir::SharedLibrary platform_lib{mtf::library_path() + "/platform-graphics-android.so"}; |
4483 | + auto probe = platform_lib.load_function<mg::PlatformProbe>("probe_platform"); |
4484 | + EXPECT_EQ(mg::PlatformPriority::unsupported, probe()); |
4485 | +} |
4486 | + |
4487 | +TEST(AndroidGraphicsPlatform, probe_returns_best_when_hwaccess_succeeds) |
4488 | +{ |
4489 | + testing::NiceMock<mtd::HardwareAccessMock> hwaccess; |
4490 | + |
4491 | + mir::SharedLibrary platform_lib{mtf::library_path() + "/platform-graphics-android.so"}; |
4492 | + auto probe = platform_lib.load_function<mg::PlatformProbe>("probe_platform"); |
4493 | + EXPECT_EQ(mg::PlatformPriority::best, probe()); |
4494 | +} |
4495 | + |
4496 | TEST(NestedPlatformCreation, doesnt_access_display_hardware) |
4497 | { |
4498 | using namespace testing; |
4499 | |
4500 | === modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp' |
4501 | --- tests/unit-tests/graphics/android/test_output_builder.cpp 2014-07-02 06:29:24 +0000 |
4502 | +++ tests/unit-tests/graphics/android/test_output_builder.cpp 2014-08-29 01:18:58 +0000 |
4503 | @@ -108,9 +108,10 @@ |
4504 | mtd::StubGLConfig stub_gl_config; |
4505 | mga::PbufferGLContext gl_context{ |
4506 | mga::to_mir_format(mock_egl.fake_visual_id), stub_gl_config, mock_display_report}; |
4507 | - mtd::StubGLProgramFactory const stub_program_factory; |
4508 | + mtd::StubGLProgramFactory stub_program_factory; |
4509 | }; |
4510 | } |
4511 | + |
4512 | TEST_F(OutputBuilder, hwc_version_10_success) |
4513 | { |
4514 | using namespace testing; |
4515 | |
4516 | === modified file 'tests/unit-tests/graphics/mesa/test_platform.cpp' |
4517 | --- tests/unit-tests/graphics/mesa/test_platform.cpp 2014-08-07 13:22:53 +0000 |
4518 | +++ tests/unit-tests/graphics/mesa/test_platform.cpp 2014-08-29 01:18:58 +0000 |
4519 | @@ -23,6 +23,7 @@ |
4520 | #include "src/platform/graphics/mesa/internal_client.h" |
4521 | #include "src/server/report/null_report_factory.h" |
4522 | #include "mir/emergency_cleanup_registry.h" |
4523 | +#include "mir/shared_library.h" |
4524 | |
4525 | #include "mir_test_doubles/mock_buffer.h" |
4526 | #include "mir_test_doubles/mock_buffer_packer.h" |
4527 | @@ -33,6 +34,7 @@ |
4528 | #include <gtest/gtest.h> |
4529 | |
4530 | #include "mir_test_framework/udev_environment.h" |
4531 | +#include "mir_test_framework/executable_path.h" |
4532 | #include "mir_test/pipe.h" |
4533 | |
4534 | #include "mir_test_doubles/mock_drm.h" |
4535 | @@ -384,3 +386,23 @@ |
4536 | |
4537 | Mock::VerifyAndClearExpectations(&mock_drm); |
4538 | } |
4539 | + |
4540 | +TEST_F(MesaGraphicsPlatform, probe_returns_unsupported_when_no_drm_udev_devices) |
4541 | +{ |
4542 | + mtf::UdevEnvironment udev_environment; |
4543 | + |
4544 | + mir::SharedLibrary platform_lib{mtf::library_path() + "/platform-graphics-mesa.so"}; |
4545 | + auto probe = platform_lib.load_function<mg::PlatformProbe>("probe_platform"); |
4546 | + EXPECT_EQ(mg::PlatformPriority::unsupported, probe()); |
4547 | +} |
4548 | + |
4549 | +TEST_F(MesaGraphicsPlatform, probe_returns_best_when_drm_devices_exist) |
4550 | +{ |
4551 | + mtf::UdevEnvironment udev_environment; |
4552 | + |
4553 | + udev_environment.add_standard_device("standard-drm-devices"); |
4554 | + |
4555 | + mir::SharedLibrary platform_lib{mtf::library_path() + "/platform-graphics-mesa.so"}; |
4556 | + auto probe = platform_lib.load_function<mg::PlatformProbe>("probe_platform"); |
4557 | + EXPECT_EQ(mg::PlatformPriority::best, probe()); |
4558 | +} |
4559 | |
4560 | === added file 'tests/unit-tests/graphics/test_platform_prober.cpp' |
4561 | --- tests/unit-tests/graphics/test_platform_prober.cpp 1970-01-01 00:00:00 +0000 |
4562 | +++ tests/unit-tests/graphics/test_platform_prober.cpp 2014-08-29 01:18:58 +0000 |
4563 | @@ -0,0 +1,194 @@ |
4564 | +/* |
4565 | + * Copyright © 2014 Canonical Ltd. |
4566 | + * |
4567 | + * This program is free software: you can redistribute it and/or modify |
4568 | + * it under the terms of the GNU General Public License version 3 as |
4569 | + * published by the Free Software Foundation. |
4570 | + * |
4571 | + * This program is distributed in the hope that it will be useful, |
4572 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4573 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4574 | + * GNU General Public License for more details. |
4575 | + * |
4576 | + * You should have received a copy of the GNU General Public License |
4577 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4578 | + * |
4579 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
4580 | + */ |
4581 | + |
4582 | +#include <gtest/gtest.h> |
4583 | + |
4584 | +#include "src/platform/graphics/platform_probe.h" |
4585 | +#include "mir/graphics/platform.h" |
4586 | + |
4587 | +#include "mir/raii.h" |
4588 | + |
4589 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4590 | +#include "mir_test_doubles/mock_drm.h" |
4591 | +#include "mir_test_doubles/mock_gbm.h" |
4592 | +#endif |
4593 | + |
4594 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4595 | +#include "mir_test_doubles/mock_android_hw.h" |
4596 | +#endif |
4597 | + |
4598 | +#include "mir_test_framework/udev_environment.h" |
4599 | +#include "mir_test_framework/executable_path.h" |
4600 | + |
4601 | +namespace mtf = mir_test_framework; |
4602 | +namespace mtd = mir::test::doubles; |
4603 | + |
4604 | +namespace |
4605 | +{ |
4606 | +std::vector<std::shared_ptr<mir::SharedLibrary>> available_platforms() |
4607 | +{ |
4608 | + std::vector<std::shared_ptr<mir::SharedLibrary>> modules; |
4609 | + |
4610 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4611 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/platform-graphics-mesa.so")); |
4612 | +#endif |
4613 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4614 | + modules.push_back(std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/platform-graphics-android.so")); |
4615 | +#endif |
4616 | + return modules; |
4617 | +} |
4618 | + |
4619 | +void add_dummy_platform(std::vector<std::shared_ptr<mir::SharedLibrary>>& modules) |
4620 | +{ |
4621 | + modules.insert(modules.begin(), std::make_shared<mir::SharedLibrary>(mtf::library_path() + "/platform-graphics-dummy.so")); |
4622 | +} |
4623 | + |
4624 | +std::shared_ptr<void> ensure_android_probing_fails() |
4625 | +{ |
4626 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4627 | + using namespace testing; |
4628 | + auto mock_android = std::make_shared<NiceMock<mtd::HardwareAccessMock>>(); |
4629 | + ON_CALL(*mock_android, hw_get_module(_, _)) |
4630 | + .WillByDefault(Return(-1)); |
4631 | + return mock_android; |
4632 | +#else |
4633 | + return std::shared_ptr<void>{}; |
4634 | +#endif |
4635 | +} |
4636 | + |
4637 | +std::shared_ptr<void> ensure_mesa_probing_fails() |
4638 | +{ |
4639 | + return std::make_shared<mtf::UdevEnvironment>(); |
4640 | +} |
4641 | + |
4642 | +std::shared_ptr<void> ensure_mesa_probing_succeeds() |
4643 | +{ |
4644 | + auto udev = std::make_shared<mtf::UdevEnvironment>(); |
4645 | + |
4646 | + udev->add_standard_device("standard-drm-devices"); |
4647 | + |
4648 | + return udev; |
4649 | +} |
4650 | + |
4651 | +std::shared_ptr<void> ensure_android_probing_succeeds() |
4652 | +{ |
4653 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4654 | + using namespace testing; |
4655 | + auto mock_android = std::make_shared<NiceMock<mtd::HardwareAccessMock>>(); |
4656 | + ON_CALL(*mock_android, hw_get_module(_, _)) |
4657 | + .WillByDefault(Return(0)); |
4658 | + return mock_android; |
4659 | +#else |
4660 | + return std::shared_ptr<void>{}; |
4661 | +#endif |
4662 | +} |
4663 | +} |
4664 | + |
4665 | +TEST(ServerPlatformProbe, ConstructingWithNoModulesIsAnError) |
4666 | +{ |
4667 | + std::vector<std::shared_ptr<mir::SharedLibrary>> empty_modules; |
4668 | + EXPECT_THROW(mir::graphics::module_for_device(empty_modules), |
4669 | + std::runtime_error); |
4670 | +} |
4671 | + |
4672 | +#ifdef MIR_BUILD_PLATFORM_MESA |
4673 | +TEST(ServerPlatformProbe, LoadsMesaPlatformWhenDrmDevicePresent) |
4674 | +{ |
4675 | + using namespace testing; |
4676 | + auto block_android = ensure_android_probing_fails(); |
4677 | + auto fake_mesa = ensure_mesa_probing_succeeds(); |
4678 | + |
4679 | + auto modules = available_platforms(); |
4680 | + |
4681 | + auto module = mir::graphics::module_for_device(modules); |
4682 | + ASSERT_NE(nullptr, module); |
4683 | + |
4684 | + auto descriptor = module->load_function<mir::graphics::DescribeModule>("describe_module"); |
4685 | + auto description = descriptor(); |
4686 | + |
4687 | + EXPECT_THAT(description->name, HasSubstr("mesa")); |
4688 | +} |
4689 | +#endif |
4690 | + |
4691 | +#ifdef MIR_BUILD_PLATFORM_ANDROID |
4692 | +TEST(ServerPlatformProbe, LoadsAndroidPlatformWhenHwaccessSucceeds) |
4693 | +{ |
4694 | + using namespace testing; |
4695 | + |
4696 | + auto block_mesa = ensure_mesa_probing_fails(); |
4697 | + auto fake_android = ensure_android_probing_succeeds(); |
4698 | + |
4699 | + auto modules = available_platforms(); |
4700 | + |
4701 | + auto module = mir::graphics::module_for_device(modules); |
4702 | + ASSERT_NE(nullptr, module); |
4703 | + |
4704 | + auto descriptor = module->load_function<mir::graphics::DescribeModule>("describe_module"); |
4705 | + auto description = descriptor(); |
4706 | + |
4707 | + EXPECT_THAT(description->name, HasSubstr("android")); |
4708 | +} |
4709 | +#endif |
4710 | + |
4711 | +TEST(ServerPlatformProbe, ThrowsExceptionWhenNothingProbesSuccessfully) |
4712 | +{ |
4713 | + using namespace testing; |
4714 | + auto block_android = ensure_android_probing_fails(); |
4715 | + auto block_mesa = ensure_mesa_probing_fails(); |
4716 | + |
4717 | + |
4718 | + EXPECT_THROW(mir::graphics::module_for_device(available_platforms()), |
4719 | + std::runtime_error); |
4720 | +} |
4721 | + |
4722 | +TEST(ServerPlatformProbe, LoadsSupportedModuleWhenNoBestModule) |
4723 | +{ |
4724 | + using namespace testing; |
4725 | + auto block_android = ensure_android_probing_fails(); |
4726 | + auto block_mesa = ensure_mesa_probing_fails(); |
4727 | + |
4728 | + auto modules = available_platforms(); |
4729 | + add_dummy_platform(modules); |
4730 | + |
4731 | + auto module = mir::graphics::module_for_device(modules); |
4732 | + ASSERT_NE(nullptr, module); |
4733 | + |
4734 | + auto descriptor = module->load_function<mir::graphics::DescribeModule>("describe_module"); |
4735 | + auto description = descriptor(); |
4736 | + |
4737 | + EXPECT_THAT(description->name, HasSubstr("dummy")); |
4738 | +} |
4739 | + |
4740 | +TEST(ServerPlatformProbe, LoadsMesaOrAndroidInPreferenceToDummy) |
4741 | +{ |
4742 | + using namespace testing; |
4743 | + |
4744 | + auto ensure_mesa = ensure_mesa_probing_succeeds(); |
4745 | + auto ensure_android = ensure_android_probing_succeeds(); |
4746 | + |
4747 | + auto modules = available_platforms(); |
4748 | + add_dummy_platform(modules); |
4749 | + |
4750 | + auto module = mir::graphics::module_for_device(modules); |
4751 | + ASSERT_NE(nullptr, module); |
4752 | + |
4753 | + auto descriptor = module->load_function<mir::graphics::DescribeModule>("describe_module"); |
4754 | + auto description = descriptor(); |
4755 | + |
4756 | + EXPECT_THAT(description->name, Not(HasSubstr("dummy"))); |
4757 | +} |
4758 | |
4759 | === modified file 'tests/unit-tests/shared_library_test.cpp' |
4760 | --- tests/unit-tests/shared_library_test.cpp 2013-06-21 12:08:34 +0000 |
4761 | +++ tests/unit-tests/shared_library_test.cpp 2014-08-29 01:18:58 +0000 |
4762 | @@ -21,15 +21,19 @@ |
4763 | #include <gtest/gtest.h> |
4764 | |
4765 | #include <boost/exception/diagnostic_information.hpp> |
4766 | - |
4767 | #include <stdexcept> |
4768 | |
4769 | +#include "mir_test_framework/executable_path.h" |
4770 | + |
4771 | +namespace mtf = mir_test_framework; |
4772 | + |
4773 | namespace |
4774 | { |
4775 | class HasSubstring |
4776 | { |
4777 | public: |
4778 | HasSubstring(char const* substring) : substring(substring) {} |
4779 | + HasSubstring(std::string const& substring) : substring{substring.c_str()} {} |
4780 | |
4781 | friend::testing::AssertionResult operator,(std::string const& target, HasSubstring const& match) |
4782 | { |
4783 | @@ -50,18 +54,31 @@ |
4784 | |
4785 | #define EXPECT_THAT(target, condition) EXPECT_TRUE((target, condition)) |
4786 | |
4787 | -char const* const nonexistent_library = "nonexistent_library"; |
4788 | -char const* const existing_library = "libmirplatformgraphics.so"; |
4789 | -char const* const nonexistent_function = "nonexistent_library"; |
4790 | -char const* const existing_function = "create_platform"; |
4791 | +class SharedLibrary : public testing::Test |
4792 | +{ |
4793 | +public: |
4794 | + SharedLibrary() |
4795 | + : nonexistent_library{"imma_totally_not_a_library"}, |
4796 | + existing_library{mtf::library_path() + "/client-platform-mesa.so"}, |
4797 | + nonexistent_function{"yo_dawg"}, |
4798 | + existing_function{"create_client_platform"} |
4799 | + { |
4800 | + } |
4801 | + |
4802 | + std::string const nonexistent_library; |
4803 | + std::string const existing_library; |
4804 | + std::string const nonexistent_function; |
4805 | + std::string const existing_function; |
4806 | +}; |
4807 | + |
4808 | } |
4809 | |
4810 | -TEST(SharedLibrary, load_nonexistent_library_fails) |
4811 | +TEST_F(SharedLibrary, load_nonexistent_library_fails) |
4812 | { |
4813 | EXPECT_THROW({ mir::SharedLibrary nonexistent(nonexistent_library); }, std::runtime_error); |
4814 | } |
4815 | |
4816 | -TEST(SharedLibrary, load_nonexistent_library_fails_with_useful_info) |
4817 | +TEST_F(SharedLibrary, load_nonexistent_library_fails_with_useful_info) |
4818 | { |
4819 | try |
4820 | { |
4821 | @@ -76,19 +93,19 @@ |
4822 | } |
4823 | } |
4824 | |
4825 | -TEST(SharedLibrary, load_valid_library_works) |
4826 | +TEST_F(SharedLibrary, load_valid_library_works) |
4827 | { |
4828 | mir::SharedLibrary existing(existing_library); |
4829 | } |
4830 | |
4831 | -TEST(SharedLibrary, load_nonexistent_function_fails) |
4832 | +TEST_F(SharedLibrary, load_nonexistent_function_fails) |
4833 | { |
4834 | mir::SharedLibrary existing(existing_library); |
4835 | |
4836 | EXPECT_THROW({ existing.load_function<void(*)()>(nonexistent_function); }, std::runtime_error); |
4837 | } |
4838 | |
4839 | -TEST(SharedLibrary, load_nonexistent_function_fails_with_useful_info) |
4840 | +TEST_F(SharedLibrary, load_nonexistent_function_fails_with_useful_info) |
4841 | { |
4842 | mir::SharedLibrary existing(existing_library); |
4843 | |
4844 | @@ -106,7 +123,7 @@ |
4845 | } |
4846 | } |
4847 | |
4848 | -TEST(SharedLibrary, load_valid_function_works) |
4849 | +TEST_F(SharedLibrary, load_valid_function_works) |
4850 | { |
4851 | mir::SharedLibrary existing(existing_library); |
4852 | existing.load_function<void(*)()>(existing_function); |
4853 | |
4854 | === added directory 'tests/unit-tests/test_data' |
4855 | === added file 'tests/unit-tests/test_data/libamd64.so' |
4856 | Binary files tests/unit-tests/test_data/libamd64.so 1970-01-01 00:00:00 +0000 and tests/unit-tests/test_data/libamd64.so 2014-08-29 01:18:58 +0000 differ |
4857 | === added file 'tests/unit-tests/test_data/libarmhf.so' |
4858 | Binary files tests/unit-tests/test_data/libarmhf.so 1970-01-01 00:00:00 +0000 and tests/unit-tests/test_data/libarmhf.so 2014-08-29 01:18:58 +0000 differ |
4859 | === added file 'tests/unit-tests/test_shared_library_prober.cpp' |
4860 | --- tests/unit-tests/test_shared_library_prober.cpp 1970-01-01 00:00:00 +0000 |
4861 | +++ tests/unit-tests/test_shared_library_prober.cpp 2014-08-29 01:18:58 +0000 |
4862 | @@ -0,0 +1,165 @@ |
4863 | +/* |
4864 | + * Copyright © 2014 Canonical Ltd. |
4865 | + * |
4866 | + * This program is free software: you can redistribute it and/or modify it |
4867 | + * under the terms of the GNU General Public License version 3, |
4868 | + * as published by the Free Software Foundation. |
4869 | + * |
4870 | + * This program is distributed in the hope that it will be useful, |
4871 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4872 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4873 | + * GNU General Public License for more details. |
4874 | + * |
4875 | + * You should have received a copy of the GNU General Public License |
4876 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4877 | + * |
4878 | + * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> |
4879 | + */ |
4880 | + |
4881 | +#include "mir/shared_library_prober.h" |
4882 | + |
4883 | +#include "mir_test_framework/executable_path.h" |
4884 | + |
4885 | +#include <system_error> |
4886 | + |
4887 | +#include <gtest/gtest.h> |
4888 | +#include <gmock/gmock.h> |
4889 | + |
4890 | +namespace mtf = mir_test_framework; |
4891 | + |
4892 | +namespace |
4893 | +{ |
4894 | + |
4895 | +class MockSharedLibraryProberReport : public mir::SharedLibraryProberReport |
4896 | +{ |
4897 | +public: |
4898 | + MOCK_METHOD1(probing_path, void(boost::filesystem::path const&)); |
4899 | + MOCK_METHOD2(probing_failed, void(boost::filesystem::path const&, std::exception const&)); |
4900 | + MOCK_METHOD1(loading_library, void(boost::filesystem::path const&)); |
4901 | + MOCK_METHOD2(loading_failed, void(boost::filesystem::path const&, std::exception const&)); |
4902 | +}; |
4903 | + |
4904 | +class SharedLibraryProber : public testing::Test |
4905 | +{ |
4906 | +public: |
4907 | + SharedLibraryProber() |
4908 | + : library_path{mtf::executable_path() + "/test_data"} |
4909 | + { |
4910 | + } |
4911 | + |
4912 | + std::string const library_path; |
4913 | + testing::NiceMock<MockSharedLibraryProberReport> null_report; |
4914 | +}; |
4915 | + |
4916 | +} |
4917 | + |
4918 | +TEST_F(SharedLibraryProber, ReturnsNonEmptyListForPathContainingLibraries) |
4919 | +{ |
4920 | + auto libraries = mir::libraries_for_path(library_path, null_report); |
4921 | + EXPECT_GE(libraries.size(), 1); |
4922 | +} |
4923 | + |
4924 | +TEST_F(SharedLibraryProber, RaisesExceptionForNonexistentPath) |
4925 | +{ |
4926 | + EXPECT_THROW(mir::libraries_for_path("/a/path/that/certainly/doesnt/exist", null_report), |
4927 | + std::system_error); |
4928 | +} |
4929 | + |
4930 | +TEST_F(SharedLibraryProber, NonExistentPathRaisesENOENTError) |
4931 | +{ |
4932 | + try |
4933 | + { |
4934 | + mir::libraries_for_path("/a/path/that/certainly/doesnt/exist", null_report); |
4935 | + } |
4936 | + catch (std::system_error &err) |
4937 | + { |
4938 | + EXPECT_EQ(err.code(), std::error_code(ENOENT, std::system_category())); |
4939 | + } |
4940 | +} |
4941 | + |
4942 | +TEST_F(SharedLibraryProber, PathWithNoSharedLibrariesReturnsEmptyList) |
4943 | +{ |
4944 | + // /usr is guaranteed to exist, and shouldn't contain any libraries |
4945 | + auto libraries = mir::libraries_for_path("/usr", null_report); |
4946 | + EXPECT_EQ(0, libraries.size()); |
4947 | +} |
4948 | + |
4949 | +TEST_F(SharedLibraryProber, LogsStartOfProbe) |
4950 | +{ |
4951 | + using namespace testing; |
4952 | + testing::NiceMock<MockSharedLibraryProberReport> report; |
4953 | + |
4954 | + EXPECT_CALL(report, probing_path(testing::Eq(library_path))); |
4955 | + |
4956 | + mir::libraries_for_path(library_path, report); |
4957 | +} |
4958 | + |
4959 | +TEST_F(SharedLibraryProber, LogsForNonexistentPath) |
4960 | +{ |
4961 | + using namespace testing; |
4962 | + NiceMock<MockSharedLibraryProberReport> report; |
4963 | + |
4964 | + EXPECT_CALL(report, probing_path(testing::Eq("/yo/dawg/I/heard/you/liked/slashes"))); |
4965 | + |
4966 | + EXPECT_THROW(mir::libraries_for_path("/yo/dawg/I/heard/you/liked/slashes", report), |
4967 | + std::runtime_error); |
4968 | +} |
4969 | + |
4970 | +TEST_F(SharedLibraryProber, LogsFailureForNonexistentPath) |
4971 | +{ |
4972 | + using namespace testing; |
4973 | + NiceMock<MockSharedLibraryProberReport> report; |
4974 | + |
4975 | + EXPECT_CALL(report, probing_failed(Eq("/yo/dawg/I/heard/you/liked/slashes"), _)); |
4976 | + |
4977 | + EXPECT_THROW(mir::libraries_for_path("/yo/dawg/I/heard/you/liked/slashes", report), |
4978 | + std::runtime_error); |
4979 | + |
4980 | +} |
4981 | + |
4982 | +TEST_F(SharedLibraryProber, LogsNoLibrariesForPathWithoutLibraries) |
4983 | +{ |
4984 | + using namespace testing; |
4985 | + NiceMock<MockSharedLibraryProberReport> report; |
4986 | + |
4987 | + EXPECT_CALL(report, loading_library(_)).Times(0); |
4988 | + |
4989 | + mir::libraries_for_path("/usr", report); |
4990 | +} |
4991 | + |
4992 | +namespace |
4993 | +{ |
4994 | +MATCHER_P(FilenameMatches, path, "") |
4995 | +{ |
4996 | + *result_listener << "where the path is " << arg; |
4997 | + return boost::filesystem::path(path).filename() == arg.filename(); |
4998 | +} |
4999 | +} |
5000 | + |
FAILED: Continuous integration, rev:1801 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- ci/2265/ jenkins. qa.ubuntu. com/job/ mir-android- utopic- i386-build/ 1134/console jenkins. qa.ubuntu. com/job/ mir-clang- utopic- amd64-build/ 1140/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -utopic- touch/1125/ console jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- utopic- amd64-ci/ 787/console jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- utopic- armhf-ci/ 788/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- utopic- armhf/60/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- team-mir- development- branch- ci/2265/ rebuild
http://