2 // Copyright (c) 2016 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef WSI_MANAGER_H_
18 #define WSI_MANAGER_H_
22 #include "nativedisplay.h"
24 namespace hwcomposer {
27 class DisplayManager {
29 static DisplayManager *CreateDisplayManager(GpuDevice *device);
30 DisplayManager() = default;
31 virtual ~DisplayManager() {
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;
41 // GetAllDisplays is expected to return set
42 // of correct displays after this call is done.
43 virtual void InitializeDisplayResources() = 0;
45 // Display Manager should initialize resources to start monitoring
46 // for Hotplug events.
47 virtual void StartHotPlugMonitor() = 0;
49 // Refresh all displays managed by this display manager.
50 virtual void ForceRefresh() = 0;
52 // Ignore updates for all displays managed by this display
53 // manager until ForceRefresh is called.
54 virtual void IgnoreUpdates() = 0;
56 // Get FD associated with this DisplayManager.
57 virtual uint32_t GetFD() const = 0;
59 virtual NativeDisplay *CreateVirtualDisplay(uint32_t display_index) = 0;
60 virtual void DestroyVirtualDisplay(uint32_t display_index) = 0;
62 virtual std::vector<NativeDisplay *> GetAllDisplays() = 0;
64 virtual void RegisterHotPlugEventCallback(
65 std::shared_ptr<DisplayHotPlugEventCallback> callback) = 0;
67 virtual uint32_t GetConnectedPhysicalDisplayCount() = 0;
70 } // namespace hwcomposer
71 #endif // WSI_MANAGER_H_