Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gbm_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 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU 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_GBM_GBM_PLATFORM_H_
20 #define MIR_GRAPHICS_GBM_GBM_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
24 #include "gbm_display_helpers.h"
25 
27 
28 namespace mir
29 {
30 namespace graphics
31 {
32 namespace gbm
33 {
34 
35 class VirtualTerminal;
36 class InternalNativeDisplay;
37 class GBMPlatform : public Platform,
38  public DRMAuthenticator,
39  public std::enable_shared_from_this<GBMPlatform>
40 {
41 public:
42  explicit GBMPlatform(std::shared_ptr<DisplayReport> const& reporter,
43  std::shared_ptr<VirtualTerminal> const& vt);
44  ~GBMPlatform();
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<Display> create_display(
50  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy);
51  std::shared_ptr<PlatformIPCPackage> get_ipc_package();
52  std::shared_ptr<InternalClient> create_internal_client();
53 
54  void fill_ipc_package(std::shared_ptr<BufferIPCPacker> const& packer,
55  std::shared_ptr<Buffer> const& buffer) const;
56 
57  /* From DRMAuthenticator */
58  void drm_auth_magic(drm_magic_t magic);
59 
63 
64  std::shared_ptr<DisplayReport> const listener;
65  std::shared_ptr<VirtualTerminal> const vt;
66 
67  //connection shared by all internal clients
69  static std::shared_ptr<InternalNativeDisplay> internal_native_display;
70 };
71 
73 
74 }
75 }
76 }
77 #endif /* MIR_GRAPHICS_GBM_GBM_PLATFORM_H_ */
78 

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013