xref: /aosp_15_r20/frameworks/native/libs/ui/include/ui/DynamicDisplayInfo.h (revision 38e8c45f13ce32b0dcecb25141ffecaf386fa17f)
1 /*
2  * Copyright 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 "DisplayMode.h"
20 
21 #include <cstdint>
22 #include <optional>
23 #include <vector>
24 
25 #include <ui/FrameRateCategoryRate.h>
26 #include <ui/GraphicTypes.h>
27 #include <ui/HdrCapabilities.h>
28 
29 namespace android::ui {
30 
31 // Information about a physical display which may change on hotplug reconnect.
32 struct DynamicDisplayInfo {
33     std::vector<ui::DisplayMode> supportedDisplayModes;
34 
35     // This struct is going to be serialized over binder, so
36     // we can't use size_t because it may have different width
37     // in the client process.
38     ui::DisplayModeId activeDisplayModeId;
39     float renderFrameRate;
40 
41     std::vector<ui::ColorMode> supportedColorModes;
42     ui::ColorMode activeColorMode;
43     HdrCapabilities hdrCapabilities;
44 
45     // True if the display reports support for HDMI 2.1 Auto Low Latency Mode.
46     // For more information, see the HDMI 2.1 specification.
47     bool autoLowLatencyModeSupported;
48 
49     // True if the display reports support for Game Content Type.
50     // For more information, see the HDMI 1.4 specification.
51     bool gameContentTypeSupported;
52 
53     // The boot display mode preferred by the implementation.
54     ui::DisplayModeId preferredBootDisplayMode;
55 
56     std::optional<ui::DisplayMode> getActiveDisplayMode() const;
57 
58     bool hasArrSupport;
59 
60     // Represents frame rate for FrameRateCategory Normal and High.
61     ui::FrameRateCategoryRate frameRateCategoryRate;
62 
63     // All the refresh rates supported for the default display mode.
64     std::vector<float> supportedRefreshRates;
65 };
66 
67 } // namespace android::ui
68