Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
kms_output.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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_KMS_OUTPUT_H_
20 #define MIR_GRAPHICS_GBM_KMS_OUTPUT_H_
21 
22 #include "mir/geometry/size.h"
23 #include "mir/geometry/point.h"
26 #include "mir_toolkit/common.h"
27 
28 #include <gbm.h>
29 
30 namespace mir
31 {
32 namespace graphics
33 {
34 namespace gbm
35 {
36 
37 class KMSOutput
38 {
39 public:
40  virtual ~KMSOutput() = default;
41 
42  virtual void reset() = 0;
43  virtual void configure(geometry::Displacement fb_offset, size_t kms_mode_index) = 0;
44  virtual geometry::Size size() const = 0;
45 
46  virtual bool set_crtc(uint32_t fb_id) = 0;
47  virtual void clear_crtc() = 0;
48  virtual bool schedule_page_flip(uint32_t fb_id) = 0;
49  virtual void wait_for_page_flip() = 0;
50 
51  virtual void set_cursor(gbm_bo* buffer) = 0;
52  virtual void move_cursor(geometry::Point destination) = 0;
53  virtual void clear_cursor() = 0;
54  virtual bool has_cursor() const = 0;
55 
56  virtual void set_power_mode(MirPowerMode mode) = 0;
57 
58 protected:
59  KMSOutput() = default;
60  KMSOutput(const KMSOutput&) = delete;
61  KMSOutput& operator=(const KMSOutput&) = delete;
62 };
63 
64 }
65 }
66 }
67 
68 #endif /* MIR_GRAPHICS_GBM_KMS_OUTPUT_H_ */

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