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 <memory>
26 #include <functional>
27 
28 namespace mir
29 {
30 namespace graphics
31 {
32 namespace android
33 {
34 
35 using ConfigChangeSubscription = std::shared_ptr<void>;
36 //interface adapting for the blanking interface differences between fb, HWC 1.0-1.3, and HWC 1.4+
38 {
39 public:
40  virtual ~HwcConfiguration() = default;
41  virtual void power_mode(DisplayName, MirPowerMode) = 0;
44  std::function<void()> const& hotplug_cb,
45  std::function<void(DisplayName)> const& vsync_cb) = 0;
46 
47 protected:
48  HwcConfiguration() = default;
49  HwcConfiguration(HwcConfiguration const&) = delete;
51 };
52 
53 class HwcWrapper;
55 {
56 public:
57  HwcBlankingControl(std::shared_ptr<HwcWrapper> const&);
58  void power_mode(DisplayName, MirPowerMode) override;
61  std::function<void()> const& hotplug_cb,
62  std::function<void(DisplayName)> const& vsync_cb) override;
63 
64 private:
65  std::shared_ptr<HwcWrapper> const hwc_device;
66  bool off;
67  MirPixelFormat format;
68 };
69 
70 class HwcWrapper;
72 {
73 public:
74  HwcPowerModeControl(std::shared_ptr<HwcWrapper> const&);
75  void power_mode(DisplayName, MirPowerMode) override;
78  std::function<void()> const& hotplug_cb,
79  std::function<void(DisplayName)> const& vsync_cb) override;
80 
81 private:
82  std::shared_ptr<HwcWrapper> const hwc_device;
83  MirPixelFormat format;
84 };
85 
86 }
87 }
88 }
89 #endif /* MIR_GRAPHICS_ANDROID_HWC_CONFIGURATION_H_ */
All things Mir.
Definition: atomic_callback.h:25
std::shared_ptr< void > ConfigChangeSubscription
Definition: hwc_configuration.h:35
Definition: hwc_configuration.h:37
Definition: hwc_wrapper.h:43
DisplayName
Definition: display_name.h:32
MirPowerMode
Definition: common.h:101
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
virtual ConfigChangeSubscription subscribe_to_config_changes(std::function< void()> const &hotplug_cb, std::function< void(DisplayName)> const &vsync_cb)=0
Configuration information for a display output.
Definition: display_configuration.h:84
virtual DisplayConfigurationOutput active_config_for(DisplayName)=0
Definition: android_input_receiver.h:36
HwcConfiguration & operator=(HwcConfiguration const &)=delete
Definition: hwc_configuration.h:71
Definition: hwc_configuration.h:54
virtual void power_mode(DisplayName, MirPowerMode)=0

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016