• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 <cstdint>
20 #include <vector>
21 
22 namespace hcct {
23 namespace edid {
24 
25 #define EDP_MONITOR_LIST(X)                                                     \
26   X(REDRIX)                                                    \
27 
28 #define DP_MONITOR_LIST(X)                                                     \
29   X(ACI_9713_ASUS_VE258_DP)                                                    \
30   X(DEL_61463_DELL_U2410_DP)                                                   \
31   X(HP_Spectre32_4K_DP)                                                        \
32   X(HWP_12446_HP_Z24i_DP)
33 
34 #define HDMI_MONITOR_LIST(X)                                                   \
35   X(ACI_9155_ASUS_VH238_HDMI)                                                  \
36   X(DEL_61462_DELL_U2410_HDMI)                                                 \
37   X(HP_Spectre32_4K_HDMI)                                                      \
38   X(HWP_12447_HP_Z24i_HDMI)
39 
40 enum class EdpMonitorName {
41   #define X(monitor) monitor,
42     EDP_MONITOR_LIST(X)
43   #undef X
44 };
45 
46 enum class DpMonitorName {
47 #define X(monitor) monitor,
48   DP_MONITOR_LIST(X)
49 #undef X
50 };
51 
52 enum class HdmiMonitorName {
53 #define X(monitor) monitor,
54   HDMI_MONITOR_LIST(X)
55 #undef X
56 };
57 
58 // Unified type to use for function arguments to handle both DP and HDMI.
59 struct MonitorName {
60   enum class Type { UNSET, EDP, DP, HDMI } type;
61   union {
62     EdpMonitorName edp;
63     DpMonitorName dp;
64     HdmiMonitorName hdmi;
65   };
MonitorNameMonitorName66   MonitorName() : type(Type::UNSET) {}
MonitorNameMonitorName67   MonitorName(EdpMonitorName name) : type(Type::EDP), edp(name) {}
MonitorNameMonitorName68   MonitorName(DpMonitorName name) : type(Type::DP), dp(name) {}
MonitorNameMonitorName69   MonitorName(HdmiMonitorName name) : type(Type::HDMI), hdmi(name) {}
70 };
71 
72 std::vector<uint8_t> getBinaryEdidForMonitor(const MonitorName &monitorName);
73 
74 } // namespace edid
75 } // namespace hcct
76