gsp_gpu.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/bit_field.h"
  5. #include "core/mem_map.h"
  6. #include "core/hle/kernel/event.h"
  7. #include "core/hle/kernel/shared_memory.h"
  8. #include "core/hle/result.h"
  9. #include "gsp_gpu.h"
  10. #include "core/hw/hw.h"
  11. #include "core/hw/gpu.h"
  12. #include "video_core/gpu_debugger.h"
  13. // Main graphics debugger object - TODO: Here is probably not the best place for this
  14. GraphicsDebugger g_debugger;
  15. ////////////////////////////////////////////////////////////////////////////////////////////////////
  16. // Namespace GSP_GPU
  17. namespace GSP_GPU {
  18. /// Event triggered when GSP interrupt has been signalled
  19. Kernel::SharedPtr<Kernel::Event> g_interrupt_event;
  20. /// GSP shared memoryings
  21. Kernel::SharedPtr<Kernel::SharedMemory> g_shared_memory;
  22. /// Thread index into interrupt relay queue, 1 is arbitrary
  23. u32 g_thread_id = 1;
  24. /// Gets a pointer to a thread command buffer in GSP shared memory
  25. static inline u8* GetCommandBuffer(u32 thread_id) {
  26. ResultVal<u8*> ptr = g_shared_memory->GetPointer(0x800 + (thread_id * sizeof(CommandBuffer)));
  27. return ptr.ValueOr(nullptr);
  28. }
  29. static inline FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
  30. DEBUG_ASSERT_MSG(screen_index < 2, "Invalid screen index");
  31. // For each thread there are two FrameBufferUpdate fields
  32. u32 offset = 0x200 + (2 * thread_id + screen_index) * sizeof(FrameBufferUpdate);
  33. ResultVal<u8*> ptr = g_shared_memory->GetPointer(offset);
  34. return reinterpret_cast<FrameBufferUpdate*>(ptr.ValueOr(nullptr));
  35. }
  36. /// Gets a pointer to the interrupt relay queue for a given thread index
  37. static inline InterruptRelayQueue* GetInterruptRelayQueue(u32 thread_id) {
  38. ResultVal<u8*> ptr = g_shared_memory->GetPointer(sizeof(InterruptRelayQueue) * thread_id);
  39. return reinterpret_cast<InterruptRelayQueue*>(ptr.ValueOr(nullptr));
  40. }
  41. /**
  42. * Checks if the parameters in a register write call are valid and logs in the case that
  43. * they are not
  44. * @param base_address The first address in the sequence of registers that will be written
  45. * @param size_in_bytes The number of registers that will be written
  46. * @return true if the parameters are valid, false otherwise
  47. */
  48. static bool CheckWriteParameters(u32 base_address, u32 size_in_bytes) {
  49. // TODO: Return proper error codes
  50. if (base_address + size_in_bytes >= 0x420000) {
  51. LOG_ERROR(Service_GSP, "Write address out of range! (address=0x%08x, size=0x%08x)",
  52. base_address, size_in_bytes);
  53. return false;
  54. }
  55. // size should be word-aligned
  56. if ((size_in_bytes % 4) != 0) {
  57. LOG_ERROR(Service_GSP, "Invalid size 0x%08x", size_in_bytes);
  58. return false;
  59. }
  60. return true;
  61. }
  62. /**
  63. * Writes sequential GSP GPU hardware registers using an array of source data
  64. *
  65. * @param base_address The address of the first register in the sequence
  66. * @param size_in_bytes The number of registers to update (size of data)
  67. * @param data A pointer to the source data
  68. */
  69. static void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) {
  70. // TODO: Return proper error codes
  71. if (!CheckWriteParameters(base_address, size_in_bytes))
  72. return;
  73. while (size_in_bytes > 0) {
  74. HW::Write<u32>(base_address + 0x1EB00000, *data);
  75. size_in_bytes -= 4;
  76. ++data;
  77. base_address += 4;
  78. }
  79. }
  80. /**
  81. * GSP_GPU::WriteHWRegs service function
  82. *
  83. * Writes sequential GSP GPU hardware registers
  84. *
  85. * Inputs:
  86. * 1 : address of first GPU register
  87. * 2 : number of registers to write sequentially
  88. * 4 : pointer to source data array
  89. */
  90. static void WriteHWRegs(Service::Interface* self) {
  91. u32* cmd_buff = Kernel::GetCommandBuffer();
  92. u32 reg_addr = cmd_buff[1];
  93. u32 size = cmd_buff[2];
  94. u32* src = (u32*)Memory::GetPointer(cmd_buff[4]);
  95. WriteHWRegs(reg_addr, size, src);
  96. }
  97. /**
  98. * Updates sequential GSP GPU hardware registers using parallel arrays of source data and masks.
  99. * For each register, the value is updated only where the mask is high
  100. *
  101. * @param base_address The address of the first register in the sequence
  102. * @param size_in_bytes The number of registers to update (size of data)
  103. * @param data A pointer to the source data to use for updates
  104. * @param masks A pointer to the masks
  105. */
  106. static void WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, const u32* data, const u32* masks) {
  107. // TODO: Return proper error codes
  108. if (!CheckWriteParameters(base_address, size_in_bytes))
  109. return;
  110. while (size_in_bytes > 0) {
  111. const u32 reg_address = base_address + 0x1EB00000;
  112. u32 reg_value;
  113. HW::Read<u32>(reg_value, reg_address);
  114. // Update the current value of the register only for set mask bits
  115. reg_value = (reg_value & ~*masks) | (*data | *masks);
  116. HW::Write<u32>(reg_address, reg_value);
  117. size_in_bytes -= 4;
  118. ++data;
  119. ++masks;
  120. base_address += 4;
  121. }
  122. }
  123. /**
  124. * GSP_GPU::WriteHWRegsWithMask service function
  125. *
  126. * Updates sequential GSP GPU hardware registers using masks
  127. *
  128. * Inputs:
  129. * 1 : address of first GPU register
  130. * 2 : number of registers to update sequentially
  131. * 4 : pointer to source data array
  132. * 6 : pointer to mask array
  133. */
  134. static void WriteHWRegsWithMask(Service::Interface* self) {
  135. u32* cmd_buff = Kernel::GetCommandBuffer();
  136. u32 reg_addr = cmd_buff[1];
  137. u32 size = cmd_buff[2];
  138. u32* src_data = (u32*)Memory::GetPointer(cmd_buff[4]);
  139. u32* mask_data = (u32*)Memory::GetPointer(cmd_buff[6]);
  140. WriteHWRegsWithMask(reg_addr, size, src_data, mask_data);
  141. }
  142. /// Read a GSP GPU hardware register
  143. static void ReadHWRegs(Service::Interface* self) {
  144. u32* cmd_buff = Kernel::GetCommandBuffer();
  145. u32 reg_addr = cmd_buff[1];
  146. u32 size = cmd_buff[2];
  147. // TODO: Return proper error codes
  148. if (reg_addr + size >= 0x420000) {
  149. LOG_ERROR(Service_GSP, "Read address out of range! (address=0x%08x, size=0x%08x)", reg_addr, size);
  150. return;
  151. }
  152. // size should be word-aligned
  153. if ((size % 4) != 0) {
  154. LOG_ERROR(Service_GSP, "Invalid size 0x%08x", size);
  155. return;
  156. }
  157. u32* dst = (u32*)Memory::GetPointer(cmd_buff[0x41]);
  158. while (size > 0) {
  159. HW::Read<u32>(*dst, reg_addr + 0x1EB00000);
  160. size -= 4;
  161. ++dst;
  162. reg_addr += 4;
  163. }
  164. }
  165. static void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) {
  166. u32 base_address = 0x400000;
  167. if (info.active_fb == 0) {
  168. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left1)), 4,
  169. &info.address_left);
  170. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right1)), 4,
  171. &info.address_right);
  172. } else {
  173. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left2)), 4,
  174. &info.address_left);
  175. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right2)), 4,
  176. &info.address_right);
  177. }
  178. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].stride)), 4,
  179. &info.stride);
  180. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].color_format)), 4,
  181. &info.format);
  182. WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].active_fb)), 4,
  183. &info.shown_fb);
  184. }
  185. /**
  186. * GSP_GPU::SetBufferSwap service function
  187. *
  188. * Updates GPU display framebuffer configuration using the specified parameters.
  189. *
  190. * Inputs:
  191. * 1 : Screen ID (0 = top screen, 1 = bottom screen)
  192. * 2-7 : FrameBufferInfo structure
  193. * Outputs:
  194. * 1: Result code
  195. */
  196. static void SetBufferSwap(Service::Interface* self) {
  197. u32* cmd_buff = Kernel::GetCommandBuffer();
  198. u32 screen_id = cmd_buff[1];
  199. FrameBufferInfo* fb_info = (FrameBufferInfo*)&cmd_buff[2];
  200. SetBufferSwap(screen_id, *fb_info);
  201. cmd_buff[1] = 0; // No error
  202. }
  203. /**
  204. * GSP_GPU::FlushDataCache service function
  205. *
  206. * This Function is a no-op, We aren't emulating the CPU cache any time soon.
  207. *
  208. * Inputs:
  209. * 1 : Address
  210. * 2 : Size
  211. * 3 : Value 0, some descriptor for the KProcess Handle
  212. * 4 : KProcess handle
  213. * Outputs:
  214. * 1 : Result of function, 0 on success, otherwise error code
  215. */
  216. static void FlushDataCache(Service::Interface* self) {
  217. u32* cmd_buff = Kernel::GetCommandBuffer();
  218. u32 address = cmd_buff[1];
  219. u32 size = cmd_buff[2];
  220. u32 process = cmd_buff[4];
  221. // TODO(purpasmart96): Verify return header on HW
  222. cmd_buff[1] = RESULT_SUCCESS.raw; // No error
  223. }
  224. /**
  225. * GSP_GPU::RegisterInterruptRelayQueue service function
  226. * Inputs:
  227. * 1 : "Flags" field, purpose is unknown
  228. * 3 : Handle to GSP synchronization event
  229. * Outputs:
  230. * 0 : Result of function, 0 on success, otherwise error code
  231. * 2 : Thread index into GSP command buffer
  232. * 4 : Handle to GSP shared memory
  233. */
  234. static void RegisterInterruptRelayQueue(Service::Interface* self) {
  235. u32* cmd_buff = Kernel::GetCommandBuffer();
  236. u32 flags = cmd_buff[1];
  237. g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]);
  238. ASSERT_MSG((g_interrupt_event != nullptr), "handle is not valid!");
  239. g_shared_memory = Kernel::SharedMemory::Create("GSPSharedMem");
  240. Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom();
  241. cmd_buff[1] = 0x2A07; // Value verified by 3dmoo team, purpose unknown, but needed for GSP init
  242. cmd_buff[2] = g_thread_id++; // Thread ID
  243. cmd_buff[4] = shmem_handle; // GSP shared memory
  244. g_interrupt_event->Signal(); // TODO(bunnei): Is this correct?
  245. }
  246. /**
  247. * Signals that the specified interrupt type has occurred to userland code
  248. * @param interrupt_id ID of interrupt that is being signalled
  249. * @todo This should probably take a thread_id parameter and only signal this thread?
  250. * @todo This probably does not belong in the GSP module, instead move to video_core
  251. */
  252. void SignalInterrupt(InterruptId interrupt_id) {
  253. if (0 == g_interrupt_event) {
  254. LOG_WARNING(Service_GSP, "cannot synchronize until GSP event has been created!");
  255. return;
  256. }
  257. if (nullptr == g_shared_memory) {
  258. LOG_WARNING(Service_GSP, "cannot synchronize until GSP shared memory has been created!");
  259. return;
  260. }
  261. for (int thread_id = 0; thread_id < 0x4; ++thread_id) {
  262. InterruptRelayQueue* interrupt_relay_queue = GetInterruptRelayQueue(thread_id);
  263. u8 next = interrupt_relay_queue->index;
  264. next += interrupt_relay_queue->number_interrupts;
  265. next = next % 0x34; // 0x34 is the number of interrupt slots
  266. interrupt_relay_queue->number_interrupts += 1;
  267. interrupt_relay_queue->slot[next] = interrupt_id;
  268. interrupt_relay_queue->error_code = 0x0; // No error
  269. // Update framebuffer information if requested
  270. // TODO(yuriks): Confirm where this code should be called. It is definitely updated without
  271. // executing any GSP commands, only waiting on the event.
  272. int screen_id = (interrupt_id == InterruptId::PDC0) ? 0 : (interrupt_id == InterruptId::PDC1) ? 1 : -1;
  273. if (screen_id != -1) {
  274. FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id);
  275. if (info->is_dirty) {
  276. SetBufferSwap(screen_id, info->framebuffer_info[info->index]);
  277. info->is_dirty = false;
  278. }
  279. }
  280. }
  281. g_interrupt_event->Signal();
  282. }
  283. /// Executes the next GSP command
  284. static void ExecuteCommand(const Command& command, u32 thread_id) {
  285. // Utility function to convert register ID to address
  286. auto WriteGPURegister = [](u32 id, u32 data) {
  287. GPU::Write<u32>(0x1EF00000 + 4 * id, data);
  288. };
  289. switch (command.id) {
  290. // GX request DMA - typically used for copying memory from GSP heap to VRAM
  291. case CommandId::REQUEST_DMA:
  292. memcpy(Memory::GetPointer(command.dma_request.dest_address),
  293. Memory::GetPointer(command.dma_request.source_address),
  294. command.dma_request.size);
  295. SignalInterrupt(InterruptId::DMA);
  296. break;
  297. // ctrulib homebrew sends all relevant command list data with this command,
  298. // hence we do all "interesting" stuff here and do nothing in SET_COMMAND_LIST_FIRST.
  299. // TODO: This will need some rework in the future.
  300. case CommandId::SET_COMMAND_LIST_LAST:
  301. {
  302. auto& params = command.set_command_list_last;
  303. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.address)),
  304. Memory::VirtualToPhysicalAddress(params.address) >> 3);
  305. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.size)), params.size);
  306. // TODO: Not sure if we are supposed to always write this .. seems to trigger processing though
  307. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.trigger)), 1);
  308. break;
  309. }
  310. // It's assumed that the two "blocks" behave equivalently.
  311. // Presumably this is done simply to allow two memory fills to run in parallel.
  312. case CommandId::SET_MEMORY_FILL:
  313. {
  314. auto& params = command.memory_fill;
  315. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_start)),
  316. Memory::VirtualToPhysicalAddress(params.start1) >> 3);
  317. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].address_end)),
  318. Memory::VirtualToPhysicalAddress(params.end1) >> 3);
  319. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].value_32bit)), params.value1);
  320. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[0].control)), params.control1);
  321. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_start)),
  322. Memory::VirtualToPhysicalAddress(params.start2) >> 3);
  323. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].address_end)),
  324. Memory::VirtualToPhysicalAddress(params.end2) >> 3);
  325. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].value_32bit)), params.value2);
  326. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(memory_fill_config[1].control)), params.control2);
  327. break;
  328. }
  329. case CommandId::SET_DISPLAY_TRANSFER:
  330. {
  331. auto& params = command.image_copy;
  332. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.input_address)),
  333. Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3);
  334. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.output_address)),
  335. Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3);
  336. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.input_size)), params.in_buffer_size);
  337. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.output_size)), params.out_buffer_size);
  338. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.flags)), params.flags);
  339. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.trigger)), 1);
  340. break;
  341. }
  342. // TODO: Check if texture copies are implemented correctly..
  343. case CommandId::SET_TEXTURE_COPY:
  344. {
  345. auto& params = command.image_copy;
  346. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.input_address)),
  347. Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3);
  348. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.output_address)),
  349. Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3);
  350. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.input_size)), params.in_buffer_size);
  351. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.output_size)), params.out_buffer_size);
  352. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.flags)), params.flags);
  353. // TODO: Should this register be set to 1 or should instead its value be OR-ed with 1?
  354. WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(display_transfer_config.trigger)), 1);
  355. break;
  356. }
  357. // TODO: Figure out what exactly SET_COMMAND_LIST_FIRST and SET_COMMAND_LIST_LAST
  358. // are supposed to do.
  359. case CommandId::SET_COMMAND_LIST_FIRST:
  360. {
  361. break;
  362. }
  363. default:
  364. LOG_ERROR(Service_GSP, "unknown command 0x%08X", (int)command.id.Value());
  365. }
  366. }
  367. /**
  368. * GSP_GPU::SetLcdForceBlack service function
  369. *
  370. * Enable or disable REG_LCDCOLORFILL with the color black.
  371. *
  372. * Inputs:
  373. * 1: Black color fill flag (0 = don't fill, !0 = fill)
  374. * Outputs:
  375. * 1: Result code
  376. */
  377. void SetLcdForceBlack(Service::Interface* self) {
  378. // TODO: currently has no effect, as LCD reg writes have nowhere to go.
  379. u32* cmd_buff = Kernel::GetCommandBuffer();
  380. bool enable_black = cmd_buff[1] != 0;
  381. u32 data = 0;
  382. if (enable_black) {
  383. // Sets bit 24 to 1, enabling the fill
  384. // Since data is already 0x00000000, there is no need to explicitly set
  385. // bits 0-23 to zero (black), or bit 24 to 0 (fill disabled).
  386. data |= (1 << 24);
  387. }
  388. u32 data_main = data;
  389. u32 data_sub = data;
  390. WriteHWRegs(0x202204, 4, &data_main); // Main LCD
  391. WriteHWRegs(0x202A04, 4, &data_sub); // Sub LCD
  392. cmd_buff[1] = RESULT_SUCCESS.raw;
  393. }
  394. /// This triggers handling of the GX command written to the command buffer in shared memory.
  395. static void TriggerCmdReqQueue(Service::Interface* self) {
  396. // Iterate through each thread's command queue...
  397. for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) {
  398. CommandBuffer* command_buffer = (CommandBuffer*)GetCommandBuffer(thread_id);
  399. // Iterate through each command...
  400. for (unsigned i = 0; i < command_buffer->number_commands; ++i) {
  401. g_debugger.GXCommandProcessed((u8*)&command_buffer->commands[i]);
  402. // Decode and execute command
  403. ExecuteCommand(command_buffer->commands[i], thread_id);
  404. // Indicates that command has completed
  405. command_buffer->number_commands = command_buffer->number_commands - 1;
  406. }
  407. }
  408. u32* cmd_buff = Kernel::GetCommandBuffer();
  409. cmd_buff[1] = 0; // No error
  410. }
  411. const Interface::FunctionInfo FunctionTable[] = {
  412. {0x00010082, WriteHWRegs, "WriteHWRegs"},
  413. {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"},
  414. {0x00030082, nullptr, "WriteHWRegRepeat"},
  415. {0x00040080, ReadHWRegs, "ReadHWRegs"},
  416. {0x00050200, SetBufferSwap, "SetBufferSwap"},
  417. {0x00060082, nullptr, "SetCommandList"},
  418. {0x000700C2, nullptr, "RequestDma"},
  419. {0x00080082, FlushDataCache, "FlushDataCache"},
  420. {0x00090082, nullptr, "InvalidateDataCache"},
  421. {0x000A0044, nullptr, "RegisterInterruptEvents"},
  422. {0x000B0040, SetLcdForceBlack, "SetLcdForceBlack"},
  423. {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"},
  424. {0x000D0140, nullptr, "SetDisplayTransfer"},
  425. {0x000E0180, nullptr, "SetTextureCopy"},
  426. {0x000F0200, nullptr, "SetMemoryFill"},
  427. {0x00100040, nullptr, "SetAxiConfigQoSMode"},
  428. {0x00110040, nullptr, "SetPerfLogMode"},
  429. {0x00120000, nullptr, "GetPerfLog"},
  430. {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"},
  431. {0x00140000, nullptr, "UnregisterInterruptRelayQueue"},
  432. {0x00150002, nullptr, "TryAcquireRight"},
  433. {0x00160042, nullptr, "AcquireRight"},
  434. {0x00170000, nullptr, "ReleaseRight"},
  435. {0x00180000, nullptr, "ImportDisplayCaptureInfo"},
  436. {0x00190000, nullptr, "SaveVramSysArea"},
  437. {0x001A0000, nullptr, "RestoreVramSysArea"},
  438. {0x001B0000, nullptr, "ResetGpuCore"},
  439. {0x001C0040, nullptr, "SetLedForceOff"},
  440. {0x001D0040, nullptr, "SetTestCommand"},
  441. {0x001E0080, nullptr, "SetInternalPriorities"},
  442. {0x001F0082, nullptr, "StoreDataCache"},
  443. };
  444. ////////////////////////////////////////////////////////////////////////////////////////////////////
  445. // Interface class
  446. Interface::Interface() {
  447. Register(FunctionTable);
  448. g_interrupt_event = 0;
  449. g_shared_memory = 0;
  450. g_thread_id = 1;
  451. }
  452. } // namespace