Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
platform.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_MESA_PLATFORM_H_
20 #define MIR_GRAPHICS_MESA_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
24 #include "display_helpers.h"
25 
27 
28 namespace mir
29 {
30 class EmergencyCleanupRegistry;
31 namespace graphics
32 {
33 namespace mesa
34 {
35 enum class BypassOption
36 {
37  allowed,
39 };
40 
41 class VirtualTerminal;
42 class InternalNativeDisplay;
44  public DRMAuthenticator,
45  public std::enable_shared_from_this<Platform>
46 {
47 public:
48  explicit Platform(std::shared_ptr<DisplayReport> const& reporter,
49  std::shared_ptr<VirtualTerminal> const& vt,
50  EmergencyCleanupRegistry& emergency_cleanup_registry,
52  ~Platform();
53 
54  /* From Platform */
55  std::shared_ptr<graphics::GraphicBufferAllocator> create_buffer_allocator(
56  const std::shared_ptr<BufferInitializer>& buffer_initializer);
57  std::shared_ptr<graphics::BufferWriter> make_buffer_writer();
58  std::shared_ptr<graphics::Display> create_display(
59  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
60  std::shared_ptr<GLProgramFactory> const& program_factory,
61  std::shared_ptr<GLConfig> const& gl_config);
62  std::shared_ptr<InternalClient> create_internal_client();
63 
64  std::shared_ptr<PlatformIpcOperations> make_ipc_operations() const override;
65 
66  EGLNativeDisplayType egl_native_display() const;
67 
68  /* From DRMAuthenticator */
69  void drm_auth_magic(unsigned int magic);
70 
71  std::shared_ptr<mir::udev::Context> udev;
72  std::shared_ptr<helpers::DRMHelper> const drm;
74 
75  std::shared_ptr<DisplayReport> const listener;
76  std::shared_ptr<VirtualTerminal> const vt;
77 
79 
80  //connection shared by all internal clients
82  static std::shared_ptr<InternalNativeDisplay> internal_native_display;
83 private:
84  BypassOption const bypass_option_;
85 };
86 
88 
89 }
90 }
91 }
92 #endif /* MIR_GRAPHICS_MESA_PLATFORM_H_ */
All things Mir.
Definition: aging_buffer.h:24
void drm_auth_magic(unsigned int magic)
Definition: platform.cpp:166
std::shared_ptr< mir::udev::Context > udev
Definition: platform.h:71
std::shared_ptr< graphics::Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLProgramFactory > const &program_factory, std::shared_ptr< GLConfig > const &gl_config)
Creates the display subsystem.
Definition: platform.cpp:154
Interface to platform specific support for graphics operations.
Definition: platform.h:67
std::shared_ptr< graphics::BufferWriter > make_buffer_writer()
Definition: platform.cpp:185
std::shared_ptr< PlatformIpcOperations > make_ipc_operations() const override
Creates an object capable of doing platform specific processing of buffers before they are sent or af...
Definition: platform.cpp:180
std::shared_ptr< VirtualTerminal > const vt
Definition: platform.h:76
std::shared_ptr< DisplayReport > const listener
Definition: platform.h:75
~Platform()
Definition: platform.cpp:141
std::shared_ptr< graphics::GraphicBufferAllocator > create_buffer_allocator(const std::shared_ptr< BufferInitializer > &buffer_initializer)
Creates the buffer allocator subsystem.
Definition: display_helpers.h:78
Definition: drm_authenticator.h:27
static bool internal_display_clients_present
Definition: platform.h:81
BypassOption bypass_option() const
Definition: platform.cpp:195
Definition: native_display.h:39
Definition: emergency_cleanup_registry.h:30
static std::shared_ptr< InternalNativeDisplay > internal_native_display
Definition: platform.h:82
std::shared_ptr< helpers::DRMHelper > const drm
Definition: platform.h:72
int mir_server_mesa_egl_native_display_is_valid(MirMesaEGLNativeDisplay *display)
Definition: platform.cpp:221
std::shared_ptr< InternalClient > create_internal_client()
Creates the in-process client support object.
Definition: platform.cpp:171
EGLNativeDisplayType egl_native_display() const
Definition: platform.cpp:190
Definition: platform.h:43
helpers::GBMHelper gbm
Definition: platform.h:73
BypassOption
Definition: platform.h:35

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014