1 /*
2  * Copyright (C) 2021 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 <aidl/com/google/hardware/pixel/display/BnDisplay.h>
20 
21 #include "ExynosDevice.h"
22 
23 namespace aidl {
24 namespace com {
25 namespace google {
26 namespace hardware {
27 namespace pixel {
28 namespace display {
29 
30 using aidl::android::hardware::common::NativeHandle;
31 
32 // Default implementation
33 class Display : public BnDisplay {
34 public:
Display(ExynosDevice * device)35     Display(ExynosDevice *device) : mDevice(device){};
36 
37     ndk::ScopedAStatus isHbmSupported(bool *_aidl_return) override;
38     ndk::ScopedAStatus setHbmState(HbmState state) override;
39     ndk::ScopedAStatus getHbmState(HbmState *_aidl_return) override;
40     ndk::ScopedAStatus isLbeSupported(bool *_aidl_return) override;
41     ndk::ScopedAStatus setLbeState(LbeState state) override;
42     ndk::ScopedAStatus setLbeAmbientLight(int ambientLux) override;
43     ndk::ScopedAStatus getLbeState(LbeState *_aidl_return) override;
44     ndk::ScopedAStatus isLhbmSupported(bool *_aidl_return) override;
45     ndk::ScopedAStatus setLhbmState(bool enabled) override;
46     ndk::ScopedAStatus getLhbmState(bool *_aidl_return) override;
47     ndk::ScopedAStatus setCompensationImageHandle(const NativeHandle &native_handle,
48                                                   const std::string &imageName,
49                                                   int *_aidl_return) override;
50     ndk::ScopedAStatus setMinIdleRefreshRate(int fps, int *_aidl_return) override;
51     ndk::ScopedAStatus setRefreshRateThrottle(int delayMs, int *_aidl_return) override;
52 
53 private:
54     ExynosDevice *mDevice = nullptr;
55 };
56 } // namespace display
57 } // namespace pixel
58 } // namespace hardware
59 } // namespace google
60 } // namespace com
61 } // namespace aidl
62