~unity-team/mir/version_bump_for_multimonitor_silo

« back to all changes in this revision

Viewing changes to src/platforms/mesa/server/kms/nested_authentication.h

  • 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:
32
32
class NestedAuthentication : public DRMAuthentication
33
33
{
34
34
public:
35
 
    NestedAuthentication(std::shared_ptr<PlatformAuthentication> const& platform_authentication);
 
35
    NestedAuthentication(std::shared_ptr<graphics::PlatformAuthentication> const& platform_authentication);
36
36
    void auth_magic(drm_magic_t magic) override;
37
37
    mir::Fd authenticated_fd() override;
38
38
private:
39
 
    std::shared_ptr<PlatformAuthentication> const platform_authentication;
 
39
    std::shared_ptr<graphics::PlatformAuthentication> const platform_authentication;
40
40
    std::shared_ptr<MesaAuthExtension> const auth_extension;
41
41
};
42
42
}