1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3
4
5 #include <string.h>
6 #include "renderControl_opcodes.h"
7
8 #include "renderControl_dec.h"
9
10
11 #include "ProtocolUtils.h"
12
13 #include "ChecksumCalculatorThreadInfo.h"
14
15 #include "host-common/logging.h"
16
17 #include <stdio.h>
18
19 namespace gfxstream {
20
21 typedef unsigned int tsize_t; // Target "size_t", which is 32-bit for now. It may or may not be the same as host's size_t when emugen is compiled.
22
23 #ifdef CHECK_GL_ERRORS
24 # define SET_LASTCALL(name) sprintf(lastCall, #name)
25 #else
26 # define SET_LASTCALL(name)
27 #endif
decode(void * buf,size_t len,IOStream * stream,ChecksumCalculator * checksumCalc)28 size_t renderControl_decoder_context_t::decode(void *buf, size_t len, IOStream *stream, ChecksumCalculator* checksumCalc) {
29 if (len < 8) return 0;
30 #ifdef CHECK_GL_ERRORS
31 char lastCall[256] = {0};
32 #endif
33 unsigned char *ptr = (unsigned char *)buf;
34 const unsigned char* const end = (const unsigned char*)buf + len;
35 while (end - ptr >= 8) {
36 uint32_t opcode = *(uint32_t *)ptr;
37 uint32_t packetLen = *(uint32_t *)(ptr + 4);
38 if (end - ptr < packetLen) return ptr - (unsigned char*)buf;
39 // Do this on every iteration, as some commands may change the checksum
40 // calculation parameters.
41 const size_t checksumSize = checksumCalc->checksumByteSize();
42 const bool useChecksum = checksumSize > 0;
43 switch(opcode) {
44 case OP_rcGetRendererVersion: {
45 android::base::beginTrace("rcGetRendererVersion decode");
46 if (useChecksum) {
47 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8, ptr + 8, checksumSize,
48 "renderControl_decoder_context_t::decode, OP_rcGetRendererVersion: GL checksumCalculator failure\n");
49 }
50 size_t totalTmpSize = sizeof(GLint);
51 totalTmpSize += checksumSize;
52 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
53 DECODER_DEBUG_LOG("renderControl(%p): rcGetRendererVersion()", stream);
54 *(GLint *)(&tmpBuf[0]) = this->rcGetRendererVersion();
55 if (useChecksum) {
56 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
57 }
58 stream->flush();
59 SET_LASTCALL("rcGetRendererVersion");
60 android::base::endTrace();
61 break;
62 }
63 case OP_rcGetEGLVersion: {
64 android::base::beginTrace("rcGetEGLVersion decode");
65 uint32_t size_major __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8);
66 uint32_t size_minor __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
67 if (useChecksum) {
68 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
69 "renderControl_decoder_context_t::decode, OP_rcGetEGLVersion: GL checksumCalculator failure\n");
70 }
71 size_t totalTmpSize = size_major;
72 totalTmpSize += size_minor;
73 totalTmpSize += sizeof(EGLint);
74 totalTmpSize += checksumSize;
75 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
76 OutputBuffer outptr_major(&tmpBuf[0], size_major);
77 OutputBuffer outptr_minor(&tmpBuf[0 + size_major], size_minor);
78 DECODER_DEBUG_LOG("renderControl(%p): rcGetEGLVersion(major:%p(%u) minor:%p(%u) )", stream, (EGLint*)(outptr_major.get()), size_major, (EGLint*)(outptr_minor.get()), size_minor);
79 *(EGLint *)(&tmpBuf[0 + size_major + size_minor]) = this->rcGetEGLVersion((EGLint*)(outptr_major.get()), (EGLint*)(outptr_minor.get()));
80 outptr_major.flush();
81 outptr_minor.flush();
82 if (useChecksum) {
83 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
84 }
85 stream->flush();
86 SET_LASTCALL("rcGetEGLVersion");
87 android::base::endTrace();
88 break;
89 }
90 case OP_rcQueryEGLString: {
91 android::base::beginTrace("rcQueryEGLString decode");
92 EGLenum var_name = Unpack<EGLenum,uint32_t>(ptr + 8);
93 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
94 EGLint var_bufferSize = Unpack<EGLint,uint32_t>(ptr + 8 + 4 + 4);
95 if (useChecksum) {
96 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
97 "renderControl_decoder_context_t::decode, OP_rcQueryEGLString: GL checksumCalculator failure\n");
98 }
99 size_t totalTmpSize = size_buffer;
100 totalTmpSize += sizeof(EGLint);
101 totalTmpSize += checksumSize;
102 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
103 OutputBuffer outptr_buffer(&tmpBuf[0], size_buffer);
104 DECODER_DEBUG_LOG("renderControl(%p): rcQueryEGLString(name:0x%08x buffer:%p(%u) bufferSize:0x%08x )", stream, var_name, (void*)(outptr_buffer.get()), size_buffer, var_bufferSize);
105 *(EGLint *)(&tmpBuf[0 + size_buffer]) = this->rcQueryEGLString(var_name, (void*)(outptr_buffer.get()), var_bufferSize);
106 outptr_buffer.flush();
107 if (useChecksum) {
108 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
109 }
110 stream->flush();
111 SET_LASTCALL("rcQueryEGLString");
112 android::base::endTrace();
113 break;
114 }
115 case OP_rcGetGLString: {
116 android::base::beginTrace("rcGetGLString decode");
117 EGLenum var_name = Unpack<EGLenum,uint32_t>(ptr + 8);
118 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
119 EGLint var_bufferSize = Unpack<EGLint,uint32_t>(ptr + 8 + 4 + 4);
120 if (useChecksum) {
121 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
122 "renderControl_decoder_context_t::decode, OP_rcGetGLString: GL checksumCalculator failure\n");
123 }
124 size_t totalTmpSize = size_buffer;
125 totalTmpSize += sizeof(EGLint);
126 totalTmpSize += checksumSize;
127 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
128 OutputBuffer outptr_buffer(&tmpBuf[0], size_buffer);
129 DECODER_DEBUG_LOG("renderControl(%p): rcGetGLString(name:0x%08x buffer:%p(%u) bufferSize:0x%08x )", stream, var_name, (void*)(outptr_buffer.get()), size_buffer, var_bufferSize);
130 *(EGLint *)(&tmpBuf[0 + size_buffer]) = this->rcGetGLString(var_name, (void*)(outptr_buffer.get()), var_bufferSize);
131 outptr_buffer.flush();
132 if (useChecksum) {
133 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
134 }
135 stream->flush();
136 SET_LASTCALL("rcGetGLString");
137 android::base::endTrace();
138 break;
139 }
140 case OP_rcGetNumConfigs: {
141 android::base::beginTrace("rcGetNumConfigs decode");
142 uint32_t size_numAttribs __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8);
143 if (useChecksum) {
144 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
145 "renderControl_decoder_context_t::decode, OP_rcGetNumConfigs: GL checksumCalculator failure\n");
146 }
147 size_t totalTmpSize = size_numAttribs;
148 totalTmpSize += sizeof(EGLint);
149 totalTmpSize += checksumSize;
150 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
151 OutputBuffer outptr_numAttribs(&tmpBuf[0], size_numAttribs);
152 DECODER_DEBUG_LOG("renderControl(%p): rcGetNumConfigs(numAttribs:%p(%u) )", stream, (uint32_t*)(outptr_numAttribs.get()), size_numAttribs);
153 *(EGLint *)(&tmpBuf[0 + size_numAttribs]) = this->rcGetNumConfigs((uint32_t*)(outptr_numAttribs.get()));
154 outptr_numAttribs.flush();
155 if (useChecksum) {
156 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
157 }
158 stream->flush();
159 SET_LASTCALL("rcGetNumConfigs");
160 android::base::endTrace();
161 break;
162 }
163 case OP_rcGetConfigs: {
164 android::base::beginTrace("rcGetConfigs decode");
165 uint32_t var_bufSize = Unpack<uint32_t,uint32_t>(ptr + 8);
166 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
167 if (useChecksum) {
168 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
169 "renderControl_decoder_context_t::decode, OP_rcGetConfigs: GL checksumCalculator failure\n");
170 }
171 size_t totalTmpSize = size_buffer;
172 totalTmpSize += sizeof(EGLint);
173 totalTmpSize += checksumSize;
174 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
175 OutputBuffer outptr_buffer(&tmpBuf[0], size_buffer);
176 DECODER_DEBUG_LOG("renderControl(%p): rcGetConfigs(bufSize:0x%08x buffer:%p(%u) )", stream, var_bufSize, (GLuint*)(outptr_buffer.get()), size_buffer);
177 *(EGLint *)(&tmpBuf[0 + size_buffer]) = this->rcGetConfigs(var_bufSize, (GLuint*)(outptr_buffer.get()));
178 outptr_buffer.flush();
179 if (useChecksum) {
180 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
181 }
182 stream->flush();
183 SET_LASTCALL("rcGetConfigs");
184 android::base::endTrace();
185 break;
186 }
187 case OP_rcChooseConfig: {
188 android::base::beginTrace("rcChooseConfig decode");
189 uint32_t size_attribs __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8);
190 InputBuffer inptr_attribs(ptr + 8 + 4, size_attribs);
191 uint32_t var_attribs_size = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_attribs);
192 uint32_t size_configs __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_attribs + 4);
193 uint32_t var_configs_size = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_attribs + 4 + 4);
194 if (useChecksum) {
195 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + size_attribs + 4 + 4 + 4, ptr + 8 + 4 + size_attribs + 4 + 4 + 4, checksumSize,
196 "renderControl_decoder_context_t::decode, OP_rcChooseConfig: GL checksumCalculator failure\n");
197 }
198 size_t totalTmpSize = size_configs;
199 totalTmpSize += sizeof(EGLint);
200 totalTmpSize += checksumSize;
201 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
202 OutputBuffer outptr_configs(&tmpBuf[0], size_configs);
203 DECODER_DEBUG_LOG("renderControl(%p): rcChooseConfig(attribs:%p(%u) attribs_size:0x%08x configs:%p(%u) configs_size:0x%08x )", stream, (EGLint*)(inptr_attribs.get()), size_attribs, var_attribs_size, (uint32_t*)(outptr_configs.get()), size_configs, var_configs_size);
204 *(EGLint *)(&tmpBuf[0 + size_configs]) = this->rcChooseConfig((EGLint*)(inptr_attribs.get()), var_attribs_size, size_configs == 0 ? nullptr : (uint32_t*)(outptr_configs.get()), var_configs_size);
205 outptr_configs.flush();
206 if (useChecksum) {
207 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
208 }
209 stream->flush();
210 SET_LASTCALL("rcChooseConfig");
211 android::base::endTrace();
212 break;
213 }
214 case OP_rcGetFBParam: {
215 android::base::beginTrace("rcGetFBParam decode");
216 EGLint var_param = Unpack<EGLint,uint32_t>(ptr + 8);
217 if (useChecksum) {
218 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
219 "renderControl_decoder_context_t::decode, OP_rcGetFBParam: GL checksumCalculator failure\n");
220 }
221 size_t totalTmpSize = sizeof(EGLint);
222 totalTmpSize += checksumSize;
223 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
224 DECODER_DEBUG_LOG("renderControl(%p): rcGetFBParam(param:0x%08x )", stream, var_param);
225 *(EGLint *)(&tmpBuf[0]) = this->rcGetFBParam(var_param);
226 if (useChecksum) {
227 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
228 }
229 stream->flush();
230 SET_LASTCALL("rcGetFBParam");
231 android::base::endTrace();
232 break;
233 }
234 case OP_rcCreateContext: {
235 android::base::beginTrace("rcCreateContext decode");
236 uint32_t var_config = Unpack<uint32_t,uint32_t>(ptr + 8);
237 uint32_t var_share = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
238 uint32_t var_glVersion = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
239 if (useChecksum) {
240 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
241 "renderControl_decoder_context_t::decode, OP_rcCreateContext: GL checksumCalculator failure\n");
242 }
243 size_t totalTmpSize = sizeof(uint32_t);
244 totalTmpSize += checksumSize;
245 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
246 DECODER_DEBUG_LOG("renderControl(%p): rcCreateContext(config:0x%08x share:0x%08x glVersion:0x%08x )", stream, var_config, var_share, var_glVersion);
247 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateContext(var_config, var_share, var_glVersion);
248 if (useChecksum) {
249 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
250 }
251 stream->flush();
252 SET_LASTCALL("rcCreateContext");
253 android::base::endTrace();
254 break;
255 }
256 case OP_rcDestroyContext: {
257 android::base::beginTrace("rcDestroyContext decode");
258 uint32_t var_context = Unpack<uint32_t,uint32_t>(ptr + 8);
259 if (useChecksum) {
260 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
261 "renderControl_decoder_context_t::decode, OP_rcDestroyContext: GL checksumCalculator failure\n");
262 }
263 DECODER_DEBUG_LOG("renderControl(%p): rcDestroyContext(context:0x%08x )", stream, var_context);
264 this->rcDestroyContext(var_context);
265 SET_LASTCALL("rcDestroyContext");
266 android::base::endTrace();
267 break;
268 }
269 case OP_rcCreateWindowSurface: {
270 android::base::beginTrace("rcCreateWindowSurface decode");
271 uint32_t var_config = Unpack<uint32_t,uint32_t>(ptr + 8);
272 uint32_t var_width = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
273 uint32_t var_height = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
274 if (useChecksum) {
275 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
276 "renderControl_decoder_context_t::decode, OP_rcCreateWindowSurface: GL checksumCalculator failure\n");
277 }
278 size_t totalTmpSize = sizeof(uint32_t);
279 totalTmpSize += checksumSize;
280 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
281 DECODER_DEBUG_LOG("renderControl(%p): rcCreateWindowSurface(config:0x%08x width:0x%08x height:0x%08x )", stream, var_config, var_width, var_height);
282 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateWindowSurface(var_config, var_width, var_height);
283 if (useChecksum) {
284 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
285 }
286 stream->flush();
287 SET_LASTCALL("rcCreateWindowSurface");
288 android::base::endTrace();
289 break;
290 }
291 case OP_rcDestroyWindowSurface: {
292 android::base::beginTrace("rcDestroyWindowSurface decode");
293 uint32_t var_windowSurface = Unpack<uint32_t,uint32_t>(ptr + 8);
294 if (useChecksum) {
295 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
296 "renderControl_decoder_context_t::decode, OP_rcDestroyWindowSurface: GL checksumCalculator failure\n");
297 }
298 DECODER_DEBUG_LOG("renderControl(%p): rcDestroyWindowSurface(windowSurface:0x%08x )", stream, var_windowSurface);
299 this->rcDestroyWindowSurface(var_windowSurface);
300 SET_LASTCALL("rcDestroyWindowSurface");
301 android::base::endTrace();
302 break;
303 }
304 case OP_rcCreateColorBuffer: {
305 android::base::beginTrace("rcCreateColorBuffer decode");
306 uint32_t var_width = Unpack<uint32_t,uint32_t>(ptr + 8);
307 uint32_t var_height = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
308 GLenum var_internalFormat = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4);
309 if (useChecksum) {
310 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
311 "renderControl_decoder_context_t::decode, OP_rcCreateColorBuffer: GL checksumCalculator failure\n");
312 }
313 size_t totalTmpSize = sizeof(uint32_t);
314 totalTmpSize += checksumSize;
315 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
316 DECODER_DEBUG_LOG("renderControl(%p): rcCreateColorBuffer(width:0x%08x height:0x%08x internalFormat:0x%08x )", stream, var_width, var_height, var_internalFormat);
317 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateColorBuffer(var_width, var_height, var_internalFormat);
318 if (useChecksum) {
319 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
320 }
321 stream->flush();
322 SET_LASTCALL("rcCreateColorBuffer");
323 android::base::endTrace();
324 break;
325 }
326 case OP_rcOpenColorBuffer: {
327 android::base::beginTrace("rcOpenColorBuffer decode");
328 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
329 if (useChecksum) {
330 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
331 "renderControl_decoder_context_t::decode, OP_rcOpenColorBuffer: GL checksumCalculator failure\n");
332 }
333 DECODER_DEBUG_LOG("renderControl(%p): rcOpenColorBuffer(colorbuffer:0x%08x )", stream, var_colorbuffer);
334 this->rcOpenColorBuffer(var_colorbuffer);
335 SET_LASTCALL("rcOpenColorBuffer");
336 android::base::endTrace();
337 break;
338 }
339 case OP_rcCloseColorBuffer: {
340 android::base::beginTrace("rcCloseColorBuffer decode");
341 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
342 if (useChecksum) {
343 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
344 "renderControl_decoder_context_t::decode, OP_rcCloseColorBuffer: GL checksumCalculator failure\n");
345 }
346 DECODER_DEBUG_LOG("renderControl(%p): rcCloseColorBuffer(colorbuffer:0x%08x )", stream, var_colorbuffer);
347 this->rcCloseColorBuffer(var_colorbuffer);
348 SET_LASTCALL("rcCloseColorBuffer");
349 android::base::endTrace();
350 break;
351 }
352 case OP_rcSetWindowColorBuffer: {
353 android::base::beginTrace("rcSetWindowColorBuffer decode");
354 uint32_t var_windowSurface = Unpack<uint32_t,uint32_t>(ptr + 8);
355 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
356 if (useChecksum) {
357 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
358 "renderControl_decoder_context_t::decode, OP_rcSetWindowColorBuffer: GL checksumCalculator failure\n");
359 }
360 DECODER_DEBUG_LOG("renderControl(%p): rcSetWindowColorBuffer(windowSurface:0x%08x colorBuffer:0x%08x )", stream, var_windowSurface, var_colorBuffer);
361 this->rcSetWindowColorBuffer(var_windowSurface, var_colorBuffer);
362 SET_LASTCALL("rcSetWindowColorBuffer");
363 android::base::endTrace();
364 break;
365 }
366 case OP_rcFlushWindowColorBuffer: {
367 android::base::beginTrace("rcFlushWindowColorBuffer decode");
368 uint32_t var_windowSurface = Unpack<uint32_t,uint32_t>(ptr + 8);
369 if (useChecksum) {
370 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
371 "renderControl_decoder_context_t::decode, OP_rcFlushWindowColorBuffer: GL checksumCalculator failure\n");
372 }
373 size_t totalTmpSize = sizeof(int);
374 totalTmpSize += checksumSize;
375 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
376 DECODER_DEBUG_LOG("renderControl(%p): rcFlushWindowColorBuffer(windowSurface:0x%08x )", stream, var_windowSurface);
377 *(int *)(&tmpBuf[0]) = this->rcFlushWindowColorBuffer(var_windowSurface);
378 if (useChecksum) {
379 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
380 }
381 stream->flush();
382 SET_LASTCALL("rcFlushWindowColorBuffer");
383 android::base::endTrace();
384 break;
385 }
386 case OP_rcMakeCurrent: {
387 android::base::beginTrace("rcMakeCurrent decode");
388 uint32_t var_context = Unpack<uint32_t,uint32_t>(ptr + 8);
389 uint32_t var_drawSurf = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
390 uint32_t var_readSurf = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
391 if (useChecksum) {
392 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
393 "renderControl_decoder_context_t::decode, OP_rcMakeCurrent: GL checksumCalculator failure\n");
394 }
395 size_t totalTmpSize = sizeof(EGLint);
396 totalTmpSize += checksumSize;
397 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
398 DECODER_DEBUG_LOG("renderControl(%p): rcMakeCurrent(context:0x%08x drawSurf:0x%08x readSurf:0x%08x )", stream, var_context, var_drawSurf, var_readSurf);
399 *(EGLint *)(&tmpBuf[0]) = this->rcMakeCurrent(var_context, var_drawSurf, var_readSurf);
400 if (useChecksum) {
401 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
402 }
403 stream->flush();
404 SET_LASTCALL("rcMakeCurrent");
405 android::base::endTrace();
406 break;
407 }
408 case OP_rcFBPost: {
409 android::base::beginTrace("rcFBPost decode");
410 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
411 if (useChecksum) {
412 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
413 "renderControl_decoder_context_t::decode, OP_rcFBPost: GL checksumCalculator failure\n");
414 }
415 DECODER_DEBUG_LOG("renderControl(%p): rcFBPost(colorBuffer:0x%08x )", stream, var_colorBuffer);
416 this->rcFBPost(var_colorBuffer);
417 SET_LASTCALL("rcFBPost");
418 android::base::endTrace();
419 break;
420 }
421 case OP_rcFBSetSwapInterval: {
422 android::base::beginTrace("rcFBSetSwapInterval decode");
423 EGLint var_interval = Unpack<EGLint,uint32_t>(ptr + 8);
424 if (useChecksum) {
425 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
426 "renderControl_decoder_context_t::decode, OP_rcFBSetSwapInterval: GL checksumCalculator failure\n");
427 }
428 DECODER_DEBUG_LOG("renderControl(%p): rcFBSetSwapInterval(interval:0x%08x )", stream, var_interval);
429 this->rcFBSetSwapInterval(var_interval);
430 SET_LASTCALL("rcFBSetSwapInterval");
431 android::base::endTrace();
432 break;
433 }
434 case OP_rcBindTexture: {
435 android::base::beginTrace("rcBindTexture decode");
436 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
437 if (useChecksum) {
438 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
439 "renderControl_decoder_context_t::decode, OP_rcBindTexture: GL checksumCalculator failure\n");
440 }
441 DECODER_DEBUG_LOG("renderControl(%p): rcBindTexture(colorBuffer:0x%08x )", stream, var_colorBuffer);
442 this->rcBindTexture(var_colorBuffer);
443 SET_LASTCALL("rcBindTexture");
444 android::base::endTrace();
445 break;
446 }
447 case OP_rcBindRenderbuffer: {
448 android::base::beginTrace("rcBindRenderbuffer decode");
449 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
450 if (useChecksum) {
451 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
452 "renderControl_decoder_context_t::decode, OP_rcBindRenderbuffer: GL checksumCalculator failure\n");
453 }
454 DECODER_DEBUG_LOG("renderControl(%p): rcBindRenderbuffer(colorBuffer:0x%08x )", stream, var_colorBuffer);
455 this->rcBindRenderbuffer(var_colorBuffer);
456 SET_LASTCALL("rcBindRenderbuffer");
457 android::base::endTrace();
458 break;
459 }
460 case OP_rcColorBufferCacheFlush: {
461 android::base::beginTrace("rcColorBufferCacheFlush decode");
462 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
463 EGLint var_postCount = Unpack<EGLint,uint32_t>(ptr + 8 + 4);
464 int var_forRead = Unpack<int,uint32_t>(ptr + 8 + 4 + 4);
465 if (useChecksum) {
466 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
467 "renderControl_decoder_context_t::decode, OP_rcColorBufferCacheFlush: GL checksumCalculator failure\n");
468 }
469 size_t totalTmpSize = sizeof(EGLint);
470 totalTmpSize += checksumSize;
471 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
472 DECODER_DEBUG_LOG("renderControl(%p): rcColorBufferCacheFlush(colorbuffer:0x%08x postCount:0x%08x forRead:%d )", stream, var_colorbuffer, var_postCount, var_forRead);
473 *(EGLint *)(&tmpBuf[0]) = this->rcColorBufferCacheFlush(var_colorbuffer, var_postCount, var_forRead);
474 if (useChecksum) {
475 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
476 }
477 stream->flush();
478 SET_LASTCALL("rcColorBufferCacheFlush");
479 android::base::endTrace();
480 break;
481 }
482 case OP_rcReadColorBuffer: {
483 android::base::beginTrace("rcReadColorBuffer decode");
484 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
485 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
486 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
487 GLint var_width = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4);
488 GLint var_height = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
489 GLenum var_format = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
490 GLenum var_type = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4);
491 uint32_t size_pixels __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
492 if (useChecksum) {
493 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4, checksumSize,
494 "renderControl_decoder_context_t::decode, OP_rcReadColorBuffer: GL checksumCalculator failure\n");
495 }
496 size_t totalTmpSize = size_pixels;
497 totalTmpSize += checksumSize;
498 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
499 OutputBuffer outptr_pixels(&tmpBuf[0], size_pixels);
500 DECODER_DEBUG_LOG("renderControl(%p): rcReadColorBuffer(colorbuffer:0x%08x x:0x%08x y:0x%08x width:0x%08x height:0x%08x format:0x%08x type:0x%08x pixels:%p(%u) )", stream, var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, (void*)(outptr_pixels.get()), size_pixels);
501 this->rcReadColorBuffer(var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, (void*)(outptr_pixels.get()));
502 outptr_pixels.flush();
503 if (useChecksum) {
504 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
505 }
506 stream->flush();
507 SET_LASTCALL("rcReadColorBuffer");
508 android::base::endTrace();
509 break;
510 }
511 case OP_rcUpdateColorBuffer: {
512 android::base::beginTrace("rcUpdateColorBuffer decode");
513 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
514 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
515 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
516 GLint var_width = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4);
517 GLint var_height = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
518 GLenum var_format = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
519 GLenum var_type = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4);
520 uint32_t size_pixels __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
521 InputBuffer inptr_pixels(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4, size_pixels);
522 if (useChecksum) {
523 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + size_pixels, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + size_pixels, checksumSize,
524 "renderControl_decoder_context_t::decode, OP_rcUpdateColorBuffer: GL checksumCalculator failure\n");
525 }
526 size_t totalTmpSize = sizeof(int);
527 totalTmpSize += checksumSize;
528 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
529 DECODER_DEBUG_LOG("renderControl(%p): rcUpdateColorBuffer(colorbuffer:0x%08x x:0x%08x y:0x%08x width:0x%08x height:0x%08x format:0x%08x type:0x%08x pixels:%p(%u) )", stream, var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, (void*)(inptr_pixels.get()), size_pixels);
530 *(int *)(&tmpBuf[0]) = this->rcUpdateColorBuffer(var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, (void*)(inptr_pixels.get()));
531 if (useChecksum) {
532 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
533 }
534 stream->flush();
535 SET_LASTCALL("rcUpdateColorBuffer");
536 android::base::endTrace();
537 break;
538 }
539 case OP_rcOpenColorBuffer2: {
540 android::base::beginTrace("rcOpenColorBuffer2 decode");
541 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
542 if (useChecksum) {
543 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
544 "renderControl_decoder_context_t::decode, OP_rcOpenColorBuffer2: GL checksumCalculator failure\n");
545 }
546 size_t totalTmpSize = sizeof(int);
547 totalTmpSize += checksumSize;
548 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
549 DECODER_DEBUG_LOG("renderControl(%p): rcOpenColorBuffer2(colorbuffer:0x%08x )", stream, var_colorbuffer);
550 *(int *)(&tmpBuf[0]) = this->rcOpenColorBuffer2(var_colorbuffer);
551 if (useChecksum) {
552 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
553 }
554 stream->flush();
555 SET_LASTCALL("rcOpenColorBuffer2");
556 android::base::endTrace();
557 break;
558 }
559 case OP_rcCreateClientImage: {
560 android::base::beginTrace("rcCreateClientImage decode");
561 uint32_t var_context = Unpack<uint32_t,uint32_t>(ptr + 8);
562 EGLenum var_target = Unpack<EGLenum,uint32_t>(ptr + 8 + 4);
563 GLuint var_buffer = Unpack<GLuint,uint32_t>(ptr + 8 + 4 + 4);
564 if (useChecksum) {
565 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
566 "renderControl_decoder_context_t::decode, OP_rcCreateClientImage: GL checksumCalculator failure\n");
567 }
568 size_t totalTmpSize = sizeof(uint32_t);
569 totalTmpSize += checksumSize;
570 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
571 DECODER_DEBUG_LOG("renderControl(%p): rcCreateClientImage(context:0x%08x target:0x%08x buffer:0x%08x )", stream, var_context, var_target, var_buffer);
572 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateClientImage(var_context, var_target, var_buffer);
573 if (useChecksum) {
574 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
575 }
576 stream->flush();
577 SET_LASTCALL("rcCreateClientImage");
578 android::base::endTrace();
579 break;
580 }
581 case OP_rcDestroyClientImage: {
582 android::base::beginTrace("rcDestroyClientImage decode");
583 uint32_t var_image = Unpack<uint32_t,uint32_t>(ptr + 8);
584 if (useChecksum) {
585 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
586 "renderControl_decoder_context_t::decode, OP_rcDestroyClientImage: GL checksumCalculator failure\n");
587 }
588 size_t totalTmpSize = sizeof(int);
589 totalTmpSize += checksumSize;
590 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
591 DECODER_DEBUG_LOG("renderControl(%p): rcDestroyClientImage(image:0x%08x )", stream, var_image);
592 *(int *)(&tmpBuf[0]) = this->rcDestroyClientImage(var_image);
593 if (useChecksum) {
594 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
595 }
596 stream->flush();
597 SET_LASTCALL("rcDestroyClientImage");
598 android::base::endTrace();
599 break;
600 }
601 case OP_rcSelectChecksumHelper: {
602 android::base::beginTrace("rcSelectChecksumHelper decode");
603 uint32_t var_newProtocol = Unpack<uint32_t,uint32_t>(ptr + 8);
604 uint32_t var_reserved = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
605 if (useChecksum) {
606 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
607 "renderControl_decoder_context_t::decode, OP_rcSelectChecksumHelper: GL checksumCalculator failure\n");
608 }
609 DECODER_DEBUG_LOG("renderControl(%p): rcSelectChecksumHelper(newProtocol:0x%08x reserved:0x%08x )", stream, var_newProtocol, var_reserved);
610 this->rcSelectChecksumHelper(var_newProtocol, var_reserved);
611 SET_LASTCALL("rcSelectChecksumHelper");
612 android::base::endTrace();
613 break;
614 }
615 case OP_rcCreateSyncKHR: {
616 android::base::beginTrace("rcCreateSyncKHR decode");
617 EGLenum var_type = Unpack<EGLenum,uint32_t>(ptr + 8);
618 uint32_t size_attribs __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
619 InputBuffer inptr_attribs(ptr + 8 + 4 + 4, size_attribs);
620 uint32_t var_num_attribs = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + size_attribs);
621 int var_destroy_when_signaled = Unpack<int,uint32_t>(ptr + 8 + 4 + 4 + size_attribs + 4);
622 uint32_t size_glsync_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + size_attribs + 4 + 4);
623 uint32_t size_syncthread_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + size_attribs + 4 + 4 + 4);
624 if (useChecksum) {
625 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + size_attribs + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + size_attribs + 4 + 4 + 4 + 4, checksumSize,
626 "renderControl_decoder_context_t::decode, OP_rcCreateSyncKHR: GL checksumCalculator failure\n");
627 }
628 size_t totalTmpSize = size_glsync_out;
629 totalTmpSize += size_syncthread_out;
630 totalTmpSize += checksumSize;
631 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
632 OutputBuffer outptr_glsync_out(&tmpBuf[0], size_glsync_out);
633 OutputBuffer outptr_syncthread_out(&tmpBuf[0 + size_glsync_out], size_syncthread_out);
634 DECODER_DEBUG_LOG("renderControl(%p): rcCreateSyncKHR(type:0x%08x attribs:%p(%u) num_attribs:0x%08x destroy_when_signaled:%d glsync_out:%p(%u) syncthread_out:%p(%u) )", stream, var_type, (EGLint*)(inptr_attribs.get()), size_attribs, var_num_attribs, var_destroy_when_signaled, (uint64_t*)(outptr_glsync_out.get()), size_glsync_out, (uint64_t*)(outptr_syncthread_out.get()), size_syncthread_out);
635 this->rcCreateSyncKHR(var_type, (EGLint*)(inptr_attribs.get()), var_num_attribs, var_destroy_when_signaled, (uint64_t*)(outptr_glsync_out.get()), (uint64_t*)(outptr_syncthread_out.get()));
636 outptr_glsync_out.flush();
637 outptr_syncthread_out.flush();
638 if (useChecksum) {
639 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
640 }
641 stream->flush();
642 SET_LASTCALL("rcCreateSyncKHR");
643 android::base::endTrace();
644 break;
645 }
646 case OP_rcClientWaitSyncKHR: {
647 android::base::beginTrace("rcClientWaitSyncKHR decode");
648 uint64_t var_sync = Unpack<uint64_t,uint64_t>(ptr + 8);
649 EGLint var_flags = Unpack<EGLint,uint32_t>(ptr + 8 + 8);
650 uint64_t var_timeout = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4);
651 if (useChecksum) {
652 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 8, ptr + 8 + 8 + 4 + 8, checksumSize,
653 "renderControl_decoder_context_t::decode, OP_rcClientWaitSyncKHR: GL checksumCalculator failure\n");
654 }
655 size_t totalTmpSize = sizeof(EGLint);
656 totalTmpSize += checksumSize;
657 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
658 DECODER_DEBUG_LOG("renderControl(%p): rcClientWaitSyncKHR(sync:0x%016lx flags:0x%08x timeout:0x%016lx )", stream, var_sync, var_flags, var_timeout);
659 *(EGLint *)(&tmpBuf[0]) = this->rcClientWaitSyncKHR(var_sync, var_flags, var_timeout);
660 if (useChecksum) {
661 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
662 }
663 stream->flush();
664 SET_LASTCALL("rcClientWaitSyncKHR");
665 android::base::endTrace();
666 break;
667 }
668 case OP_rcFlushWindowColorBufferAsync: {
669 android::base::beginTrace("rcFlushWindowColorBufferAsync decode");
670 uint32_t var_windowSurface = Unpack<uint32_t,uint32_t>(ptr + 8);
671 if (useChecksum) {
672 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
673 "renderControl_decoder_context_t::decode, OP_rcFlushWindowColorBufferAsync: GL checksumCalculator failure\n");
674 }
675 DECODER_DEBUG_LOG("renderControl(%p): rcFlushWindowColorBufferAsync(windowSurface:0x%08x )", stream, var_windowSurface);
676 this->rcFlushWindowColorBufferAsync(var_windowSurface);
677 SET_LASTCALL("rcFlushWindowColorBufferAsync");
678 android::base::endTrace();
679 break;
680 }
681 case OP_rcDestroySyncKHR: {
682 android::base::beginTrace("rcDestroySyncKHR decode");
683 uint64_t var_sync = Unpack<uint64_t,uint64_t>(ptr + 8);
684 if (useChecksum) {
685 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize,
686 "renderControl_decoder_context_t::decode, OP_rcDestroySyncKHR: GL checksumCalculator failure\n");
687 }
688 size_t totalTmpSize = sizeof(int);
689 totalTmpSize += checksumSize;
690 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
691 DECODER_DEBUG_LOG("renderControl(%p): rcDestroySyncKHR(sync:0x%016lx )", stream, var_sync);
692 *(int *)(&tmpBuf[0]) = this->rcDestroySyncKHR(var_sync);
693 if (useChecksum) {
694 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
695 }
696 stream->flush();
697 SET_LASTCALL("rcDestroySyncKHR");
698 android::base::endTrace();
699 break;
700 }
701 case OP_rcSetPuid: {
702 android::base::beginTrace("rcSetPuid decode");
703 uint64_t var_puid = Unpack<uint64_t,uint64_t>(ptr + 8);
704 if (useChecksum) {
705 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize,
706 "renderControl_decoder_context_t::decode, OP_rcSetPuid: GL checksumCalculator failure\n");
707 }
708 DECODER_DEBUG_LOG("renderControl(%p): rcSetPuid(puid:0x%016lx )", stream, var_puid);
709 this->rcSetPuid(var_puid);
710 SET_LASTCALL("rcSetPuid");
711 android::base::endTrace();
712 break;
713 }
714 case OP_rcUpdateColorBufferDMA: {
715 android::base::beginTrace("rcUpdateColorBufferDMA decode");
716 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
717 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
718 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
719 GLint var_width = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4);
720 GLint var_height = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
721 GLenum var_format = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
722 GLenum var_type = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4);
723 uint64_t var_pixels_guest_paddr = Unpack<uint64_t,uint64_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
724 void* var_pixels = stream->getDmaForReading(var_pixels_guest_paddr);
725 uint32_t size_pixels __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8);
726 uint32_t var_pixels_size = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8);
727 if (useChecksum) {
728 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4, checksumSize,
729 "renderControl_decoder_context_t::decode, OP_rcUpdateColorBufferDMA: GL checksumCalculator failure\n");
730 }
731 size_t totalTmpSize = sizeof(int);
732 totalTmpSize += checksumSize;
733 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
734 DECODER_DEBUG_LOG("renderControl(%p): rcUpdateColorBufferDMA(colorbuffer:0x%08x x:0x%08x y:0x%08x width:0x%08x height:0x%08x format:0x%08x type:0x%08x pixels:%p(%u) pixels_size:0x%08x )", stream, var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, var_pixels, var_pixels_size);
735 *(int *)(&tmpBuf[0]) = this->rcUpdateColorBufferDMA(var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, var_pixels, var_pixels_size);
736 stream->unlockDma(var_pixels_guest_paddr);
737 if (useChecksum) {
738 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
739 }
740 stream->flush();
741 SET_LASTCALL("rcUpdateColorBufferDMA");
742 android::base::endTrace();
743 break;
744 }
745 case OP_rcCreateColorBufferDMA: {
746 android::base::beginTrace("rcCreateColorBufferDMA decode");
747 uint32_t var_width = Unpack<uint32_t,uint32_t>(ptr + 8);
748 uint32_t var_height = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
749 GLenum var_internalFormat = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4);
750 int var_frameworkFormat = Unpack<int,uint32_t>(ptr + 8 + 4 + 4 + 4);
751 if (useChecksum) {
752 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4, checksumSize,
753 "renderControl_decoder_context_t::decode, OP_rcCreateColorBufferDMA: GL checksumCalculator failure\n");
754 }
755 size_t totalTmpSize = sizeof(uint32_t);
756 totalTmpSize += checksumSize;
757 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
758 DECODER_DEBUG_LOG("renderControl(%p): rcCreateColorBufferDMA(width:0x%08x height:0x%08x internalFormat:0x%08x frameworkFormat:%d )", stream, var_width, var_height, var_internalFormat, var_frameworkFormat);
759 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateColorBufferDMA(var_width, var_height, var_internalFormat, var_frameworkFormat);
760 if (useChecksum) {
761 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
762 }
763 stream->flush();
764 SET_LASTCALL("rcCreateColorBufferDMA");
765 android::base::endTrace();
766 break;
767 }
768 case OP_rcWaitSyncKHR: {
769 android::base::beginTrace("rcWaitSyncKHR decode");
770 uint64_t var_sync = Unpack<uint64_t,uint64_t>(ptr + 8);
771 EGLint var_flags = Unpack<EGLint,uint32_t>(ptr + 8 + 8);
772 if (useChecksum) {
773 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize,
774 "renderControl_decoder_context_t::decode, OP_rcWaitSyncKHR: GL checksumCalculator failure\n");
775 }
776 DECODER_DEBUG_LOG("renderControl(%p): rcWaitSyncKHR(sync:0x%016lx flags:0x%08x )", stream, var_sync, var_flags);
777 this->rcWaitSyncKHR(var_sync, var_flags);
778 SET_LASTCALL("rcWaitSyncKHR");
779 android::base::endTrace();
780 break;
781 }
782 case OP_rcCompose: {
783 android::base::beginTrace("rcCompose decode");
784 uint32_t var_bufferSize = Unpack<uint32_t,uint32_t>(ptr + 8);
785 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
786 InputBuffer inptr_buffer(ptr + 8 + 4 + 4, size_buffer);
787 if (useChecksum) {
788 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + size_buffer, ptr + 8 + 4 + 4 + size_buffer, checksumSize,
789 "renderControl_decoder_context_t::decode, OP_rcCompose: GL checksumCalculator failure\n");
790 }
791 size_t totalTmpSize = sizeof(GLint);
792 totalTmpSize += checksumSize;
793 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
794 DECODER_DEBUG_LOG("renderControl(%p): rcCompose(bufferSize:0x%08x buffer:%p(%u) )", stream, var_bufferSize, (void*)(inptr_buffer.get()), size_buffer);
795 *(GLint *)(&tmpBuf[0]) = this->rcCompose(var_bufferSize, (void*)(inptr_buffer.get()));
796 if (useChecksum) {
797 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
798 }
799 stream->flush();
800 SET_LASTCALL("rcCompose");
801 android::base::endTrace();
802 break;
803 }
804 case OP_rcCreateDisplay: {
805 android::base::beginTrace("rcCreateDisplay decode");
806 uint32_t size_displayId __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8);
807 if (useChecksum) {
808 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
809 "renderControl_decoder_context_t::decode, OP_rcCreateDisplay: GL checksumCalculator failure\n");
810 }
811 size_t totalTmpSize = size_displayId;
812 totalTmpSize += sizeof(int);
813 totalTmpSize += checksumSize;
814 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
815 OutputBuffer outptr_displayId(&tmpBuf[0], size_displayId);
816 DECODER_DEBUG_LOG("renderControl(%p): rcCreateDisplay(displayId:%p(%u) )", stream, (uint32_t*)(outptr_displayId.get()), size_displayId);
817 *(int *)(&tmpBuf[0 + size_displayId]) = this->rcCreateDisplay((uint32_t*)(outptr_displayId.get()));
818 outptr_displayId.flush();
819 if (useChecksum) {
820 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
821 }
822 stream->flush();
823 SET_LASTCALL("rcCreateDisplay");
824 android::base::endTrace();
825 break;
826 }
827 case OP_rcDestroyDisplay: {
828 android::base::beginTrace("rcDestroyDisplay decode");
829 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
830 if (useChecksum) {
831 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
832 "renderControl_decoder_context_t::decode, OP_rcDestroyDisplay: GL checksumCalculator failure\n");
833 }
834 size_t totalTmpSize = sizeof(int);
835 totalTmpSize += checksumSize;
836 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
837 DECODER_DEBUG_LOG("renderControl(%p): rcDestroyDisplay(displayId:0x%08x )", stream, var_displayId);
838 *(int *)(&tmpBuf[0]) = this->rcDestroyDisplay(var_displayId);
839 if (useChecksum) {
840 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
841 }
842 stream->flush();
843 SET_LASTCALL("rcDestroyDisplay");
844 android::base::endTrace();
845 break;
846 }
847 case OP_rcSetDisplayColorBuffer: {
848 android::base::beginTrace("rcSetDisplayColorBuffer decode");
849 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
850 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
851 if (useChecksum) {
852 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
853 "renderControl_decoder_context_t::decode, OP_rcSetDisplayColorBuffer: GL checksumCalculator failure\n");
854 }
855 size_t totalTmpSize = sizeof(int);
856 totalTmpSize += checksumSize;
857 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
858 DECODER_DEBUG_LOG("renderControl(%p): rcSetDisplayColorBuffer(displayId:0x%08x colorBuffer:0x%08x )", stream, var_displayId, var_colorBuffer);
859 *(int *)(&tmpBuf[0]) = this->rcSetDisplayColorBuffer(var_displayId, var_colorBuffer);
860 if (useChecksum) {
861 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
862 }
863 stream->flush();
864 SET_LASTCALL("rcSetDisplayColorBuffer");
865 android::base::endTrace();
866 break;
867 }
868 case OP_rcGetDisplayColorBuffer: {
869 android::base::beginTrace("rcGetDisplayColorBuffer decode");
870 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
871 uint32_t size_colorBuffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
872 if (useChecksum) {
873 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
874 "renderControl_decoder_context_t::decode, OP_rcGetDisplayColorBuffer: GL checksumCalculator failure\n");
875 }
876 size_t totalTmpSize = size_colorBuffer;
877 totalTmpSize += sizeof(int);
878 totalTmpSize += checksumSize;
879 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
880 OutputBuffer outptr_colorBuffer(&tmpBuf[0], size_colorBuffer);
881 DECODER_DEBUG_LOG("renderControl(%p): rcGetDisplayColorBuffer(displayId:0x%08x colorBuffer:%p(%u) )", stream, var_displayId, (uint32_t*)(outptr_colorBuffer.get()), size_colorBuffer);
882 *(int *)(&tmpBuf[0 + size_colorBuffer]) = this->rcGetDisplayColorBuffer(var_displayId, (uint32_t*)(outptr_colorBuffer.get()));
883 outptr_colorBuffer.flush();
884 if (useChecksum) {
885 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
886 }
887 stream->flush();
888 SET_LASTCALL("rcGetDisplayColorBuffer");
889 android::base::endTrace();
890 break;
891 }
892 case OP_rcGetColorBufferDisplay: {
893 android::base::beginTrace("rcGetColorBufferDisplay decode");
894 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
895 uint32_t size_displayId __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
896 if (useChecksum) {
897 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
898 "renderControl_decoder_context_t::decode, OP_rcGetColorBufferDisplay: GL checksumCalculator failure\n");
899 }
900 size_t totalTmpSize = size_displayId;
901 totalTmpSize += sizeof(int);
902 totalTmpSize += checksumSize;
903 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
904 OutputBuffer outptr_displayId(&tmpBuf[0], size_displayId);
905 DECODER_DEBUG_LOG("renderControl(%p): rcGetColorBufferDisplay(colorBuffer:0x%08x displayId:%p(%u) )", stream, var_colorBuffer, (uint32_t*)(outptr_displayId.get()), size_displayId);
906 *(int *)(&tmpBuf[0 + size_displayId]) = this->rcGetColorBufferDisplay(var_colorBuffer, (uint32_t*)(outptr_displayId.get()));
907 outptr_displayId.flush();
908 if (useChecksum) {
909 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
910 }
911 stream->flush();
912 SET_LASTCALL("rcGetColorBufferDisplay");
913 android::base::endTrace();
914 break;
915 }
916 case OP_rcGetDisplayPose: {
917 android::base::beginTrace("rcGetDisplayPose decode");
918 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
919 uint32_t size_x __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
920 uint32_t size_y __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
921 uint32_t size_w __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4);
922 uint32_t size_h __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
923 if (useChecksum) {
924 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4, checksumSize,
925 "renderControl_decoder_context_t::decode, OP_rcGetDisplayPose: GL checksumCalculator failure\n");
926 }
927 size_t totalTmpSize = size_x;
928 totalTmpSize += size_y;
929 totalTmpSize += size_w;
930 totalTmpSize += size_h;
931 totalTmpSize += sizeof(int);
932 totalTmpSize += checksumSize;
933 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
934 OutputBuffer outptr_x(&tmpBuf[0], size_x);
935 OutputBuffer outptr_y(&tmpBuf[0 + size_x], size_y);
936 OutputBuffer outptr_w(&tmpBuf[0 + size_x + size_y], size_w);
937 OutputBuffer outptr_h(&tmpBuf[0 + size_x + size_y + size_w], size_h);
938 DECODER_DEBUG_LOG("renderControl(%p): rcGetDisplayPose(displayId:0x%08x x:%p(%u) y:%p(%u) w:%p(%u) h:%p(%u) )", stream, var_displayId, (GLint*)(outptr_x.get()), size_x, (GLint*)(outptr_y.get()), size_y, (uint32_t*)(outptr_w.get()), size_w, (uint32_t*)(outptr_h.get()), size_h);
939 *(int *)(&tmpBuf[0 + size_x + size_y + size_w + size_h]) = this->rcGetDisplayPose(var_displayId, (GLint*)(outptr_x.get()), (GLint*)(outptr_y.get()), (uint32_t*)(outptr_w.get()), (uint32_t*)(outptr_h.get()));
940 outptr_x.flush();
941 outptr_y.flush();
942 outptr_w.flush();
943 outptr_h.flush();
944 if (useChecksum) {
945 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
946 }
947 stream->flush();
948 SET_LASTCALL("rcGetDisplayPose");
949 android::base::endTrace();
950 break;
951 }
952 case OP_rcSetDisplayPose: {
953 android::base::beginTrace("rcSetDisplayPose decode");
954 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
955 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
956 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
957 uint32_t var_w = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4);
958 uint32_t var_h = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
959 if (useChecksum) {
960 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4, checksumSize,
961 "renderControl_decoder_context_t::decode, OP_rcSetDisplayPose: GL checksumCalculator failure\n");
962 }
963 size_t totalTmpSize = sizeof(int);
964 totalTmpSize += checksumSize;
965 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
966 DECODER_DEBUG_LOG("renderControl(%p): rcSetDisplayPose(displayId:0x%08x x:0x%08x y:0x%08x w:0x%08x h:0x%08x )", stream, var_displayId, var_x, var_y, var_w, var_h);
967 *(int *)(&tmpBuf[0]) = this->rcSetDisplayPose(var_displayId, var_x, var_y, var_w, var_h);
968 if (useChecksum) {
969 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
970 }
971 stream->flush();
972 SET_LASTCALL("rcSetDisplayPose");
973 android::base::endTrace();
974 break;
975 }
976 case OP_rcSetColorBufferVulkanMode: {
977 android::base::beginTrace("rcSetColorBufferVulkanMode decode");
978 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
979 uint32_t var_mode = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
980 if (useChecksum) {
981 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
982 "renderControl_decoder_context_t::decode, OP_rcSetColorBufferVulkanMode: GL checksumCalculator failure\n");
983 }
984 size_t totalTmpSize = sizeof(GLint);
985 totalTmpSize += checksumSize;
986 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
987 DECODER_DEBUG_LOG("renderControl(%p): rcSetColorBufferVulkanMode(colorBuffer:0x%08x mode:0x%08x )", stream, var_colorBuffer, var_mode);
988 *(GLint *)(&tmpBuf[0]) = this->rcSetColorBufferVulkanMode(var_colorBuffer, var_mode);
989 if (useChecksum) {
990 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
991 }
992 stream->flush();
993 SET_LASTCALL("rcSetColorBufferVulkanMode");
994 android::base::endTrace();
995 break;
996 }
997 case OP_rcReadColorBufferYUV: {
998 android::base::beginTrace("rcReadColorBufferYUV decode");
999 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
1000 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
1001 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
1002 GLint var_width = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4);
1003 GLint var_height = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
1004 uint32_t size_pixels __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
1005 uint32_t var_pixels_size = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4);
1006 if (useChecksum) {
1007 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4, checksumSize,
1008 "renderControl_decoder_context_t::decode, OP_rcReadColorBufferYUV: GL checksumCalculator failure\n");
1009 }
1010 size_t totalTmpSize = size_pixels;
1011 totalTmpSize += checksumSize;
1012 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1013 OutputBuffer outptr_pixels(&tmpBuf[0], size_pixels);
1014 DECODER_DEBUG_LOG("renderControl(%p): rcReadColorBufferYUV(colorbuffer:0x%08x x:0x%08x y:0x%08x width:0x%08x height:0x%08x pixels:%p(%u) pixels_size:0x%08x )", stream, var_colorbuffer, var_x, var_y, var_width, var_height, (void*)(outptr_pixels.get()), size_pixels, var_pixels_size);
1015 this->rcReadColorBufferYUV(var_colorbuffer, var_x, var_y, var_width, var_height, (void*)(outptr_pixels.get()), var_pixels_size);
1016 outptr_pixels.flush();
1017 if (useChecksum) {
1018 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1019 }
1020 stream->flush();
1021 SET_LASTCALL("rcReadColorBufferYUV");
1022 android::base::endTrace();
1023 break;
1024 }
1025 case OP_rcIsSyncSignaled: {
1026 android::base::beginTrace("rcIsSyncSignaled decode");
1027 uint64_t var_sync = Unpack<uint64_t,uint64_t>(ptr + 8);
1028 if (useChecksum) {
1029 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize,
1030 "renderControl_decoder_context_t::decode, OP_rcIsSyncSignaled: GL checksumCalculator failure\n");
1031 }
1032 size_t totalTmpSize = sizeof(int);
1033 totalTmpSize += checksumSize;
1034 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1035 DECODER_DEBUG_LOG("renderControl(%p): rcIsSyncSignaled(sync:0x%016lx )", stream, var_sync);
1036 *(int *)(&tmpBuf[0]) = this->rcIsSyncSignaled(var_sync);
1037 if (useChecksum) {
1038 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1039 }
1040 stream->flush();
1041 SET_LASTCALL("rcIsSyncSignaled");
1042 android::base::endTrace();
1043 break;
1044 }
1045 case OP_rcCreateColorBufferWithHandle: {
1046 android::base::beginTrace("rcCreateColorBufferWithHandle decode");
1047 uint32_t var_width = Unpack<uint32_t,uint32_t>(ptr + 8);
1048 uint32_t var_height = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1049 GLenum var_internalFormat = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4);
1050 uint32_t var_handle = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4);
1051 if (useChecksum) {
1052 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4, checksumSize,
1053 "renderControl_decoder_context_t::decode, OP_rcCreateColorBufferWithHandle: GL checksumCalculator failure\n");
1054 }
1055 DECODER_DEBUG_LOG("renderControl(%p): rcCreateColorBufferWithHandle(width:0x%08x height:0x%08x internalFormat:0x%08x handle:0x%08x )", stream, var_width, var_height, var_internalFormat, var_handle);
1056 this->rcCreateColorBufferWithHandle(var_width, var_height, var_internalFormat, var_handle);
1057 SET_LASTCALL("rcCreateColorBufferWithHandle");
1058 android::base::endTrace();
1059 break;
1060 }
1061 case OP_rcCreateBuffer: {
1062 android::base::beginTrace("rcCreateBuffer decode");
1063 uint32_t var_size = Unpack<uint32_t,uint32_t>(ptr + 8);
1064 if (useChecksum) {
1065 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
1066 "renderControl_decoder_context_t::decode, OP_rcCreateBuffer: GL checksumCalculator failure\n");
1067 }
1068 size_t totalTmpSize = sizeof(uint32_t);
1069 totalTmpSize += checksumSize;
1070 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1071 DECODER_DEBUG_LOG("renderControl(%p): rcCreateBuffer(size:0x%08x )", stream, var_size);
1072 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateBuffer(var_size);
1073 if (useChecksum) {
1074 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1075 }
1076 stream->flush();
1077 SET_LASTCALL("rcCreateBuffer");
1078 android::base::endTrace();
1079 break;
1080 }
1081 case OP_rcCloseBuffer: {
1082 android::base::beginTrace("rcCloseBuffer decode");
1083 uint32_t var_buffer = Unpack<uint32_t,uint32_t>(ptr + 8);
1084 if (useChecksum) {
1085 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
1086 "renderControl_decoder_context_t::decode, OP_rcCloseBuffer: GL checksumCalculator failure\n");
1087 }
1088 DECODER_DEBUG_LOG("renderControl(%p): rcCloseBuffer(buffer:0x%08x )", stream, var_buffer);
1089 this->rcCloseBuffer(var_buffer);
1090 SET_LASTCALL("rcCloseBuffer");
1091 android::base::endTrace();
1092 break;
1093 }
1094 case OP_rcSetColorBufferVulkanMode2: {
1095 android::base::beginTrace("rcSetColorBufferVulkanMode2 decode");
1096 uint32_t var_colorBuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
1097 uint32_t var_mode = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1098 uint32_t var_memoryProperty = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
1099 if (useChecksum) {
1100 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
1101 "renderControl_decoder_context_t::decode, OP_rcSetColorBufferVulkanMode2: GL checksumCalculator failure\n");
1102 }
1103 size_t totalTmpSize = sizeof(GLint);
1104 totalTmpSize += checksumSize;
1105 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1106 DECODER_DEBUG_LOG("renderControl(%p): rcSetColorBufferVulkanMode2(colorBuffer:0x%08x mode:0x%08x memoryProperty:0x%08x )", stream, var_colorBuffer, var_mode, var_memoryProperty);
1107 *(GLint *)(&tmpBuf[0]) = this->rcSetColorBufferVulkanMode2(var_colorBuffer, var_mode, var_memoryProperty);
1108 if (useChecksum) {
1109 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1110 }
1111 stream->flush();
1112 SET_LASTCALL("rcSetColorBufferVulkanMode2");
1113 android::base::endTrace();
1114 break;
1115 }
1116 case OP_rcMapGpaToBufferHandle: {
1117 android::base::beginTrace("rcMapGpaToBufferHandle decode");
1118 uint32_t var_bufferHandle = Unpack<uint32_t,uint32_t>(ptr + 8);
1119 uint64_t var_gpa = Unpack<uint64_t,uint64_t>(ptr + 8 + 4);
1120 if (useChecksum) {
1121 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 8, ptr + 8 + 4 + 8, checksumSize,
1122 "renderControl_decoder_context_t::decode, OP_rcMapGpaToBufferHandle: GL checksumCalculator failure\n");
1123 }
1124 size_t totalTmpSize = sizeof(int);
1125 totalTmpSize += checksumSize;
1126 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1127 DECODER_DEBUG_LOG("renderControl(%p): rcMapGpaToBufferHandle(bufferHandle:0x%08x gpa:0x%016lx )", stream, var_bufferHandle, var_gpa);
1128 *(int *)(&tmpBuf[0]) = this->rcMapGpaToBufferHandle(var_bufferHandle, var_gpa);
1129 if (useChecksum) {
1130 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1131 }
1132 stream->flush();
1133 SET_LASTCALL("rcMapGpaToBufferHandle");
1134 android::base::endTrace();
1135 break;
1136 }
1137 case OP_rcCreateBuffer2: {
1138 android::base::beginTrace("rcCreateBuffer2 decode");
1139 uint64_t var_size = Unpack<uint64_t,uint64_t>(ptr + 8);
1140 uint32_t var_memoryProperty = Unpack<uint32_t,uint32_t>(ptr + 8 + 8);
1141 if (useChecksum) {
1142 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize,
1143 "renderControl_decoder_context_t::decode, OP_rcCreateBuffer2: GL checksumCalculator failure\n");
1144 }
1145 size_t totalTmpSize = sizeof(uint32_t);
1146 totalTmpSize += checksumSize;
1147 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1148 DECODER_DEBUG_LOG("renderControl(%p): rcCreateBuffer2(size:0x%016lx memoryProperty:0x%08x )", stream, var_size, var_memoryProperty);
1149 *(uint32_t *)(&tmpBuf[0]) = this->rcCreateBuffer2(var_size, var_memoryProperty);
1150 if (useChecksum) {
1151 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1152 }
1153 stream->flush();
1154 SET_LASTCALL("rcCreateBuffer2");
1155 android::base::endTrace();
1156 break;
1157 }
1158 case OP_rcMapGpaToBufferHandle2: {
1159 android::base::beginTrace("rcMapGpaToBufferHandle2 decode");
1160 uint32_t var_bufferHandle = Unpack<uint32_t,uint32_t>(ptr + 8);
1161 uint64_t var_gpa = Unpack<uint64_t,uint64_t>(ptr + 8 + 4);
1162 uint64_t var_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 4 + 8);
1163 if (useChecksum) {
1164 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 8 + 8, ptr + 8 + 4 + 8 + 8, checksumSize,
1165 "renderControl_decoder_context_t::decode, OP_rcMapGpaToBufferHandle2: GL checksumCalculator failure\n");
1166 }
1167 size_t totalTmpSize = sizeof(int);
1168 totalTmpSize += checksumSize;
1169 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1170 DECODER_DEBUG_LOG("renderControl(%p): rcMapGpaToBufferHandle2(bufferHandle:0x%08x gpa:0x%016lx size:0x%016lx )", stream, var_bufferHandle, var_gpa, var_size);
1171 *(int *)(&tmpBuf[0]) = this->rcMapGpaToBufferHandle2(var_bufferHandle, var_gpa, var_size);
1172 if (useChecksum) {
1173 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1174 }
1175 stream->flush();
1176 SET_LASTCALL("rcMapGpaToBufferHandle2");
1177 android::base::endTrace();
1178 break;
1179 }
1180 case OP_rcFlushWindowColorBufferAsyncWithFrameNumber: {
1181 android::base::beginTrace("rcFlushWindowColorBufferAsyncWithFrameNumber decode");
1182 uint32_t var_windowSurface = Unpack<uint32_t,uint32_t>(ptr + 8);
1183 uint32_t var_frameNumber = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1184 if (useChecksum) {
1185 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
1186 "renderControl_decoder_context_t::decode, OP_rcFlushWindowColorBufferAsyncWithFrameNumber: GL checksumCalculator failure\n");
1187 }
1188 DECODER_DEBUG_LOG("renderControl(%p): rcFlushWindowColorBufferAsyncWithFrameNumber(windowSurface:0x%08x frameNumber:0x%08x )", stream, var_windowSurface, var_frameNumber);
1189 this->rcFlushWindowColorBufferAsyncWithFrameNumber(var_windowSurface, var_frameNumber);
1190 SET_LASTCALL("rcFlushWindowColorBufferAsyncWithFrameNumber");
1191 android::base::endTrace();
1192 break;
1193 }
1194 case OP_rcSetTracingForPuid: {
1195 android::base::beginTrace("rcSetTracingForPuid decode");
1196 uint64_t var_puid = Unpack<uint64_t,uint64_t>(ptr + 8);
1197 uint32_t var_enable = Unpack<uint32_t,uint32_t>(ptr + 8 + 8);
1198 uint64_t var_guestTime = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4);
1199 if (useChecksum) {
1200 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 8, ptr + 8 + 8 + 4 + 8, checksumSize,
1201 "renderControl_decoder_context_t::decode, OP_rcSetTracingForPuid: GL checksumCalculator failure\n");
1202 }
1203 DECODER_DEBUG_LOG("renderControl(%p): rcSetTracingForPuid(puid:0x%016lx enable:0x%08x guestTime:0x%016lx )", stream, var_puid, var_enable, var_guestTime);
1204 this->rcSetTracingForPuid(var_puid, var_enable, var_guestTime);
1205 SET_LASTCALL("rcSetTracingForPuid");
1206 android::base::endTrace();
1207 break;
1208 }
1209 case OP_rcMakeCurrentAsync: {
1210 android::base::beginTrace("rcMakeCurrentAsync decode");
1211 uint32_t var_context = Unpack<uint32_t,uint32_t>(ptr + 8);
1212 uint32_t var_drawSurf = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1213 uint32_t var_readSurf = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4);
1214 if (useChecksum) {
1215 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4, checksumSize,
1216 "renderControl_decoder_context_t::decode, OP_rcMakeCurrentAsync: GL checksumCalculator failure\n");
1217 }
1218 DECODER_DEBUG_LOG("renderControl(%p): rcMakeCurrentAsync(context:0x%08x drawSurf:0x%08x readSurf:0x%08x )", stream, var_context, var_drawSurf, var_readSurf);
1219 this->rcMakeCurrentAsync(var_context, var_drawSurf, var_readSurf);
1220 SET_LASTCALL("rcMakeCurrentAsync");
1221 android::base::endTrace();
1222 break;
1223 }
1224 case OP_rcComposeAsync: {
1225 android::base::beginTrace("rcComposeAsync decode");
1226 uint32_t var_bufferSize = Unpack<uint32_t,uint32_t>(ptr + 8);
1227 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1228 InputBuffer inptr_buffer(ptr + 8 + 4 + 4, size_buffer);
1229 if (useChecksum) {
1230 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + size_buffer, ptr + 8 + 4 + 4 + size_buffer, checksumSize,
1231 "renderControl_decoder_context_t::decode, OP_rcComposeAsync: GL checksumCalculator failure\n");
1232 }
1233 DECODER_DEBUG_LOG("renderControl(%p): rcComposeAsync(bufferSize:0x%08x buffer:%p(%u) )", stream, var_bufferSize, (void*)(inptr_buffer.get()), size_buffer);
1234 this->rcComposeAsync(var_bufferSize, (void*)(inptr_buffer.get()));
1235 SET_LASTCALL("rcComposeAsync");
1236 android::base::endTrace();
1237 break;
1238 }
1239 case OP_rcDestroySyncKHRAsync: {
1240 android::base::beginTrace("rcDestroySyncKHRAsync decode");
1241 uint64_t var_sync = Unpack<uint64_t,uint64_t>(ptr + 8);
1242 if (useChecksum) {
1243 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize,
1244 "renderControl_decoder_context_t::decode, OP_rcDestroySyncKHRAsync: GL checksumCalculator failure\n");
1245 }
1246 DECODER_DEBUG_LOG("renderControl(%p): rcDestroySyncKHRAsync(sync:0x%016lx )", stream, var_sync);
1247 this->rcDestroySyncKHRAsync(var_sync);
1248 SET_LASTCALL("rcDestroySyncKHRAsync");
1249 android::base::endTrace();
1250 break;
1251 }
1252 case OP_rcComposeWithoutPost: {
1253 android::base::beginTrace("rcComposeWithoutPost decode");
1254 uint32_t var_bufferSize = Unpack<uint32_t,uint32_t>(ptr + 8);
1255 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1256 InputBuffer inptr_buffer(ptr + 8 + 4 + 4, size_buffer);
1257 if (useChecksum) {
1258 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + size_buffer, ptr + 8 + 4 + 4 + size_buffer, checksumSize,
1259 "renderControl_decoder_context_t::decode, OP_rcComposeWithoutPost: GL checksumCalculator failure\n");
1260 }
1261 size_t totalTmpSize = sizeof(GLint);
1262 totalTmpSize += checksumSize;
1263 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1264 DECODER_DEBUG_LOG("renderControl(%p): rcComposeWithoutPost(bufferSize:0x%08x buffer:%p(%u) )", stream, var_bufferSize, (void*)(inptr_buffer.get()), size_buffer);
1265 *(GLint *)(&tmpBuf[0]) = this->rcComposeWithoutPost(var_bufferSize, (void*)(inptr_buffer.get()));
1266 if (useChecksum) {
1267 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1268 }
1269 stream->flush();
1270 SET_LASTCALL("rcComposeWithoutPost");
1271 android::base::endTrace();
1272 break;
1273 }
1274 case OP_rcComposeAsyncWithoutPost: {
1275 android::base::beginTrace("rcComposeAsyncWithoutPost decode");
1276 uint32_t var_bufferSize = Unpack<uint32_t,uint32_t>(ptr + 8);
1277 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1278 InputBuffer inptr_buffer(ptr + 8 + 4 + 4, size_buffer);
1279 if (useChecksum) {
1280 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + size_buffer, ptr + 8 + 4 + 4 + size_buffer, checksumSize,
1281 "renderControl_decoder_context_t::decode, OP_rcComposeAsyncWithoutPost: GL checksumCalculator failure\n");
1282 }
1283 DECODER_DEBUG_LOG("renderControl(%p): rcComposeAsyncWithoutPost(bufferSize:0x%08x buffer:%p(%u) )", stream, var_bufferSize, (void*)(inptr_buffer.get()), size_buffer);
1284 this->rcComposeAsyncWithoutPost(var_bufferSize, (void*)(inptr_buffer.get()));
1285 SET_LASTCALL("rcComposeAsyncWithoutPost");
1286 android::base::endTrace();
1287 break;
1288 }
1289 case OP_rcCreateDisplayById: {
1290 android::base::beginTrace("rcCreateDisplayById decode");
1291 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
1292 if (useChecksum) {
1293 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize,
1294 "renderControl_decoder_context_t::decode, OP_rcCreateDisplayById: GL checksumCalculator failure\n");
1295 }
1296 size_t totalTmpSize = sizeof(int);
1297 totalTmpSize += checksumSize;
1298 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1299 DECODER_DEBUG_LOG("renderControl(%p): rcCreateDisplayById(displayId:0x%08x )", stream, var_displayId);
1300 *(int *)(&tmpBuf[0]) = this->rcCreateDisplayById(var_displayId);
1301 if (useChecksum) {
1302 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1303 }
1304 stream->flush();
1305 SET_LASTCALL("rcCreateDisplayById");
1306 android::base::endTrace();
1307 break;
1308 }
1309 case OP_rcSetDisplayPoseDpi: {
1310 android::base::beginTrace("rcSetDisplayPoseDpi decode");
1311 uint32_t var_displayId = Unpack<uint32_t,uint32_t>(ptr + 8);
1312 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
1313 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
1314 uint32_t var_w = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4);
1315 uint32_t var_h = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
1316 uint32_t var_dpi = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
1317 if (useChecksum) {
1318 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4, checksumSize,
1319 "renderControl_decoder_context_t::decode, OP_rcSetDisplayPoseDpi: GL checksumCalculator failure\n");
1320 }
1321 size_t totalTmpSize = sizeof(int);
1322 totalTmpSize += checksumSize;
1323 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1324 DECODER_DEBUG_LOG("renderControl(%p): rcSetDisplayPoseDpi(displayId:0x%08x x:0x%08x y:0x%08x w:0x%08x h:0x%08x dpi:0x%08x )", stream, var_displayId, var_x, var_y, var_w, var_h, var_dpi);
1325 *(int *)(&tmpBuf[0]) = this->rcSetDisplayPoseDpi(var_displayId, var_x, var_y, var_w, var_h, var_dpi);
1326 if (useChecksum) {
1327 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1328 }
1329 stream->flush();
1330 SET_LASTCALL("rcSetDisplayPoseDpi");
1331 android::base::endTrace();
1332 break;
1333 }
1334 case OP_rcReadColorBufferDMA: {
1335 android::base::beginTrace("rcReadColorBufferDMA decode");
1336 uint32_t var_colorbuffer = Unpack<uint32_t,uint32_t>(ptr + 8);
1337 GLint var_x = Unpack<GLint,uint32_t>(ptr + 8 + 4);
1338 GLint var_y = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4);
1339 GLint var_width = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4);
1340 GLint var_height = Unpack<GLint,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4);
1341 GLenum var_format = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4);
1342 GLenum var_type = Unpack<GLenum,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4);
1343 uint64_t var_pixels_guest_paddr = Unpack<uint64_t,uint64_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
1344 void* var_pixels = stream->getDmaForReading(var_pixels_guest_paddr);
1345 uint32_t size_pixels __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8);
1346 uint32_t var_pixels_size = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8);
1347 if (useChecksum) {
1348 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4, ptr + 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 8 + 4, checksumSize,
1349 "renderControl_decoder_context_t::decode, OP_rcReadColorBufferDMA: GL checksumCalculator failure\n");
1350 }
1351 size_t totalTmpSize = sizeof(int);
1352 totalTmpSize += checksumSize;
1353 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1354 DECODER_DEBUG_LOG("renderControl(%p): rcReadColorBufferDMA(colorbuffer:0x%08x x:0x%08x y:0x%08x width:0x%08x height:0x%08x format:0x%08x type:0x%08x pixels:%p(%u) pixels_size:0x%08x )", stream, var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, var_pixels, var_pixels_size);
1355 *(int *)(&tmpBuf[0]) = this->rcReadColorBufferDMA(var_colorbuffer, var_x, var_y, var_width, var_height, var_format, var_type, var_pixels, var_pixels_size);
1356 stream->unlockDma(var_pixels_guest_paddr);
1357 if (useChecksum) {
1358 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1359 }
1360 stream->flush();
1361 SET_LASTCALL("rcReadColorBufferDMA");
1362 android::base::endTrace();
1363 break;
1364 }
1365 case OP_rcGetFBDisplayConfigsCount: {
1366 android::base::beginTrace("rcGetFBDisplayConfigsCount decode");
1367 if (useChecksum) {
1368 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8, ptr + 8, checksumSize,
1369 "renderControl_decoder_context_t::decode, OP_rcGetFBDisplayConfigsCount: GL checksumCalculator failure\n");
1370 }
1371 size_t totalTmpSize = sizeof(int);
1372 totalTmpSize += checksumSize;
1373 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1374 DECODER_DEBUG_LOG("renderControl(%p): rcGetFBDisplayConfigsCount()", stream);
1375 *(int *)(&tmpBuf[0]) = this->rcGetFBDisplayConfigsCount();
1376 if (useChecksum) {
1377 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1378 }
1379 stream->flush();
1380 SET_LASTCALL("rcGetFBDisplayConfigsCount");
1381 android::base::endTrace();
1382 break;
1383 }
1384 case OP_rcGetFBDisplayConfigsParam: {
1385 android::base::beginTrace("rcGetFBDisplayConfigsParam decode");
1386 int var_configId = Unpack<int,uint32_t>(ptr + 8);
1387 EGLint var_param = Unpack<EGLint,uint32_t>(ptr + 8 + 4);
1388 if (useChecksum) {
1389 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
1390 "renderControl_decoder_context_t::decode, OP_rcGetFBDisplayConfigsParam: GL checksumCalculator failure\n");
1391 }
1392 size_t totalTmpSize = sizeof(int);
1393 totalTmpSize += checksumSize;
1394 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1395 DECODER_DEBUG_LOG("renderControl(%p): rcGetFBDisplayConfigsParam(configId:%d param:0x%08x )", stream, var_configId, var_param);
1396 *(int *)(&tmpBuf[0]) = this->rcGetFBDisplayConfigsParam(var_configId, var_param);
1397 if (useChecksum) {
1398 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1399 }
1400 stream->flush();
1401 SET_LASTCALL("rcGetFBDisplayConfigsParam");
1402 android::base::endTrace();
1403 break;
1404 }
1405 case OP_rcGetFBDisplayActiveConfig: {
1406 android::base::beginTrace("rcGetFBDisplayActiveConfig decode");
1407 if (useChecksum) {
1408 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8, ptr + 8, checksumSize,
1409 "renderControl_decoder_context_t::decode, OP_rcGetFBDisplayActiveConfig: GL checksumCalculator failure\n");
1410 }
1411 size_t totalTmpSize = sizeof(int);
1412 totalTmpSize += checksumSize;
1413 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1414 DECODER_DEBUG_LOG("renderControl(%p): rcGetFBDisplayActiveConfig()", stream);
1415 *(int *)(&tmpBuf[0]) = this->rcGetFBDisplayActiveConfig();
1416 if (useChecksum) {
1417 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1418 }
1419 stream->flush();
1420 SET_LASTCALL("rcGetFBDisplayActiveConfig");
1421 android::base::endTrace();
1422 break;
1423 }
1424 case OP_rcSetProcessMetadata: {
1425 android::base::beginTrace("rcSetProcessMetadata decode");
1426 uint32_t size_key __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8);
1427 InputBuffer inptr_key(ptr + 8 + 4, size_key);
1428 uint32_t size_valuePtr __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_key);
1429 InputBuffer inptr_valuePtr(ptr + 8 + 4 + size_key + 4, size_valuePtr);
1430 uint32_t var_valueSize = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_key + 4 + size_valuePtr);
1431 if (useChecksum) {
1432 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + size_key + 4 + size_valuePtr + 4, ptr + 8 + 4 + size_key + 4 + size_valuePtr + 4, checksumSize,
1433 "renderControl_decoder_context_t::decode, OP_rcSetProcessMetadata: GL checksumCalculator failure\n");
1434 }
1435 DECODER_DEBUG_LOG("renderControl(%p): rcSetProcessMetadata(key:%p(%u) valuePtr:%p(%u) valueSize:0x%08x )", stream, (char*)(inptr_key.get()), size_key, (RenderControlByte*)(inptr_valuePtr.get()), size_valuePtr, var_valueSize);
1436 this->rcSetProcessMetadata((char*)(inptr_key.get()), (RenderControlByte*)(inptr_valuePtr.get()), var_valueSize);
1437 SET_LASTCALL("rcSetProcessMetadata");
1438 android::base::endTrace();
1439 break;
1440 }
1441 case OP_rcGetHostExtensionsString: {
1442 android::base::beginTrace("rcGetHostExtensionsString decode");
1443 uint32_t var_bufferSize = Unpack<uint32_t,uint32_t>(ptr + 8);
1444 uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4);
1445 if (useChecksum) {
1446 ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize,
1447 "renderControl_decoder_context_t::decode, OP_rcGetHostExtensionsString: GL checksumCalculator failure\n");
1448 }
1449 size_t totalTmpSize = size_buffer;
1450 totalTmpSize += sizeof(int);
1451 totalTmpSize += checksumSize;
1452 unsigned char *tmpBuf = stream->alloc(totalTmpSize);
1453 OutputBuffer outptr_buffer(&tmpBuf[0], size_buffer);
1454 DECODER_DEBUG_LOG("renderControl(%p): rcGetHostExtensionsString(bufferSize:0x%08x buffer:%p(%u) )", stream, var_bufferSize, (void*)(outptr_buffer.get()), size_buffer);
1455 *(int *)(&tmpBuf[0 + size_buffer]) = this->rcGetHostExtensionsString(var_bufferSize, (void*)(outptr_buffer.get()));
1456 outptr_buffer.flush();
1457 if (useChecksum) {
1458 ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize);
1459 }
1460 stream->flush();
1461 SET_LASTCALL("rcGetHostExtensionsString");
1462 android::base::endTrace();
1463 break;
1464 }
1465 default:
1466 return ptr - (unsigned char*)buf;
1467 } //switch
1468 ptr += packetLen;
1469 } // while
1470 return ptr - (unsigned char*)buf;
1471 }
1472 } // namespace gfxstream
1473
1474