-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathvm_interface.h
187 lines (162 loc) · 5.2 KB
/
vm_interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __VM_INTERFACE_H__
#define __VM_INTERFACE_H__
#define SDM_COMP_SERVICE_ID 5006
#define SDM_COMP_SERVICE_VERSION 1
#define SDM_COMP_SERVICE_INSTANCE 1
#define VM_INTF_REVISION_MAJOR (1)
#define VM_INTF_REVISION_MINOR (4)
#define VM_INTF_VERSION ((uint16_t) ((VM_INTF_REVISION_MAJOR << 8) | VM_INTF_REVISION_MINOR))
enum CommandId {
kCmdExportDemuraBuffers = 0,
kCmdSetBacklight = 1,
kCmdSetDisplayConfig = 2,
kCmdSetProperties = 3,
kCmdSetPanelBootParams = 4,
kCmdMax,
};
enum DisplayType {
kDisplayTypePrimary = 0,
kDisplayTypeSecondary1 = 1,
kDisplayTypeMax,
};
typedef struct DemuraMemInfo_t {
int64_t calib_mem_hdl = -1;
int64_t hfc_mem_hdl = -1;
uint32_t calib_mem_size = 0;
uint32_t hfc_mem_size = 0;
uint64_t panel_id = 0;
uint32_t calib_payload_size = 0;
char file_name[128];
} DemuraMemInfo;
typedef struct Property_t {
char prop_name[48] = { 0 };
char value[128] = { 0 };
} Property;
typedef struct Properties_t {
Property property_list[2] = {};
int count = -1;
} Properties;
typedef struct CommandHeader_t {
uint16_t version = VM_INTF_VERSION;;
int32_t id = -1;
} CommandHeader;
typedef struct ResponseHeader_t {
int32_t id = -1;
int32_t status = -1;
} ResponseHeader;
// Command and Response structure definitions to start TUI session
typedef struct CmdExportDemuraBuffer_t {
union {
DemuraMemInfo demura_mem_info;
uint32_t reserve[128] = { 0 };
};
} CmdExportDemuraBuffer;
typedef struct RspExportDemuraBuffer_t {
union {
uint32_t reserve[128] = { 0 };
};
} RspExportDemuraBuffer;
// Command and Response structure definitions to set backlight for a specified display
typedef struct CmdSetBacklight_t {
union {
struct {
float brightness;
DisplayType disp_type;
};
uint32_t reserve[128] = { 0 };
};
} CmdSetBacklight;
typedef struct RspSetBacklight_t {
union {
uint32_t reserve[128] = { 0 };
};
} RspSetBacklight;
// Command and Response structure definitions to set display config mode
typedef struct CmdSetDisplayConfigs_t {
union {
struct {
uint32_t x_pixels;
uint32_t y_pixels;
uint32_t v_total;
uint32_t h_total;
uint32_t fps;
int config_idx;
DisplayType disp_type;
bool smart_panel;
};
uint32_t reserve[128] = { 0 };
};
} CmdSetDisplayConfigs;
typedef struct RspSetDisplayConfigs_t {
union {
uint32_t reserve[128] = { 0 };
};
} RspSetDisplayConfigs;
// Command and Response structure definitions to propagate the android property
typedef struct CmdSetProperties_t {
union {
Properties props;
uint32_t reserve[128] = { 0 };
};
} CmdSetProperties;
typedef struct RspSetProperties_t {
union {
uint32_t reserve[128] = { 0 };
};
} RspSetProperties;
// Command and Response structure to set panel boot parameters to insmod of display drivers
typedef struct CmdSetPanelBootParam_t {
union {
char panel_boot_string[256];
uint32_t reserve[128] = { 0 };
};
} CmdSetPanelBootParam;
typedef struct RspSetPanelBootParam_t {
union {
uint32_t reserve[128] = { 0 };
};
} RspSetPanelBootParam;
struct Command : CommandHeader {
Command() {}
union {
CmdExportDemuraBuffer cmd_export_demura_buf;
CmdSetBacklight cmd_set_backlight;
CmdSetDisplayConfigs cmd_set_disp_configs;
CmdSetProperties cmd_set_properties;
CmdSetPanelBootParam cmd_set_panel_boot_param;
};
};
struct Response : ResponseHeader {
Response() {}
union {
RspExportDemuraBuffer rsp_export_demura_buf;
RspSetBacklight rsp_set_backlight;
RspSetDisplayConfigs rsp_set_disp_configs;
RspSetProperties rsp_set_properties;
RspSetPanelBootParam rsp_set_panel_boot_param;
};
};
#endif // __VM_INTERFACE_H__