Mir
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 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_KMS_OUTPUT_H_
20 #define MIR_GRAPHICS_MESA_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 mesa
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 
52  virtual int max_refresh_rate() const = 0;
53 
54  virtual bool set_crtc(uint32_t fb_id) = 0;
55  virtual void clear_crtc() = 0;
56  virtual bool schedule_page_flip(uint32_t fb_id) = 0;
57  virtual void wait_for_page_flip() = 0;
58 
59  virtual void set_cursor(gbm_bo* buffer) = 0;
60  virtual void move_cursor(geometry::Point destination) = 0;
61  virtual void clear_cursor() = 0;
62  virtual bool has_cursor() const = 0;
63 
64  virtual void set_power_mode(MirPowerMode mode) = 0;
65 
66 protected:
67  KMSOutput() = default;
68  KMSOutput(const KMSOutput&) = delete;
69  KMSOutput& operator=(const KMSOutput&) = delete;
70 };
71 
72 }
73 }
74 }
75 
76 #endif /* MIR_GRAPHICS_MESA_KMS_OUTPUT_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
virtual int max_refresh_rate() const =0
Approximate maximum refresh rate of this output to within 1Hz.
KMSOutput & operator=(const KMSOutput &)=delete
Definition: point.h:30
virtual bool has_cursor() const =0
virtual void set_cursor(gbm_bo *buffer)=0
Definition: kms_output.h:37
virtual bool schedule_page_flip(uint32_t fb_id)=0
virtual void move_cursor(geometry::Point destination)=0
virtual void wait_for_page_flip()=0
virtual void set_power_mode(MirPowerMode mode)=0
virtual ~KMSOutput()=default
MirPowerMode
Definition: common.h:101
Definition: displacement.h:32
virtual geometry::Size size() const =0
virtual void configure(geometry::Displacement fb_offset, size_t kms_mode_index)=0
virtual bool set_crtc(uint32_t fb_id)=0

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