Mir
egl_output.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_EGLSTREAM_KMS_OUTPUT_H_
20 #define MIR_GRAPHICS_EGLSTREAM_KMS_OUTPUT_H_
21 
23 #include "mir/geometry/size.h"
24 #include "mir/geometry/point.h"
27 #include "mir_toolkit/common.h"
28 
29 #include <epoxy/egl.h>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 namespace eglstream
36 {
37 
38 namespace kms
39 {
41 {
42 public:
43  EGLOutput(int drm_fd, EGLDisplay dpy, EGLOutputPortEXT connector);
44  ~EGLOutput() noexcept(false);
45 
46  void reset();
47  void configure(size_t kms_mode_index);
48  geometry::Size size() const;
49  int max_refresh_rate() const;
50 
51  EGLOutputLayerEXT output_layer() const;
52  void clear_crtc();
53 
54  void set_power_mode(MirPowerMode mode);
55 
56 private:
57  void restore_saved_crtc();
58 
59  int const drm_fd;
60 
61  EGLDisplay display;
62  EGLOutputPortEXT port;
63  EGLOutputLayerEXT layer;
64 
66 
67  size_t mode_index;
68  drmModeCrtc saved_crtc;
69  bool using_saved_crtc;
70 
71  int dpms_enum_id;
72 };
73 
74 }
75 }
76 }
77 }
78 
79 #endif /* MIR_GRAPHICS_EGLSTREAM_KMS_KMS_OUTPUT_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
EGLOutputLayerEXT output_layer() const
std::unique_ptr< drmModeConnector, std::function< void(drmModeConnector *)> > DRMModeConnectorUPtr
Definition: drm_mode_resources.h:38
MirPowerMode
Definition: common.h:101
Definition: egl_output.h:40
Configuration information for a display output.
Definition: display_configuration.h:85
void set_power_mode(MirPowerMode mode)
void configure(size_t kms_mode_index)
EGLOutput(int drm_fd, EGLDisplay dpy, EGLOutputPortEXT connector)

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016