Mir
hwc_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_HWC_CONFIGURATION_H_
20 #define MIR_GRAPHICS_ANDROID_HWC_CONFIGURATION_H_
21 
23 #include "mir/geometry/size.h"
24 #include "display_name.h"
25 #include "device_quirks.h"
26 #include <memory>
27 #include <functional>
28 
29 namespace mir
30 {
31 namespace graphics
32 {
33 namespace android
34 {
36 {
39  double vrefresh_hz;
40  bool connected;
43 };
44 
45 using ConfigChangeSubscription = std::shared_ptr<void>;
46 //interface adapting for the blanking interface differences between fb, HWC 1.0-1.3, and HWC 1.4+
48 {
49 public:
50  virtual ~HwcConfiguration() = default;
51  virtual void power_mode(DisplayName, MirPowerMode) = 0;
53  virtual ConfigChangeSubscription subscribe_to_config_changes(std::function<void()> const& cb) = 0;
54 
55 protected:
56  HwcConfiguration() = default;
57  HwcConfiguration(HwcConfiguration const&) = delete;
59 };
60 
61 class HwcWrapper;
63 {
64 public:
65  HwcBlankingControl(std::shared_ptr<HwcWrapper> const&);
66  void power_mode(DisplayName, MirPowerMode) override;
68  ConfigChangeSubscription subscribe_to_config_changes(std::function<void()> const& cb) override;
69 
70 private:
71  DeviceQuirks quirks{PropertiesOps{}};
72  std::shared_ptr<HwcWrapper> const hwc_device;
73  bool off;
74  MirPixelFormat format;
75 };
76 
77 }
78 }
79 }
80 #endif /* MIR_GRAPHICS_ANDROID_HWC_CONFIGURATION_H_ */
Definition: size.h:30
All things Mir.
Definition: buffer_stream.h:37
ConfigChangeSubscription subscribe_to_config_changes(std::function< void()> const &cb) override
Definition: hwc_blanking_control.cpp:151
bool connected
Definition: hwc_configuration.h:40
Definition: device_quirks.h:54
std::shared_ptr< void > ConfigChangeSubscription
Definition: hwc_configuration.h:45
Definition: hwc_configuration.h:47
Definition: hwc_wrapper.h:42
DisplayName
Definition: display_name.h:31
void power_mode(DisplayName, MirPowerMode) override
Definition: hwc_blanking_control.cpp:87
MirPixelFormat display_format
Definition: hwc_configuration.h:41
geometry::Size mm_size
Definition: hwc_configuration.h:38
double vrefresh_hz
Definition: hwc_configuration.h:39
MirPowerMode
Definition: common.h:103
geometry::Size pixel_size
Definition: hwc_configuration.h:37
DisplayAttribs active_attribs_for(DisplayName) override
Definition: hwc_blanking_control.cpp:115
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:127
size_t num_framebuffers
Definition: hwc_configuration.h:42
Definition: hwc_configuration.h:35
virtual DisplayAttribs active_attribs_for(DisplayName)=0
virtual ConfigChangeSubscription subscribe_to_config_changes(std::function< void()> const &cb)=0
HwcBlankingControl(std::shared_ptr< HwcWrapper > const &)
Definition: hwc_blanking_control.cpp:79
Definition: device_quirks.h:45
Definition: android_input_receiver.h:32
HwcConfiguration & operator=(HwcConfiguration const &)=delete
Definition: hwc_configuration.h:62
virtual void power_mode(DisplayName, MirPowerMode)=0

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015