Mir

Merge lp://qastaging/~cemil-azizoglu/mir/add-create-module-context-fn into lp://qastaging/mir

Proposed by Cemil Azizoglu
Status: Work in progress
Proposed branch: lp://qastaging/~cemil-azizoglu/mir/add-create-module-context-fn
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~cemil-azizoglu/mir/mir-on-x-configure
Diff against target: 510 lines (+127/-39)
23 files modified
include/platform/mir/graphics/platform.h (+12/-4)
include/platform/mir/input/platform.h (+6/-2)
src/platforms/android/server/platform.cpp (+9/-2)
src/platforms/android/server/symbols.map (+5/-0)
src/platforms/mesa/server/kms/guest_platform.cpp (+2/-1)
src/platforms/mesa/server/kms/platform.cpp (+7/-1)
src/platforms/mesa/server/kms/symbols.map (+5/-0)
src/platforms/mesa/server/x11/CMakeLists.txt (+7/-0)
src/platforms/mesa/server/x11/X11_resources.cpp (+11/-0)
src/platforms/mesa/server/x11/graphics/CMakeLists.txt (+2/-9)
src/platforms/mesa/server/x11/graphics/graphics.cpp (+7/-6)
src/platforms/mesa/server/x11/input/CMakeLists.txt (+1/-1)
src/platforms/mesa/server/x11/input/input.cpp (+5/-4)
src/platforms/mesa/server/x11/symbols.map (+5/-0)
src/server/graphics/default_configuration.cpp (+7/-2)
src/server/input/default_configuration.cpp (+5/-1)
tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+2/-1)
tests/mir_test_doubles/platform_factory.cpp (+2/-1)
tests/mir_test_framework/stub_input.cpp (+7/-1)
tests/mir_test_framework/stubbed_graphics_platform.cpp (+9/-2)
tests/mir_test_framework/symbols-server.map (+5/-0)
tests/mir_test_framework/symbols-stub-input.map (+5/-0)
tests/unit-tests/graphics/android/test_platform.cpp (+1/-1)
To merge this branch: bzr merge lp://qastaging/~cemil-azizoglu/mir/add-create-module-context-fn
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Alan Griffiths Needs Information
Alexandros Frantzis (community) Needs Fixing
Review via email: mp+269127@code.qastaging.launchpad.net

Commit message

Add create_module_context() to platform implementations.

Description of the change

Add create_module_context() to platform implementations.

- Both graphics and input platforms would have this function.
- If both graphics and input platforms are compiled into the same so, there will be one implementation.
- The function is called before creating a graphics and/or input platform.
- The context created is opaque outside the platform layer.
- The context obtained will then be provided to APIs such as create_input_platform, create_host_platform, create_guest_platform.
- This facilitates the X11 related assets to be created once and be used for input as well as graphics.

To post a comment you must log in.
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Also platform ABI, graphics ABI and input ABI need to be bumped. Will bump separately.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2837. By Cemil Azizoglu

Fix android build

2838. By Cemil Azizoglu

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> std::shared_ptr<void> module_context

std::shared_ptr<void> const&, for consistency with the rest of the code (the idea being not to pay the cost of copying the shared_ptr<> unless it's actually needed by the callee).

Looks good otherwise.

review: Needs Fixing
2839. By Cemil Azizoglu

merge prereq

2840. By Cemil Azizoglu

Move create_module_context function to the main dir of x platform

2841. By Cemil Azizoglu

merge prereq

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

I was about to suggest using mir::UniqueModulePtr<void> instead - it would keep the module alive at least as long as the context object from the platform is alive. But unique_ptr does not allow void.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I was about to suggest using mir::UniqueModulePtr<void> instead - it would
> keep the module alive at least as long as the context object from the platform
> is alive. But unique_ptr does not allow void.

As with the branch Alexandros proposed yesterday there's an advantage to an "empty" type with a vtab - it can be used with RTTI to safely downcast at the receiving end.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

*Needs Discussion*

I'm just pondering an alternative approach: adding a method to mg::Platform. Vis:

  auto create_input_platform(...) -> UniqueModulePtr<input::Platform>

It the user has specified an input platform this can be ignored, otherwise call this and if it returns non-nullptr then use the result. Otherwise Mir looks for a suitable module elsewhere as currently.

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

> *Needs Discussion*
>
> I'm just pondering an alternative approach: adding a method to mg::Platform.
> Vis:
>
> auto create_input_platform(...) -> UniqueModulePtr<input::Platform>
>
> It the user has specified an input platform this can be ignored, otherwise
> call this and if it returns non-nullptr then use the result. Otherwise Mir
> looks for a suitable module elsewhere as currently.

Some anomalies with this approach would be :

- Not sure how this would solve the problem of creating a common context for both graphics and input irrespective of load order.
- Strange to have an "input" related interface in mir::graphics::...
- A graphics only platform would still need to have a create_input_platform() entry point.. confusing IMO.
- Imposes an order in which graphics (first) and input (next) platforms need to be created

2842. By Cemil Azizoglu

create_module_context --> get_module_context
CreateModuleContext --> GetModuleContext

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

Need to think about this more. Making it WIP for now.

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

Unmerged revisions

2842. By Cemil Azizoglu

create_module_context --> get_module_context
CreateModuleContext --> GetModuleContext

2841. By Cemil Azizoglu

merge prereq

2840. By Cemil Azizoglu

Move create_module_context function to the main dir of x platform

2839. By Cemil Azizoglu

merge prereq

2838. By Cemil Azizoglu

merge trunk

2837. By Cemil Azizoglu

Fix android build

2836. By Cemil Azizoglu

Add create_module_context() to platforms

2835. By Cemil Azizoglu

merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches