Mir

Merge lp:~kdub/mir/split-platform-into-rendering-and-display into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Chris Halse Rogers
Approved revision: no longer in the source branch.
Merged at revision: 4092
Proposed branch: lp:~kdub/mir/split-platform-into-rendering-and-display
Merge into: lp:mir
Diff against target: 159 lines (+61/-19)
4 files modified
debian/control (+2/-2)
debian/libmirplatform16.install (+1/-1)
include/platform/mir/graphics/platform.h (+57/-15)
src/CMakeLists.txt (+1/-1)
To merge this branch: bzr merge lp:~kdub/mir/split-platform-into-rendering-and-display
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Mir CI Bot continuous-integration Approve
Daniel van Vugt Approve
Cemil Azizoglu (community) Approve
Andreas Pokorny (community) Needs Information
Alan Griffiths Approve
Review via email: mp+319828@code.launchpad.net

Commit message

Start to split 'server platform' into rendering and display components. More specifically, provide mg::DisplayPlatform and mg::RenderingPlatform, as well as creation entry points for creating these from the modules.

Our current system has 'host' platform and a 'guest' platform (both of which are confusingly mg::Platforms). The guest platform is used when the server wants to implement its own mg::Display (nested or offscreen). The host platform provides the capability to make displays. Its a bit confusing, and hasn't scaled well.

The outputs we currently have, or intend to have are: {kms, x11, hwc, nested, offscreen} [1] [2]
The rendering system we currently have, or intend to have are: { cpu, gbm/mesa, eglstreams/nvidia, ANWB/android } [1] [3]

Description of the change

Start to split 'server platform' into rendering and display components. More specifically, provide mg::DisplayPlatform and mg::RenderingPlatform, as well as creation entry points for creating these from the modules.

Our current system has 'host' platform and a 'guest' platform (both of which are confusingly mg::Platforms). The guest platform is used when the server wants to implement its own mg::Display (nested or offscreen). The host platform provides the capability to make displays. Its a bit confusing, and hasn't scaled well.

The outputs we currently have, or intend to have are: {kms, x11, hwc, nested, offscreen} [1] [2]
The rendering system we currently have, or intend to have are: { cpu, gbm/mesa, eglstreams/nvidia, ANWB/android } [1] [3]

The plan is to add these interfaces, transition each platform in its own MP, transition the server code to the new system, and then remove host/guest and mg::Platform once the transition is done. At first, each 'server module' will probably contain rendering or (not xor) display, and the server will figure things out from there. We can further regroup the binaries to make more sense once the internal transition is done.

[1] roughly speaking
[2] miracast and/or remote gfx access might be a part of 'offscreen' or a their own platforms. Not quit hashed out very well at the moment.
[3] we have a set of graphics API's that can run on each rendering system. eg, gbm/mesa can soon run with vulkan and various GL's (depending on how we're compiled). Those GL's will soon be able to run in software mode, or with actual drivers. 'RenderingPlatform' refers to the underlying buffering system.

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

@Alberto I'd expect that RenderingPlatform will need some sort of 'create a stream' function in it to accommodate eglstreams.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4080
https://mir-jenkins.ubuntu.com/job/mir-ci/3157/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4236
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4323
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4313
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4313
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4313
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4263/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4263/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4263/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4263/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4263/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4263
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4263/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3157/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK. But this is clearly an intermediate form - there a plan for using this somewhere?

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Hm I think the vtable methods of mg::Platform are reordered - so this looks like an ABI bump.

Looks like a reasonable start otherwise.

review: Needs Information
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

I am not sure how these two can be completely independent. E.g. buffer allocator is on the renderer side, but for overlays e.g., the allocator needs to know things about display. Perhaps there will need to be a common base class or an interface between the two. Can't see that far into the future. I guess, we can start here and add things as needed.

Nits :

Spelling
 "recieved accross"

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

*shrug* I'm hesitant to endorse increased complexity here but also haven't stopped to analyse the problem sufficiently...

ABI bump, yes probably. But we've already done that (graphics platform) bump for the 0.27/1.0 series. Perhaps a mirplatform ABI break is also occurring indirectly here but we'll need to use automated tooling to check that.

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

Oh yes, typos "recieved" and "accross".

That's all.

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote :

> I am not sure how these two can be completely independent. E.g. buffer
> allocator is on the renderer side, but for overlays e.g., the allocator needs
> to know things about display. Perhaps there will need to be a common base
> class or an interface between the two. Can't see that far into the future. I
> guess, we can start here and add things as needed.

mesa-kms and android will construct their own buffers without needing the one from the system (android at least uses allocations not available to the system anyways). If its the right thing to do at some pointin the future, no objection from me from having the Rendering use the Display platform (or vice-versa).

Revision history for this message
Kevin DuBois (kdub) wrote :

Will bump. Spelling is pre-existing, but can fix while moving

Revision history for this message
Kevin DuBois (kdub) wrote :

> *shrug* I'm hesitant to endorse increased complexity here but also haven't
> stopped to analyse the problem sufficiently...

I don't know what is meant by 'complexity' here. Guest/Host is a more confusing distinction than Rendering/Display.

>
> ABI bump, yes probably. But we've already done that (graphics platform) bump
> for the 0.27/1.0 series. Perhaps a mirplatform ABI break is also occurring
> indirectly here but we'll need to use automated tooling to check that.

platform isn't very stable or consistent between releases yet, don't mind bumping if the team wants bumps.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4082
https://mir-jenkins.ubuntu.com/job/mir-ci/3172/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4257
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4344
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4284/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4284/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4284/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4284/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4284/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4284
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4284/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3172/rebuild

review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

If https://code.launchpad.net/~kdub/mir/egl-connection-for-offscreen/+merge/319679 lands first, will update egl_native_display() here

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

Cool. Bumping mirplatform removes all doubt. Doesn't hurt.

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1201/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4263/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1267/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4350
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4340
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4340
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4340
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4290
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4290/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4290
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4290/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4290
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4290/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4290/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4290/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4290
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4290/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4290
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4290/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1203/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4267/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1269/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4354/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4344/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4344/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4344/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4294/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4294/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4294/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4294/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4294/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4294/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

As expected actually....

05:21:49 Text conflict in include/platform/mir/graphics/platform.h
05:21:49 1 conflicts encountered.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4084
https://mir-jenkins.ubuntu.com/job/mir-ci/3178/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4271
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4358
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4348
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4348
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4348
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4298/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4298/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4298/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4298/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4298/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4298
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4298/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3178/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

This seems like a sensible start.

I think we'll end up doing a bunch of dynamic_cast<>ing to more-specific interfaces in the implementations, but that's a pretty sensible way of doing better-than-default features in the presence of wildly different underlying implementations.

I don't think we'll need a create_streams() in mg::RenderingPlatform(); I think we'll need a redesign of it. That's orthogonal to splitting out RenderingPlatform(), though.

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

Looks like the Needs Info has been resolved by bumping the ABI; top-approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2017-03-10 19:47:57 +0000
3+++ debian/control 2017-03-16 14:08:52 +0000
4@@ -83,7 +83,7 @@
5 .
6 Contains the shared library needed by server applications for Mir.
7
8-Package: libmirplatform15
9+Package: libmirplatform16
10 Section: libs
11 Architecture: linux-any
12 Multi-Arch: same
13@@ -132,7 +132,7 @@
14 Architecture: linux-any
15 Multi-Arch: same
16 Pre-Depends: ${misc:Pre-Depends}
17-Depends: libmirplatform15 (= ${binary:Version}),
18+Depends: libmirplatform16 (= ${binary:Version}),
19 libmircommon-dev (= ${binary:Version}),
20 libboost-program-options-dev,
21 ${misc:Depends},
22
23=== renamed file 'debian/libmirplatform15.install' => 'debian/libmirplatform16.install'
24--- debian/libmirplatform15.install 2017-03-10 19:47:57 +0000
25+++ debian/libmirplatform16.install 2017-03-16 14:08:52 +0000
26@@ -1,1 +1,1 @@
27-usr/lib/*/libmirplatform.so.15
28+usr/lib/*/libmirplatform.so.16
29
30=== modified file 'include/platform/mir/graphics/platform.h'
31--- include/platform/mir/graphics/platform.h 2017-03-13 16:55:05 +0000
32+++ include/platform/mir/graphics/platform.h 2017-03-16 14:08:52 +0000
33@@ -72,30 +72,22 @@
34 * Interface to platform specific support for graphics operations.
35 * \ingroup platform_enablement
36 */
37-class Platform
38+class RenderingPlatform
39 {
40 public:
41- Platform() = default;
42- Platform(const Platform& p) = delete;
43- Platform& operator=(const Platform& p) = delete;
44-
45- virtual ~Platform() = default;
46-
47+ RenderingPlatform() = default;
48+ RenderingPlatform(RenderingPlatform const& p) = delete;
49+ RenderingPlatform& operator=(RenderingPlatform const& p) = delete;
50+
51+ virtual ~RenderingPlatform() = default;
52 /**
53 * Creates the buffer allocator subsystem.
54 */
55 virtual UniqueModulePtr<GraphicBufferAllocator> create_buffer_allocator() = 0;
56
57 /**
58- * Creates the display subsystem.
59- */
60- virtual UniqueModulePtr<Display> create_display(
61- std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
62- std::shared_ptr<GLConfig> const& gl_config) = 0;
63-
64- /**
65 * Creates an object capable of doing platform specific processing of buffers
66- * before they are sent or after they are recieved accross IPC
67+ * before they are sent or after they are received across IPC
68 */
69 virtual UniqueModulePtr<PlatformIpcOperations> make_ipc_operations() const = 0;
70
71@@ -106,6 +98,34 @@
72 virtual NativePlatform* native_platform() = 0;
73 };
74
75+class DisplayPlatform
76+{
77+public:
78+ DisplayPlatform() = default;
79+ DisplayPlatform(DisplayPlatform const& p) = delete;
80+ DisplayPlatform& operator=(DisplayPlatform const& p) = delete;
81+
82+ virtual ~DisplayPlatform() = default;
83+
84+ /**
85+ * Creates the display subsystem.
86+ */
87+ virtual UniqueModulePtr<Display> create_display(
88+ std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
89+ std::shared_ptr<GLConfig> const& gl_config) = 0;
90+};
91+
92+class Platform : public DisplayPlatform,
93+ public RenderingPlatform
94+{
95+public:
96+ Platform() = default;
97+ Platform(const Platform& p) = delete;
98+ Platform& operator=(const Platform& p) = delete;
99+
100+ virtual ~Platform() = default;
101+};
102+
103 /**
104 * A measure of how well a platform supports a device
105 *
106@@ -127,6 +147,8 @@
107 */
108 };
109
110+//The host/guest platform concept is soon to be removed. Use CreateRenderingPlatform and
111+//CreateDisplayPlatform instead
112 typedef mir::UniqueModulePtr<mir::graphics::Platform>(*CreateHostPlatform)(
113 std::shared_ptr<mir::options::Option> const& options,
114 std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry,
115@@ -144,6 +166,16 @@
116 typedef mir::graphics::PlatformPriority(*PlatformProbe)(mir::options::ProgramOption const& options);
117
118 typedef mir::ModuleProperties const*(*DescribeModule)();
119+
120+typedef mir::UniqueModulePtr<mir::graphics::DisplayPlatform>(*CreateDisplayPlatform)(
121+ std::shared_ptr<mir::options::Option> const& options,
122+ std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry,
123+ std::shared_ptr<mir::graphics::DisplayReport> const& report,
124+ std::shared_ptr<mir::logging::Logger> const& logger);
125+
126+typedef mir::UniqueModulePtr<mir::graphics::RenderingPlatform>(*CreateRenderingPlatform)(
127+ std::shared_ptr<mir::options::Option> const& options,
128+ std::shared_ptr<mir::graphics::NestedContext> const& nested_context);
129 }
130 }
131
132@@ -208,6 +240,16 @@
133
134 mir::ModuleProperties const* describe_graphics_module();
135
136+mir::UniqueModulePtr<mir::graphics::DisplayPlatform> create_display_platform(
137+ std::shared_ptr<mir::options::Option> const& options,
138+ std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry,
139+ std::shared_ptr<mir::graphics::DisplayReport> const& report,
140+ std::shared_ptr<mir::logging::Logger> const& logger);
141+
142+mir::UniqueModulePtr<mir::graphics::RenderingPlatform> create_rendering_platform(
143+ std::shared_ptr<mir::options::Option> const& options,
144+ std::shared_ptr<mir::graphics::NestedContext> const& nested_context);
145+
146 #if defined(__clang__)
147 #pragma clang diagnostic pop
148 #endif
149
150=== modified file 'src/CMakeLists.txt'
151--- src/CMakeLists.txt 2017-03-10 19:47:57 +0000
152+++ src/CMakeLists.txt 2017-03-16 14:08:52 +0000
153@@ -1,5 +1,5 @@
154 # We need MIRPLATFORM_ABI in both libmirplatform and the platform implementations.
155-set(MIRPLATFORM_ABI 15)
156+set(MIRPLATFORM_ABI 16)
157
158 # Add the cookie implementation before exposing any APIs
159 add_subdirectory(cookie/)

Subscribers

People subscribed via source and target branches