| // Generated Code - DO NOT EDIT !! |
| // generated by 'emugen' |
| |
| |
| #include <string.h> |
| #include "magma_opcodes.h" |
| |
| #include "magma_dec.h" |
| |
| |
| #include "ProtocolUtils.h" |
| |
| #include "ChecksumCalculatorThreadInfo.h" |
| |
| #include "host-common/logging.h" |
| |
| #include <stdio.h> |
| |
| namespace gfxstream { |
| |
| 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. |
| |
| #ifdef CHECK_GL_ERRORS |
| # define SET_LASTCALL(name) sprintf(lastCall, #name) |
| #else |
| # define SET_LASTCALL(name) |
| #endif |
| size_t magma_decoder_context_t::decode(void *buf, size_t len, IOStream *stream, ChecksumCalculator* checksumCalc) { |
| if (len < 8) return 0; |
| #ifdef CHECK_GL_ERRORS |
| char lastCall[256] = {0}; |
| #endif |
| unsigned char *ptr = (unsigned char *)buf; |
| const unsigned char* const end = (const unsigned char*)buf + len; |
| const size_t checksumSize = checksumCalc->checksumByteSize(); |
| const bool useChecksum = checksumSize > 0; |
| while (end - ptr >= 8) { |
| uint32_t opcode = *(uint32_t *)ptr; |
| uint32_t packetLen = *(uint32_t *)(ptr + 4); |
| if (end - ptr < packetLen) return ptr - (unsigned char*)buf; |
| switch(opcode) { |
| case OP_magma_device_import: { |
| android::base::beginTrace("magma_device_import decode"); |
| magma_handle_t var_device_channel = Unpack<magma_handle_t,uint32_t>(ptr + 8); |
| uint32_t size_device_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + 4, ptr + 8 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_device_import: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_device_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_device_out(&tmpBuf[0], size_device_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_device_import(device_channel:%u device_out:%p(%u) )", stream, var_device_channel, (magma_device_t*)(outptr_device_out.get()), size_device_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_device_out]) = this->magma_device_import(var_device_channel, (magma_device_t*)(outptr_device_out.get())); |
| outptr_device_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_device_import"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_device_release: { |
| android::base::beginTrace("magma_device_release decode"); |
| magma_device_t var_device = Unpack<magma_device_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_device_release: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_device_release(device:%lu )", stream, var_device); |
| this->magma_device_release(var_device); |
| SET_LASTCALL("magma_device_release"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_device_query: { |
| android::base::beginTrace("magma_device_query decode"); |
| magma_device_t var_device = Unpack<magma_device_t,uint64_t>(ptr + 8); |
| uint64_t var_id = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| uint32_t size_result_buffer_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| uint32_t size_result_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4 + 4, ptr + 8 + 8 + 8 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_device_query: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_result_buffer_out; |
| totalTmpSize += size_result_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_result_buffer_out(&tmpBuf[0], size_result_buffer_out); |
| OutputBuffer outptr_result_out(&tmpBuf[0 + size_result_buffer_out], size_result_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_device_query(device:%lu id:%lu result_buffer_out:%p(%u) result_out:%p(%u) )", stream, var_device, var_id, (magma_handle_t*)(outptr_result_buffer_out.get()), size_result_buffer_out, (uint64_t*)(outptr_result_out.get()), size_result_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_result_buffer_out + size_result_out]) = this->magma_device_query(var_device, var_id, (magma_handle_t*)(outptr_result_buffer_out.get()), (uint64_t*)(outptr_result_out.get())); |
| outptr_result_buffer_out.flush(); |
| outptr_result_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_device_query"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_device_query_fudge: { |
| android::base::beginTrace("magma_device_query_fudge decode"); |
| magma_device_t var_device = Unpack<magma_device_t,uint64_t>(ptr + 8); |
| uint64_t var_id = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| magma_bool_t var_host_allocate = Unpack<magma_bool_t,uint8_t>(ptr + 8 + 8 + 8); |
| uint32_t size_result_buffer_mapping_id_inout __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 1); |
| InputBuffer inptr_result_buffer_mapping_id_inout(ptr + 8 + 8 + 8 + 1 + 4, size_result_buffer_mapping_id_inout); |
| uint32_t size_result_buffer_size_inout __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 1 + 4 + size_result_buffer_mapping_id_inout); |
| InputBuffer inptr_result_buffer_size_inout(ptr + 8 + 8 + 8 + 1 + 4 + size_result_buffer_mapping_id_inout + 4, size_result_buffer_size_inout); |
| uint32_t size_result_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 1 + 4 + size_result_buffer_mapping_id_inout + 4 + size_result_buffer_size_inout); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 1 + 4 + size_result_buffer_mapping_id_inout + 4 + size_result_buffer_size_inout + 4, ptr + 8 + 8 + 8 + 1 + 4 + size_result_buffer_mapping_id_inout + 4 + size_result_buffer_size_inout + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_device_query_fudge: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_result_buffer_mapping_id_inout; |
| totalTmpSize += size_result_buffer_size_inout; |
| totalTmpSize += size_result_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_result_buffer_mapping_id_inout(&tmpBuf[0], size_result_buffer_mapping_id_inout); |
| memcpy(outptr_result_buffer_mapping_id_inout.get(), inptr_result_buffer_mapping_id_inout.get(), size_result_buffer_mapping_id_inout); |
| OutputBuffer outptr_result_buffer_size_inout(&tmpBuf[0 + size_result_buffer_mapping_id_inout], size_result_buffer_size_inout); |
| memcpy(outptr_result_buffer_size_inout.get(), inptr_result_buffer_size_inout.get(), size_result_buffer_size_inout); |
| OutputBuffer outptr_result_out(&tmpBuf[0 + size_result_buffer_mapping_id_inout + size_result_buffer_size_inout], size_result_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_device_query_fudge(device:%lu id:%lu host_allocate:%hhu result_buffer_mapping_id_inout:%p(%u) result_buffer_size_inout:%p(%u) result_out:%p(%u) )", stream, var_device, var_id, var_host_allocate, (uint64_t*)(outptr_result_buffer_mapping_id_inout.get()), size_result_buffer_mapping_id_inout, (uint64_t*)(outptr_result_buffer_size_inout.get()), size_result_buffer_size_inout, (uint64_t*)(outptr_result_out.get()), size_result_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_result_buffer_mapping_id_inout + size_result_buffer_size_inout + size_result_out]) = this->magma_device_query_fudge(var_device, var_id, var_host_allocate, (uint64_t*)(outptr_result_buffer_mapping_id_inout.get()), (uint64_t*)(outptr_result_buffer_size_inout.get()), (uint64_t*)(outptr_result_out.get())); |
| outptr_result_buffer_mapping_id_inout.flush(); |
| outptr_result_buffer_size_inout.flush(); |
| outptr_result_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_device_query_fudge"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_device_create_connection: { |
| android::base::beginTrace("magma_device_create_connection decode"); |
| magma_device_t var_device = Unpack<magma_device_t,uint64_t>(ptr + 8); |
| uint32_t size_connection_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_device_create_connection: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_connection_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_connection_out(&tmpBuf[0], size_connection_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_device_create_connection(device:%lu connection_out:%p(%u) )", stream, var_device, (magma_connection_t*)(outptr_connection_out.get()), size_connection_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_connection_out]) = this->magma_device_create_connection(var_device, (magma_connection_t*)(outptr_connection_out.get())); |
| outptr_connection_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_device_create_connection"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_release: { |
| android::base::beginTrace("magma_connection_release decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_release: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_release(connection:%lu )", stream, var_connection); |
| this->magma_connection_release(var_connection); |
| SET_LASTCALL("magma_connection_release"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_get_error: { |
| android::base::beginTrace("magma_connection_get_error decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_get_error: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_get_error(connection:%lu )", stream, var_connection); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_get_error(var_connection); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_get_error"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_create_context: { |
| android::base::beginTrace("magma_connection_create_context decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_context_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_create_context: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_context_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_context_id_out(&tmpBuf[0], size_context_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_create_context(connection:%lu context_id_out:%p(%u) )", stream, var_connection, (uint32_t*)(outptr_context_id_out.get()), size_context_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_context_id_out]) = this->magma_connection_create_context(var_connection, (uint32_t*)(outptr_context_id_out.get())); |
| outptr_context_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_create_context"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_release_context: { |
| android::base::beginTrace("magma_connection_release_context decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t var_context_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_release_context: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_release_context(connection:%lu context_id:%u )", stream, var_connection, var_context_id); |
| this->magma_connection_release_context(var_connection, var_context_id); |
| SET_LASTCALL("magma_connection_release_context"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_create_buffer: { |
| android::base::beginTrace("magma_connection_create_buffer decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint64_t var_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| uint32_t size_size_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| uint32_t size_buffer_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4); |
| uint32_t size_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4 + 4 + 4, ptr + 8 + 8 + 8 + 4 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_create_buffer: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_size_out; |
| totalTmpSize += size_buffer_out; |
| totalTmpSize += size_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_size_out(&tmpBuf[0], size_size_out); |
| OutputBuffer outptr_buffer_out(&tmpBuf[0 + size_size_out], size_buffer_out); |
| OutputBuffer outptr_id_out(&tmpBuf[0 + size_size_out + size_buffer_out], size_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_create_buffer(connection:%lu size:%lu size_out:%p(%u) buffer_out:%p(%u) id_out:%p(%u) )", stream, var_connection, var_size, (uint64_t*)(outptr_size_out.get()), size_size_out, (magma_buffer_t*)(outptr_buffer_out.get()), size_buffer_out, (magma_buffer_id_t*)(outptr_id_out.get()), size_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_size_out + size_buffer_out + size_id_out]) = this->magma_connection_create_buffer(var_connection, var_size, (uint64_t*)(outptr_size_out.get()), (magma_buffer_t*)(outptr_buffer_out.get()), (magma_buffer_id_t*)(outptr_id_out.get())); |
| outptr_size_out.flush(); |
| outptr_buffer_out.flush(); |
| outptr_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_create_buffer"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_release_buffer: { |
| android::base::beginTrace("magma_connection_release_buffer decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8, ptr + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_release_buffer: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_release_buffer(connection:%lu buffer:%lu )", stream, var_connection, var_buffer); |
| this->magma_connection_release_buffer(var_connection, var_buffer); |
| SET_LASTCALL("magma_connection_release_buffer"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_import_buffer: { |
| android::base::beginTrace("magma_connection_import_buffer decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_handle_t var_buffer_handle = Unpack<magma_handle_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_size_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| uint32_t size_buffer_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 4); |
| uint32_t size_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 4 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4 + 4 + 4, ptr + 8 + 8 + 4 + 4 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_import_buffer: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_size_out; |
| totalTmpSize += size_buffer_out; |
| totalTmpSize += size_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_size_out(&tmpBuf[0], size_size_out); |
| OutputBuffer outptr_buffer_out(&tmpBuf[0 + size_size_out], size_buffer_out); |
| OutputBuffer outptr_id_out(&tmpBuf[0 + size_size_out + size_buffer_out], size_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_import_buffer(connection:%lu buffer_handle:%u size_out:%p(%u) buffer_out:%p(%u) id_out:%p(%u) )", stream, var_connection, var_buffer_handle, (uint64_t*)(outptr_size_out.get()), size_size_out, (magma_buffer_t*)(outptr_buffer_out.get()), size_buffer_out, (magma_buffer_id_t*)(outptr_id_out.get()), size_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_size_out + size_buffer_out + size_id_out]) = this->magma_connection_import_buffer(var_connection, var_buffer_handle, (uint64_t*)(outptr_size_out.get()), (magma_buffer_t*)(outptr_buffer_out.get()), (magma_buffer_id_t*)(outptr_id_out.get())); |
| outptr_size_out.flush(); |
| outptr_buffer_out.flush(); |
| outptr_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_import_buffer"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_create_semaphore: { |
| android::base::beginTrace("magma_connection_create_semaphore decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_semaphore_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4, ptr + 8 + 8 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_create_semaphore: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_semaphore_out; |
| totalTmpSize += size_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_semaphore_out(&tmpBuf[0], size_semaphore_out); |
| OutputBuffer outptr_id_out(&tmpBuf[0 + size_semaphore_out], size_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_create_semaphore(connection:%lu semaphore_out:%p(%u) id_out:%p(%u) )", stream, var_connection, (magma_semaphore_t*)(outptr_semaphore_out.get()), size_semaphore_out, (magma_semaphore_id_t*)(outptr_id_out.get()), size_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_semaphore_out + size_id_out]) = this->magma_connection_create_semaphore(var_connection, (magma_semaphore_t*)(outptr_semaphore_out.get()), (magma_semaphore_id_t*)(outptr_id_out.get())); |
| outptr_semaphore_out.flush(); |
| outptr_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_create_semaphore"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_release_semaphore: { |
| android::base::beginTrace("magma_connection_release_semaphore decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_semaphore_t var_semaphore = Unpack<magma_semaphore_t,uint64_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8, ptr + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_release_semaphore: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_release_semaphore(connection:%lu semaphore:%lu )", stream, var_connection, var_semaphore); |
| this->magma_connection_release_semaphore(var_connection, var_semaphore); |
| SET_LASTCALL("magma_connection_release_semaphore"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_import_semaphore: { |
| android::base::beginTrace("magma_connection_import_semaphore decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_handle_t var_semaphore_handle = Unpack<magma_handle_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_semaphore_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| uint32_t size_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4 + 4, ptr + 8 + 8 + 4 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_import_semaphore: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_semaphore_out; |
| totalTmpSize += size_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_semaphore_out(&tmpBuf[0], size_semaphore_out); |
| OutputBuffer outptr_id_out(&tmpBuf[0 + size_semaphore_out], size_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_import_semaphore(connection:%lu semaphore_handle:%u semaphore_out:%p(%u) id_out:%p(%u) )", stream, var_connection, var_semaphore_handle, (magma_semaphore_t*)(outptr_semaphore_out.get()), size_semaphore_out, (magma_semaphore_id_t*)(outptr_id_out.get()), size_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_semaphore_out + size_id_out]) = this->magma_connection_import_semaphore(var_connection, var_semaphore_handle, (magma_semaphore_t*)(outptr_semaphore_out.get()), (magma_semaphore_id_t*)(outptr_id_out.get())); |
| outptr_semaphore_out.flush(); |
| outptr_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_import_semaphore"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_perform_buffer_op: { |
| android::base::beginTrace("magma_connection_perform_buffer_op decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8); |
| uint32_t var_options = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| uint64_t var_start_offset = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 4); |
| uint64_t var_length = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 4 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4 + 8 + 8, ptr + 8 + 8 + 8 + 4 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_perform_buffer_op: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_perform_buffer_op(connection:%lu buffer:%lu options:%u start_offset:%lu length:%lu )", stream, var_connection, var_buffer, var_options, var_start_offset, var_length); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_perform_buffer_op(var_connection, var_buffer, var_options, var_start_offset, var_length); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_perform_buffer_op"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_map_buffer: { |
| android::base::beginTrace("magma_connection_map_buffer decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint64_t var_hw_va = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8 + 8); |
| uint64_t var_offset = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 8); |
| uint64_t var_length = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 8 + 8); |
| uint64_t var_map_flags = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 8 + 8 + 8 + 8, ptr + 8 + 8 + 8 + 8 + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_map_buffer: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_map_buffer(connection:%lu hw_va:%lu buffer:%lu offset:%lu length:%lu map_flags:%lu )", stream, var_connection, var_hw_va, var_buffer, var_offset, var_length, var_map_flags); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_map_buffer(var_connection, var_hw_va, var_buffer, var_offset, var_length, var_map_flags); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_map_buffer"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_unmap_buffer: { |
| android::base::beginTrace("magma_connection_unmap_buffer decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint64_t var_hw_va = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 8, ptr + 8 + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_unmap_buffer: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_unmap_buffer(connection:%lu hw_va:%lu buffer:%lu )", stream, var_connection, var_hw_va, var_buffer); |
| this->magma_connection_unmap_buffer(var_connection, var_hw_va, var_buffer); |
| SET_LASTCALL("magma_connection_unmap_buffer"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_execute_command: { |
| android::base::beginTrace("magma_connection_execute_command decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t var_context_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_descriptor __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| InputBuffer inptr_descriptor(ptr + 8 + 8 + 4 + 4, size_descriptor); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4 + size_descriptor, ptr + 8 + 8 + 4 + 4 + size_descriptor, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_execute_command: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_execute_command(connection:%lu context_id:%u descriptor:%p(%u) )", stream, var_connection, var_context_id, (magma_command_descriptor_t*)(inptr_descriptor.get()), size_descriptor); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_execute_command(var_connection, var_context_id, (magma_command_descriptor_t*)(inptr_descriptor.get())); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_execute_command"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_execute_command_fudge: { |
| android::base::beginTrace("magma_connection_execute_command_fudge decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t var_context_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_descriptor __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| InputBuffer inptr_descriptor(ptr + 8 + 8 + 4 + 4, size_descriptor); |
| uint64_t var_descriptor_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4 + 4 + size_descriptor); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4 + size_descriptor + 8, ptr + 8 + 8 + 4 + 4 + size_descriptor + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_execute_command_fudge: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_execute_command_fudge(connection:%lu context_id:%u descriptor:%p(%u) descriptor_size:%lu )", stream, var_connection, var_context_id, (void*)(inptr_descriptor.get()), size_descriptor, var_descriptor_size); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_execute_command_fudge(var_connection, var_context_id, (void*)(inptr_descriptor.get()), var_descriptor_size); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_execute_command_fudge"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_execute_immediate_commands: { |
| android::base::beginTrace("magma_connection_execute_immediate_commands decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t var_context_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint64_t var_command_count = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4); |
| uint32_t size_command_buffers __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 8); |
| InputBuffer inptr_command_buffers(ptr + 8 + 8 + 4 + 8 + 4, size_command_buffers); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 8 + 4 + size_command_buffers, ptr + 8 + 8 + 4 + 8 + 4 + size_command_buffers, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_execute_immediate_commands: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_execute_immediate_commands(connection:%lu context_id:%u command_count:%lu command_buffers:%p(%u) )", stream, var_connection, var_context_id, var_command_count, (magma_inline_command_buffer_t*)(inptr_command_buffers.get()), size_command_buffers); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_execute_immediate_commands(var_connection, var_context_id, var_command_count, (magma_inline_command_buffer_t*)(inptr_command_buffers.get())); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_execute_immediate_commands"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_execute_immediate_commands_fudge: { |
| android::base::beginTrace("magma_connection_execute_immediate_commands_fudge decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t var_context_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint64_t var_command_count = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4); |
| uint32_t size_command_buffers __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 8); |
| InputBuffer inptr_command_buffers(ptr + 8 + 8 + 4 + 8 + 4, size_command_buffers); |
| uint64_t var_command_buffers_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4 + 8 + 4 + size_command_buffers); |
| uint32_t size_command_buffer_offsets __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 8 + 4 + size_command_buffers + 8); |
| InputBuffer inptr_command_buffer_offsets(ptr + 8 + 8 + 4 + 8 + 4 + size_command_buffers + 8 + 4, size_command_buffer_offsets); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 8 + 4 + size_command_buffers + 8 + 4 + size_command_buffer_offsets, ptr + 8 + 8 + 4 + 8 + 4 + size_command_buffers + 8 + 4 + size_command_buffer_offsets, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_execute_immediate_commands_fudge: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_execute_immediate_commands_fudge(connection:%lu context_id:%u command_count:%lu command_buffers:%p(%u) command_buffers_size:%lu command_buffer_offsets:%p(%u) )", stream, var_connection, var_context_id, var_command_count, (void*)(inptr_command_buffers.get()), size_command_buffers, var_command_buffers_size, (uint64_t*)(inptr_command_buffer_offsets.get()), size_command_buffer_offsets); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_execute_immediate_commands_fudge(var_connection, var_context_id, var_command_count, (void*)(inptr_command_buffers.get()), var_command_buffers_size, (uint64_t*)(inptr_command_buffer_offsets.get())); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_execute_immediate_commands_fudge"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_flush: { |
| android::base::beginTrace("magma_connection_flush decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_flush: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_flush(connection:%lu )", stream, var_connection); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_flush(var_connection); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_flush"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_get_notification_channel_handle: { |
| android::base::beginTrace("magma_connection_get_notification_channel_handle decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_get_notification_channel_handle: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_handle_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_get_notification_channel_handle(connection:%lu )", stream, var_connection); |
| *(magma_handle_t *)(&tmpBuf[0]) = this->magma_connection_get_notification_channel_handle(var_connection); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_get_notification_channel_handle"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_read_notification_channel: { |
| android::base::beginTrace("magma_connection_read_notification_channel decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_buffer __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint64_t var_buffer_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4); |
| uint32_t size_buffer_size_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 8); |
| uint32_t size_more_data_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + 8 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 8 + 4 + 4, ptr + 8 + 8 + 4 + 8 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_read_notification_channel: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_buffer; |
| totalTmpSize += size_buffer_size_out; |
| totalTmpSize += size_more_data_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_buffer(&tmpBuf[0], size_buffer); |
| OutputBuffer outptr_buffer_size_out(&tmpBuf[0 + size_buffer], size_buffer_size_out); |
| OutputBuffer outptr_more_data_out(&tmpBuf[0 + size_buffer + size_buffer_size_out], size_more_data_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_read_notification_channel(connection:%lu buffer:%p(%u) buffer_size:%lu buffer_size_out:%p(%u) more_data_out:%p(%u) )", stream, var_connection, (void*)(outptr_buffer.get()), size_buffer, var_buffer_size, (uint64_t*)(outptr_buffer_size_out.get()), size_buffer_size_out, (magma_bool_t*)(outptr_more_data_out.get()), size_more_data_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_buffer + size_buffer_size_out + size_more_data_out]) = this->magma_connection_read_notification_channel(var_connection, (void*)(outptr_buffer.get()), var_buffer_size, (uint64_t*)(outptr_buffer_size_out.get()), (magma_bool_t*)(outptr_more_data_out.get())); |
| outptr_buffer.flush(); |
| outptr_buffer_size_out.flush(); |
| outptr_more_data_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_read_notification_channel"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_clean_cache: { |
| android::base::beginTrace("magma_buffer_clean_cache decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint64_t var_offset = Unpack<uint64_t,uint64_t>(ptr + 8 + 8); |
| uint64_t var_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8); |
| magma_cache_operation_t var_operation = Unpack<magma_cache_operation_t,uint32_t>(ptr + 8 + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 8 + 4, ptr + 8 + 8 + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_clean_cache: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_clean_cache(buffer:%lu offset:%lu size:%lu operation:%u )", stream, var_buffer, var_offset, var_size, var_operation); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_buffer_clean_cache(var_buffer, var_offset, var_size, var_operation); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_clean_cache"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_set_cache_policy: { |
| android::base::beginTrace("magma_buffer_set_cache_policy decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| magma_cache_policy_t var_policy = Unpack<magma_cache_policy_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_set_cache_policy: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_set_cache_policy(buffer:%lu policy:%u )", stream, var_buffer, var_policy); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_buffer_set_cache_policy(var_buffer, var_policy); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_set_cache_policy"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_get_cache_policy: { |
| android::base::beginTrace("magma_buffer_get_cache_policy decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_cache_policy_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_get_cache_policy: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_cache_policy_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_cache_policy_out(&tmpBuf[0], size_cache_policy_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_get_cache_policy(buffer:%lu cache_policy_out:%p(%u) )", stream, var_buffer, (magma_cache_policy_t*)(outptr_cache_policy_out.get()), size_cache_policy_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_cache_policy_out]) = this->magma_buffer_get_cache_policy(var_buffer, (magma_cache_policy_t*)(outptr_cache_policy_out.get())); |
| outptr_cache_policy_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_get_cache_policy"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_set_name: { |
| android::base::beginTrace("magma_buffer_set_name decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_name __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| InputBuffer inptr_name(ptr + 8 + 8 + 4, size_name); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + size_name, ptr + 8 + 8 + 4 + size_name, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_set_name: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_set_name(buffer:%lu name:%p(%u) )", stream, var_buffer, (const char*)(inptr_name.get()), size_name); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_buffer_set_name(var_buffer, (const char*)(inptr_name.get())); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_set_name"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_set_name_fudge: { |
| android::base::beginTrace("magma_buffer_set_name_fudge decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_name __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| InputBuffer inptr_name(ptr + 8 + 8 + 4, size_name); |
| uint64_t var_name_size = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4 + size_name); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + size_name + 8, ptr + 8 + 8 + 4 + size_name + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_set_name_fudge: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_set_name_fudge(buffer:%lu name:%p(%u) name_size:%lu )", stream, var_buffer, (void*)(inptr_name.get()), size_name, var_name_size); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_buffer_set_name_fudge(var_buffer, (void*)(inptr_name.get()), var_name_size); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_set_name_fudge"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_get_info: { |
| android::base::beginTrace("magma_buffer_get_info decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_info_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_get_info: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_info_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_info_out(&tmpBuf[0], size_info_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_get_info(buffer:%lu info_out:%p(%u) )", stream, var_buffer, (magma_buffer_info_t*)(outptr_info_out.get()), size_info_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_info_out]) = this->magma_buffer_get_info(var_buffer, (magma_buffer_info_t*)(outptr_info_out.get())); |
| outptr_info_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_get_info"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_get_handle: { |
| android::base::beginTrace("magma_buffer_get_handle decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_handle_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_get_handle: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_handle_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_handle_out(&tmpBuf[0], size_handle_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_get_handle(buffer:%lu handle_out:%p(%u) )", stream, var_buffer, (magma_handle_t*)(outptr_handle_out.get()), size_handle_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_handle_out]) = this->magma_buffer_get_handle(var_buffer, (magma_handle_t*)(outptr_handle_out.get())); |
| outptr_handle_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_get_handle"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_buffer_export: { |
| android::base::beginTrace("magma_buffer_export decode"); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8); |
| uint32_t size_buffer_handle_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_buffer_export: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_buffer_handle_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_buffer_handle_out(&tmpBuf[0], size_buffer_handle_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_buffer_export(buffer:%lu buffer_handle_out:%p(%u) )", stream, var_buffer, (magma_handle_t*)(outptr_buffer_handle_out.get()), size_buffer_handle_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_buffer_handle_out]) = this->magma_buffer_export(var_buffer, (magma_handle_t*)(outptr_buffer_handle_out.get())); |
| outptr_buffer_handle_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_buffer_export"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_semaphore_signal: { |
| android::base::beginTrace("magma_semaphore_signal decode"); |
| magma_semaphore_t var_semaphore = Unpack<magma_semaphore_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_semaphore_signal: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_semaphore_signal(semaphore:%lu )", stream, var_semaphore); |
| this->magma_semaphore_signal(var_semaphore); |
| SET_LASTCALL("magma_semaphore_signal"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_semaphore_reset: { |
| android::base::beginTrace("magma_semaphore_reset decode"); |
| magma_semaphore_t var_semaphore = Unpack<magma_semaphore_t,uint64_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8, ptr + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_semaphore_reset: GL checksumCalculator failure\n"); |
| } |
| DECODER_DEBUG_LOG("magma(%p): magma_semaphore_reset(semaphore:%lu )", stream, var_semaphore); |
| this->magma_semaphore_reset(var_semaphore); |
| SET_LASTCALL("magma_semaphore_reset"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_semaphore_export: { |
| android::base::beginTrace("magma_semaphore_export decode"); |
| magma_semaphore_t var_semaphore = Unpack<magma_semaphore_t,uint64_t>(ptr + 8); |
| uint32_t size_semaphore_handle_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_semaphore_export: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_semaphore_handle_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_semaphore_handle_out(&tmpBuf[0], size_semaphore_handle_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_semaphore_export(semaphore:%lu semaphore_handle_out:%p(%u) )", stream, var_semaphore, (magma_handle_t*)(outptr_semaphore_handle_out.get()), size_semaphore_handle_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_semaphore_handle_out]) = this->magma_semaphore_export(var_semaphore, (magma_handle_t*)(outptr_semaphore_handle_out.get())); |
| outptr_semaphore_handle_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_semaphore_export"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_poll: { |
| android::base::beginTrace("magma_poll decode"); |
| uint32_t size_items __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8); |
| InputBuffer inptr_items(ptr + 8 + 4, size_items); |
| uint32_t var_count = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + size_items); |
| uint64_t var_timeout_ns = Unpack<uint64_t,uint64_t>(ptr + 8 + 4 + size_items + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4 + size_items + 4 + 8, ptr + 8 + 4 + size_items + 4 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_poll: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_items; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_items(&tmpBuf[0], size_items); |
| memcpy(outptr_items.get(), inptr_items.get(), size_items); |
| DECODER_DEBUG_LOG("magma(%p): magma_poll(items:%p(%u) count:%u timeout_ns:%lu )", stream, (magma_poll_item_t*)(outptr_items.get()), size_items, var_count, var_timeout_ns); |
| *(magma_status_t *)(&tmpBuf[0 + size_items]) = this->magma_poll((magma_poll_item_t*)(outptr_items.get()), var_count, var_timeout_ns); |
| outptr_items.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_poll"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_initialize_tracing: { |
| android::base::beginTrace("magma_initialize_tracing decode"); |
| magma_handle_t var_channel = Unpack<magma_handle_t,uint32_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_initialize_tracing: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_initialize_tracing(channel:%u )", stream, var_channel); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_initialize_tracing(var_channel); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_initialize_tracing"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_initialize_logging: { |
| android::base::beginTrace("magma_initialize_logging decode"); |
| magma_handle_t var_channel = Unpack<magma_handle_t,uint32_t>(ptr + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 4, ptr + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_initialize_logging: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_initialize_logging(channel:%u )", stream, var_channel); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_initialize_logging(var_channel); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_initialize_logging"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_enable_performance_counter_access: { |
| android::base::beginTrace("magma_connection_enable_performance_counter_access decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_handle_t var_channel = Unpack<magma_handle_t,uint32_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4, ptr + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_enable_performance_counter_access: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_enable_performance_counter_access(connection:%lu channel:%u )", stream, var_connection, var_channel); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_enable_performance_counter_access(var_connection, var_channel); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_enable_performance_counter_access"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_enable_performance_counters: { |
| android::base::beginTrace("magma_connection_enable_performance_counters decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_counters __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| InputBuffer inptr_counters(ptr + 8 + 8 + 4, size_counters); |
| uint64_t var_counters_count = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4 + size_counters); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + size_counters + 8, ptr + 8 + 8 + 4 + size_counters + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_enable_performance_counters: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_enable_performance_counters(connection:%lu counters:%p(%u) counters_count:%lu )", stream, var_connection, (uint64_t*)(inptr_counters.get()), size_counters, var_counters_count); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_enable_performance_counters(var_connection, (uint64_t*)(inptr_counters.get()), var_counters_count); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_enable_performance_counters"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_create_performance_counter_buffer_pool: { |
| android::base::beginTrace("magma_connection_create_performance_counter_buffer_pool decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_pool_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| uint32_t size_notification_handle_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + 4, ptr + 8 + 8 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_create_performance_counter_buffer_pool: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_pool_id_out; |
| totalTmpSize += size_notification_handle_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_pool_id_out(&tmpBuf[0], size_pool_id_out); |
| OutputBuffer outptr_notification_handle_out(&tmpBuf[0 + size_pool_id_out], size_notification_handle_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_create_performance_counter_buffer_pool(connection:%lu pool_id_out:%p(%u) notification_handle_out:%p(%u) )", stream, var_connection, (magma_perf_count_pool_t*)(outptr_pool_id_out.get()), size_pool_id_out, (magma_handle_t*)(outptr_notification_handle_out.get()), size_notification_handle_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_pool_id_out + size_notification_handle_out]) = this->magma_connection_create_performance_counter_buffer_pool(var_connection, (magma_perf_count_pool_t*)(outptr_pool_id_out.get()), (magma_handle_t*)(outptr_notification_handle_out.get())); |
| outptr_pool_id_out.flush(); |
| outptr_notification_handle_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_create_performance_counter_buffer_pool"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_release_performance_counter_buffer_pool: { |
| android::base::beginTrace("magma_connection_release_performance_counter_buffer_pool decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_perf_count_pool_t var_pool_id = Unpack<magma_perf_count_pool_t,uint64_t>(ptr + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8, ptr + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_release_performance_counter_buffer_pool: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_release_performance_counter_buffer_pool(connection:%lu pool_id:%lu )", stream, var_connection, var_pool_id); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_release_performance_counter_buffer_pool(var_connection, var_pool_id); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_release_performance_counter_buffer_pool"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_add_performance_counter_buffer_offsets_to_pool: { |
| android::base::beginTrace("magma_connection_add_performance_counter_buffer_offsets_to_pool decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_perf_count_pool_t var_pool_id = Unpack<magma_perf_count_pool_t,uint64_t>(ptr + 8 + 8); |
| uint32_t size_offsets __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| InputBuffer inptr_offsets(ptr + 8 + 8 + 8 + 4, size_offsets); |
| uint64_t var_offsets_count = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 8 + 4 + size_offsets); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4 + size_offsets + 8, ptr + 8 + 8 + 8 + 4 + size_offsets + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_add_performance_counter_buffer_offsets_to_pool: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_add_performance_counter_buffer_offsets_to_pool(connection:%lu pool_id:%lu offsets:%p(%u) offsets_count:%lu )", stream, var_connection, var_pool_id, (const magma_buffer_offset_t*)(inptr_offsets.get()), size_offsets, var_offsets_count); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_add_performance_counter_buffer_offsets_to_pool(var_connection, var_pool_id, (const magma_buffer_offset_t*)(inptr_offsets.get()), var_offsets_count); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_add_performance_counter_buffer_offsets_to_pool"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_remove_performance_counter_buffer_from_pool: { |
| android::base::beginTrace("magma_connection_remove_performance_counter_buffer_from_pool decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_perf_count_pool_t var_pool_id = Unpack<magma_perf_count_pool_t,uint64_t>(ptr + 8 + 8); |
| magma_buffer_t var_buffer = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 8, ptr + 8 + 8 + 8 + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_remove_performance_counter_buffer_from_pool: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_remove_performance_counter_buffer_from_pool(connection:%lu pool_id:%lu buffer:%lu )", stream, var_connection, var_pool_id, var_buffer); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_remove_performance_counter_buffer_from_pool(var_connection, var_pool_id, var_buffer); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_remove_performance_counter_buffer_from_pool"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_dump_performance_counters: { |
| android::base::beginTrace("magma_connection_dump_performance_counters decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_perf_count_pool_t var_pool_id = Unpack<magma_perf_count_pool_t,uint64_t>(ptr + 8 + 8); |
| uint32_t var_trigger_id = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4, ptr + 8 + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_dump_performance_counters: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_dump_performance_counters(connection:%lu pool_id:%lu trigger_id:%u )", stream, var_connection, var_pool_id, var_trigger_id); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_dump_performance_counters(var_connection, var_pool_id, var_trigger_id); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_dump_performance_counters"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_clear_performance_counters: { |
| android::base::beginTrace("magma_connection_clear_performance_counters decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_counters __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| InputBuffer inptr_counters(ptr + 8 + 8 + 4, size_counters); |
| uint64_t var_counters_count = Unpack<uint64_t,uint64_t>(ptr + 8 + 8 + 4 + size_counters); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + size_counters + 8, ptr + 8 + 8 + 4 + size_counters + 8, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_clear_performance_counters: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_clear_performance_counters(connection:%lu counters:%p(%u) counters_count:%lu )", stream, var_connection, (uint64_t*)(inptr_counters.get()), size_counters, var_counters_count); |
| *(magma_status_t *)(&tmpBuf[0]) = this->magma_connection_clear_performance_counters(var_connection, (uint64_t*)(inptr_counters.get()), var_counters_count); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_clear_performance_counters"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_connection_read_performance_counter_completion: { |
| android::base::beginTrace("magma_connection_read_performance_counter_completion decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_perf_count_pool_t var_pool_id = Unpack<magma_perf_count_pool_t,uint64_t>(ptr + 8 + 8); |
| uint32_t size_trigger_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| uint32_t size_buffer_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4); |
| uint32_t size_buffer_offset_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4 + 4); |
| uint32_t size_time_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4 + 4 + 4); |
| uint32_t size_result_flags_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8 + 4 + 4 + 4 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4 + 4 + 4 + 4 + 4, ptr + 8 + 8 + 8 + 4 + 4 + 4 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_connection_read_performance_counter_completion: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_trigger_id_out; |
| totalTmpSize += size_buffer_id_out; |
| totalTmpSize += size_buffer_offset_out; |
| totalTmpSize += size_time_out; |
| totalTmpSize += size_result_flags_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_trigger_id_out(&tmpBuf[0], size_trigger_id_out); |
| OutputBuffer outptr_buffer_id_out(&tmpBuf[0 + size_trigger_id_out], size_buffer_id_out); |
| OutputBuffer outptr_buffer_offset_out(&tmpBuf[0 + size_trigger_id_out + size_buffer_id_out], size_buffer_offset_out); |
| OutputBuffer outptr_time_out(&tmpBuf[0 + size_trigger_id_out + size_buffer_id_out + size_buffer_offset_out], size_time_out); |
| OutputBuffer outptr_result_flags_out(&tmpBuf[0 + size_trigger_id_out + size_buffer_id_out + size_buffer_offset_out + size_time_out], size_result_flags_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_connection_read_performance_counter_completion(connection:%lu pool_id:%lu trigger_id_out:%p(%u) buffer_id_out:%p(%u) buffer_offset_out:%p(%u) time_out:%p(%u) result_flags_out:%p(%u) )", stream, var_connection, var_pool_id, (uint32_t*)(outptr_trigger_id_out.get()), size_trigger_id_out, (uint64_t*)(outptr_buffer_id_out.get()), size_buffer_id_out, (uint32_t*)(outptr_buffer_offset_out.get()), size_buffer_offset_out, (uint64_t*)(outptr_time_out.get()), size_time_out, (uint32_t*)(outptr_result_flags_out.get()), size_result_flags_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_trigger_id_out + size_buffer_id_out + size_buffer_offset_out + size_time_out + size_result_flags_out]) = this->magma_connection_read_performance_counter_completion(var_connection, var_pool_id, (uint32_t*)(outptr_trigger_id_out.get()), (uint64_t*)(outptr_buffer_id_out.get()), (uint32_t*)(outptr_buffer_offset_out.get()), (uint64_t*)(outptr_time_out.get()), (uint32_t*)(outptr_result_flags_out.get())); |
| outptr_trigger_id_out.flush(); |
| outptr_buffer_id_out.flush(); |
| outptr_buffer_offset_out.flush(); |
| outptr_time_out.flush(); |
| outptr_result_flags_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_connection_read_performance_counter_completion"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_virt_connection_create_image: { |
| android::base::beginTrace("magma_virt_connection_create_image decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| uint32_t size_create_info __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8); |
| InputBuffer inptr_create_info(ptr + 8 + 8 + 4, size_create_info); |
| uint32_t size_size_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + size_create_info); |
| uint32_t size_image_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + size_create_info + 4); |
| uint32_t size_buffer_id_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 4 + size_create_info + 4 + 4); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 4 + size_create_info + 4 + 4 + 4, ptr + 8 + 8 + 4 + size_create_info + 4 + 4 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_virt_connection_create_image: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_size_out; |
| totalTmpSize += size_image_out; |
| totalTmpSize += size_buffer_id_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_size_out(&tmpBuf[0], size_size_out); |
| OutputBuffer outptr_image_out(&tmpBuf[0 + size_size_out], size_image_out); |
| OutputBuffer outptr_buffer_id_out(&tmpBuf[0 + size_size_out + size_image_out], size_buffer_id_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_virt_connection_create_image(connection:%lu create_info:%p(%u) size_out:%p(%u) image_out:%p(%u) buffer_id_out:%p(%u) )", stream, var_connection, (magma_image_create_info_t*)(inptr_create_info.get()), size_create_info, (uint64_t*)(outptr_size_out.get()), size_size_out, (magma_buffer_t*)(outptr_image_out.get()), size_image_out, (magma_buffer_id_t*)(outptr_buffer_id_out.get()), size_buffer_id_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_size_out + size_image_out + size_buffer_id_out]) = this->magma_virt_connection_create_image(var_connection, (magma_image_create_info_t*)(inptr_create_info.get()), (uint64_t*)(outptr_size_out.get()), (magma_buffer_t*)(outptr_image_out.get()), (magma_buffer_id_t*)(outptr_buffer_id_out.get())); |
| outptr_size_out.flush(); |
| outptr_image_out.flush(); |
| outptr_buffer_id_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_virt_connection_create_image"); |
| android::base::endTrace(); |
| break; |
| } |
| case OP_magma_virt_connection_get_image_info: { |
| android::base::beginTrace("magma_virt_connection_get_image_info decode"); |
| magma_connection_t var_connection = Unpack<magma_connection_t,uint64_t>(ptr + 8); |
| magma_buffer_t var_image = Unpack<magma_buffer_t,uint64_t>(ptr + 8 + 8); |
| uint32_t size_image_info_out __attribute__((unused)) = Unpack<uint32_t,uint32_t>(ptr + 8 + 8 + 8); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::validOrDie(checksumCalc, ptr, 8 + 8 + 8 + 4, ptr + 8 + 8 + 8 + 4, checksumSize, |
| "magma_decoder_context_t::decode, OP_magma_virt_connection_get_image_info: GL checksumCalculator failure\n"); |
| } |
| size_t totalTmpSize = size_image_info_out; |
| totalTmpSize += sizeof(magma_status_t); |
| totalTmpSize += checksumSize; |
| unsigned char *tmpBuf = stream->alloc(totalTmpSize); |
| OutputBuffer outptr_image_info_out(&tmpBuf[0], size_image_info_out); |
| DECODER_DEBUG_LOG("magma(%p): magma_virt_connection_get_image_info(connection:%lu image:%lu image_info_out:%p(%u) )", stream, var_connection, var_image, (magma_image_info_t*)(outptr_image_info_out.get()), size_image_info_out); |
| *(magma_status_t *)(&tmpBuf[0 + size_image_info_out]) = this->magma_virt_connection_get_image_info(var_connection, var_image, (magma_image_info_t*)(outptr_image_info_out.get())); |
| outptr_image_info_out.flush(); |
| if (useChecksum) { |
| ChecksumCalculatorThreadInfo::writeChecksum(checksumCalc, &tmpBuf[0], totalTmpSize - checksumSize, &tmpBuf[totalTmpSize - checksumSize], checksumSize); |
| } |
| stream->flush(); |
| SET_LASTCALL("magma_virt_connection_get_image_info"); |
| android::base::endTrace(); |
| break; |
| } |
| default: |
| return ptr - (unsigned char*)buf; |
| } //switch |
| ptr += packetLen; |
| } // while |
| return ptr - (unsigned char*)buf; |
| } |
| } // namespace gfxstream |
| |