~unity-team/mir/version_bump_for_multimonitor_silo

« back to all changes in this revision

Viewing changes to src/platforms/mesa/server/x11/graphics/platform.cpp

  • Committer: Tarmac
  • Author(s): Kevin DuBois
  • Date: 2017-03-28 05:26:36 UTC
  • mfrom: (4076.3.19 drm-auth-from-display)
  • Revision ID: tarmac-20170328052636-iqyelakjqcflooeq
Give the authentication the BufferPlatform needs from the DisplayPlatform for drm systems via the mg::Display::native_display_platform() and mg::PlatformAuthentication interfaces.

With android and nvidia [1], the DisplayPlatform and RenderingPlatform don't really have a dependency between each other.

Mesa needs a fd (sourced from /dev/dri/card* or /dev/dri/render*, as appropriate) to initialize the RenderingPlatform, specifically, it needs it to initialize the gbm device. The platform also gives out authenticated fds over IPC to clients via mir::frontend. This fd is best owned by the DisplayPlatform (nested, kms, and x11 all do things a bit differently, but all need to provide fds so that gbm devices can be made), and given to the RenderingPlatform. 

[1] in its current implementation. We might have to share the resources between rendering/display there too, hopefully that platform now has the levers it needs to do that in the way that's best fit.
.

Approved by mir-ci-bot, Cemil Azizoglu, Alan Griffiths, Chris Halse Rogers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
    drm->setup(udev);
42
42
    gbm.setup(*drm);
 
43
    native_platform = std::make_unique<mgm::DRMNativePlatform>(*drm);
43
44
}
44
45
 
45
46
mir::UniqueModulePtr<mg::GraphicBufferAllocator> mgx::Platform::create_buffer_allocator()
57
58
 
58
59
mg::NativeDisplayPlatform* mgx::Platform::native_display_platform()
59
60
{
60
 
    return nullptr;
 
61
    return native_platform.get();
61
62
}
62
63
 
63
64
mir::UniqueModulePtr<mg::PlatformIpcOperations> mgx::Platform::make_ipc_operations() const