Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 namespace graphics
31 {
32 namespace mesa
33 {
34 
35 class VirtualTerminal;
36 class InternalNativeDisplay;
38  public DRMAuthenticator,
39  public std::enable_shared_from_this<Platform>
40 {
41 public:
42  explicit Platform(std::shared_ptr<DisplayReport> const& reporter,
43  std::shared_ptr<VirtualTerminal> const& vt);
44  ~Platform();
45 
46  /* From Platform */
47  std::shared_ptr<graphics::GraphicBufferAllocator> create_buffer_allocator(
48  const std::shared_ptr<BufferInitializer>& buffer_initializer);
49  std::shared_ptr<graphics::Display> create_display(
50  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
51  std::shared_ptr<GLConfig> const& gl_config);
52  std::shared_ptr<PlatformIPCPackage> get_ipc_package();
53  std::shared_ptr<InternalClient> create_internal_client();
54 
55  void fill_ipc_package(BufferIPCPacker* packer, Buffer const* buffer) const;
56 
57  EGLNativeDisplayType egl_native_display() const;
58 
59  /* From DRMAuthenticator */
60  void drm_auth_magic(unsigned int magic);
61 
62  std::shared_ptr<mir::udev::Context> udev;
65 
66  std::shared_ptr<DisplayReport> const listener;
67  std::shared_ptr<VirtualTerminal> const vt;
68 
69  //connection shared by all internal clients
71  static std::shared_ptr<InternalNativeDisplay> internal_native_display;
72 };
73 
75 
76 }
77 }
78 }
79 #endif /* MIR_GRAPHICS_MESA_PLATFORM_H_ */
void drm_auth_magic(unsigned int magic)
Definition: platform.cpp:182
std::shared_ptr< mir::udev::Context > udev
Definition: platform.h:62
void fill_ipc_package(BufferIPCPacker *packer, Buffer const *buffer) const
Fills the IPC package for a buffer.
Definition: platform.cpp:165
Interface to platform specific support for graphics operations.
Definition: platform.h:64
Definition: display_helpers.h:50
std::shared_ptr< VirtualTerminal > const vt
Definition: platform.h:67
std::shared_ptr< DisplayReport > const listener
Definition: platform.h:66
~Platform()
Definition: platform.cpp:136
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:70
std::shared_ptr< graphics::Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLConfig > const &gl_config)
Creates the display subsystem.
Definition: platform.cpp:149
Definition: native_display.h:39
helpers::DRMHelper drm
Definition: platform.h:63
static std::shared_ptr< InternalNativeDisplay > internal_native_display
Definition: platform.h:71
Definition: buffer_ipc_packer.h:30
std::shared_ptr< PlatformIPCPackage > get_ipc_package()
Gets the IPC package for the platform.
Definition: platform.cpp:160
int mir_server_mesa_egl_native_display_is_valid(MirMesaEGLNativeDisplay *display)
Definition: platform.cpp:213
std::shared_ptr< InternalClient > create_internal_client()
Creates the in-process client support object.
Definition: platform.cpp:187
Definition: buffer.h:34
EGLNativeDisplayType egl_native_display() const
Definition: platform.cpp:195
Definition: platform.h:37
helpers::GBMHelper gbm
Definition: platform.h:64

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014