OSDN Git Service

aa73ce4d7e1bba87adffa349b52f595366f7b336
[android-x86/external-IA-Hardware-Composer.git] / wsi / displaymanager.h
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #ifndef WSI_MANAGER_H_
18 #define WSI_MANAGER_H_
19
20 #include <stdint.h>
21
22 #include "nativedisplay.h"
23
24 namespace hwcomposer {
25
26 class GpuDevice;
27 class DisplayManager {
28  public:
29   static DisplayManager *CreateDisplayManager(GpuDevice *device);
30   DisplayManager() = default;
31   virtual ~DisplayManager() {
32   }
33
34   // Initialize things which are critical for
35   // Display Manager. InitializeDisplayResources
36   // is expected to be called to handle things
37   // which can be initialized later to finish
38   // the initialization.
39   virtual bool Initialize() = 0;
40
41   // GetAllDisplays is expected to return set
42   // of correct displays after this call is done.
43   virtual void InitializeDisplayResources() = 0;
44
45   // Display Manager should initialize resources to start monitoring
46   // for Hotplug events.
47   virtual void StartHotPlugMonitor() = 0;
48
49   // Refresh all displays managed by this display manager.
50   virtual void ForceRefresh() = 0;
51
52   // Ignore updates for all displays managed by this display
53   // manager until ForceRefresh is called.
54   virtual void IgnoreUpdates() = 0;
55
56   // Get FD associated with this DisplayManager.
57   virtual uint32_t GetFD() const = 0;
58
59   virtual NativeDisplay *CreateVirtualDisplay(uint32_t display_index) = 0;
60   virtual void DestroyVirtualDisplay(uint32_t display_index) = 0;
61
62   virtual std::vector<NativeDisplay *> GetAllDisplays() = 0;
63
64   virtual void RegisterHotPlugEventCallback(
65       std::shared_ptr<DisplayHotPlugEventCallback> callback) = 0;
66
67   virtual uint32_t GetConnectedPhysicalDisplayCount() = 0;
68 };
69
70 }  // namespace hwcomposer
71 #endif  // WSI_MANAGER_H_