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 namespace android::hardware::graphics::composer { 20 21 enum class OperationSpeedMode { 22 kHighSpeedMode = 0, 23 kNormalSpeedMode, 24 kInvalidSpeedMode, 25 }; 26 27 enum BrightnessMode { 28 kNormalBrightnessMode = 0, 29 kHighBrightnessMode, 30 kInvalidBrightnessMode, 31 }; 32 33 class DisplayContextProvider { 34 public: 35 virtual ~DisplayContextProvider() = default; 36 37 virtual OperationSpeedMode getOperationSpeedMode() const = 0; 38 39 virtual BrightnessMode getBrightnessMode() const = 0; 40 41 virtual int getBrightnessNits() const = 0; 42 43 virtual const char* getDisplayFileNodePath() const = 0; 44 45 virtual int getEstimatedVideoFrameRate() const = 0; 46 47 virtual int getAmbientLightSensorOutput() const = 0; 48 49 virtual bool isProximityThrottlingEnabled() const = 0; 50 }; 51 52 struct DisplayContextProviderInterface { 53 OperationSpeedMode (*getOperationSpeedMode)(void* host); 54 55 BrightnessMode (*getBrightnessMode)(void* host); 56 57 int (*getBrightnessNits)(void* host); 58 59 const char* (*getDisplayFileNodePath)(void* hosts); 60 61 int (*getEstimatedVideoFrameRate)(void* host); 62 63 int (*getAmbientLightSensorOutput)(void* hosts); 64 65 bool (*isProximityThrottlingEnabled)(void* hosts); 66 }; 67 68 } // namespace android::hardware::graphics::composer 69