• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
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 #pragma once
18 
19 #include <map>
20 
21 #include "../common/CommonDisplayContextProvider.h"
22 #include "libdevice/ExynosDisplay.h"
23 
24 namespace android::hardware::graphics::composer {
25 
26 class ExynosDisplayContextProvider : public CommonDisplayContextProvider {
27 public:
ExynosDisplayContextProvider(void * display,DisplayConfigurationsOwner * displayConfigurationOwner,std::shared_ptr<RefreshRateCalculator> videoFrameRateCalculator)28     ExynosDisplayContextProvider(void* display,
29                                  DisplayConfigurationsOwner* displayConfigurationOwner,
30                                  std::shared_ptr<RefreshRateCalculator> videoFrameRateCalculator)
31           : CommonDisplayContextProvider(displayConfigurationOwner,
32                                          std::move(videoFrameRateCalculator)),
33             mDisplay(static_cast<ExynosDisplay*>(display)),
34             mDisplayFileNodePath(mDisplay->getPanelSysfsPath()){};
35 
36     // Implement DisplayContextProvider
37     BrightnessMode getBrightnessMode() const final;
38 
39     int getBrightnessNits() const final;
40 
41     const char* getDisplayFileNodePath() const final;
42 
43     int getAmbientLightSensorOutput() const final;
44 
45     bool isProximityThrottlingEnabled() const final;
46     // End of DisplayContextProvider implementation.
47 
48     const std::map<uint32_t, displayConfigs_t>* getDisplayConfigs() const final;
49 
50     const displayConfigs_t* getDisplayConfig(hwc2_config_t id) const final;
51 
52     bool isHsMode(hwc2_config_t id) const final;
53 
54     int getTeFrequency(hwc2_config_t id) const final;
55 
56     int getMaxFrameRate(hwc2_config_t id) const final;
57 
58     int getWidth(hwc2_config_t id) const final;
59 
60     int getHeight(hwc2_config_t id) const final;
61 
62 private:
63     ExynosDisplay* mDisplay;
64 
65     std::string mDisplayFileNodePath;
66 };
67 
68 } // namespace android::hardware::graphics::composer
69