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();
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 virtual void setDrmMaster() = 0;
58 // Get FD associated with this DisplayManager.
59 virtual uint32_t GetFD() const = 0;
61 virtual NativeDisplay *CreateVirtualDisplay(uint32_t display_index) = 0;
62 virtual void DestroyVirtualDisplay(uint32_t display_index) = 0;
64 #ifdef ENABLE_PANORAMA
65 virtual NativeDisplay *CreateVirtualPanoramaDisplay(
66 uint32_t display_index) = 0;
69 virtual std::vector<NativeDisplay *> GetAllDisplays() = 0;
71 virtual void RegisterHotPlugEventCallback(
72 std::shared_ptr<DisplayHotPlugEventCallback> callback) = 0;
74 virtual uint32_t GetConnectedPhysicalDisplayCount() = 0;
76 virtual void EnableHDCPSessionForDisplay(uint32_t connector,
77 HWCContentType content_type) = 0;
78 virtual void EnableHDCPSessionForAllDisplays(HWCContentType content_type) = 0;
79 virtual void DisableHDCPSessionForDisplay(uint32_t connector) = 0;
80 virtual void DisableHDCPSessionForAllDisplays() = 0;
81 virtual void SetHDCPSRMForAllDisplays(const int8_t *SRM,
82 uint32_t SRMLength) = 0;
83 virtual void SetHDCPSRMForDisplay(uint32_t connector, const int8_t *SRM,
84 uint32_t SRMLength) = 0;
85 virtual void RemoveUnreservedPlanes() = 0;
87 virtual FrameBufferManager *GetFrameBufferManager() = 0;
90 } // namespace hwcomposer
91 #endif // WSI_MANAGER_H_