summaryrefslogtreecommitdiff
path: root/src/core/hle/service/gsp.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-14 12:13:16 -0400
committerGravatar bunnei2014-06-14 12:13:16 -0400
commit004df767953a949817da89bddcd5d1379240f769 (patch)
treeb2d54928dcbf3cb4dde0cd5d3277afe7999b7bd9 /src/core/hle/service/gsp.cpp
parentGPU debugger: Const correctness and build fix. (diff)
parentKernel: Removed unnecessary "#pragma once". (diff)
downloadyuzu-004df767953a949817da89bddcd5d1379240f769.tar.gz
yuzu-004df767953a949817da89bddcd5d1379240f769.tar.xz
yuzu-004df767953a949817da89bddcd5d1379240f769.zip
Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts: src/core/hle/function_wrappers.h src/core/hle/service/gsp.cpp
Diffstat (limited to 'src/core/hle/service/gsp.cpp')
-rw-r--r--src/core/hle/service/gsp.cpp74
1 files changed, 44 insertions, 30 deletions
diff --git a/src/core/hle/service/gsp.cpp b/src/core/hle/service/gsp.cpp
index aabcb48db..f75ba75c2 100644
--- a/src/core/hle/service/gsp.cpp
+++ b/src/core/hle/service/gsp.cpp
@@ -8,6 +8,7 @@
8 8
9#include "core/mem_map.h" 9#include "core/mem_map.h"
10#include "core/hle/hle.h" 10#include "core/hle/hle.h"
11#include "core/hle/kernel/event.h"
11#include "core/hle/service/gsp.h" 12#include "core/hle/service/gsp.h"
12 13
13#include "core/hw/gpu.h" 14#include "core/hw/gpu.h"
@@ -60,6 +61,7 @@ void GX_FinishCommand(u32 thread_id) {
60 61
61namespace GSP_GPU { 62namespace GSP_GPU {
62 63
64Handle g_event_handle = 0;
63u32 g_thread_id = 0; 65u32 g_thread_id = 0;
64 66
65enum { 67enum {
@@ -96,7 +98,7 @@ void ReadHWRegs(Service::Interface* self) {
96 break; 98 break;
97 99
98 default: 100 default:
99 ERROR_LOG(GSP, "ReadHWRegs unknown register read at address %08X", reg_addr); 101 ERROR_LOG(GSP, "unknown register read at address %08X", reg_addr);
100 } 102 }
101 103
102} 104}
@@ -104,7 +106,19 @@ void ReadHWRegs(Service::Interface* self) {
104void RegisterInterruptRelayQueue(Service::Interface* self) { 106void RegisterInterruptRelayQueue(Service::Interface* self) {
105 u32* cmd_buff = Service::GetCommandBuffer(); 107 u32* cmd_buff = Service::GetCommandBuffer();
106 u32 flags = cmd_buff[1]; 108 u32 flags = cmd_buff[1];
107 u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling 109 u32 event_handle = cmd_buff[3];
110
111 _assert_msg_(GSP, (event_handle != 0), "called, but event is nullptr!");
112
113 g_event_handle = event_handle;
114
115 Kernel::SetEventLocked(event_handle, false);
116
117 // Hack - This function will permanently set the state of the GSP event such that GPU command
118 // synchronization barriers always passthrough. Correct solution would be to set this after the
119 // GPU as processed all queued up commands, but due to the emulator being single-threaded they
120 // will always be ready.
121 Kernel::SetPermanentLock(event_handle, true);
108 122
109 cmd_buff[2] = g_thread_id; // ThreadID 123 cmd_buff[2] = g_thread_id; // ThreadID
110} 124}
@@ -150,43 +164,43 @@ void TriggerCmdReqQueue(Service::Interface* self) {
150 } 164 }
151 165
152 default: 166 default:
153 ERROR_LOG(GSP, "TriggerCmdReqQueue unknown command 0x%08X", cmd_buff[0]); 167 ERROR_LOG(GSP, "unknown command 0x%08X", cmd_buff[0]);
154 } 168 }
155 169
156 GX_FinishCommand(g_thread_id); 170 GX_FinishCommand(g_thread_id);
157} 171}
158 172
159const Interface::FunctionInfo FunctionTable[] = { 173const Interface::FunctionInfo FunctionTable[] = {
160 {0x00010082, NULL, "WriteHWRegs"}, 174 {0x00010082, nullptr, "WriteHWRegs"},
161 {0x00020084, NULL, "WriteHWRegsWithMask"}, 175 {0x00020084, nullptr, "WriteHWRegsWithMask"},
162 {0x00030082, NULL, "WriteHWRegRepeat"}, 176 {0x00030082, nullptr, "WriteHWRegRepeat"},
163 {0x00040080, ReadHWRegs, "ReadHWRegs"}, 177 {0x00040080, ReadHWRegs, "ReadHWRegs"},
164 {0x00050200, NULL, "SetBufferSwap"}, 178 {0x00050200, nullptr, "SetBufferSwap"},
165 {0x00060082, NULL, "SetCommandList"}, 179 {0x00060082, nullptr, "SetCommandList"},
166 {0x000700C2, NULL, "RequestDma"}, 180 {0x000700C2, nullptr, "RequestDma"},
167 {0x00080082, NULL, "FlushDataCache"}, 181 {0x00080082, nullptr, "FlushDataCache"},
168 {0x00090082, NULL, "InvalidateDataCache"}, 182 {0x00090082, nullptr, "InvalidateDataCache"},
169 {0x000A0044, NULL, "RegisterInterruptEvents"}, 183 {0x000A0044, nullptr, "RegisterInterruptEvents"},
170 {0x000B0040, NULL, "SetLcdForceBlack"}, 184 {0x000B0040, nullptr, "SetLcdForceBlack"},
171 {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"}, 185 {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"},
172 {0x000D0140, NULL, "SetDisplayTransfer"}, 186 {0x000D0140, nullptr, "SetDisplayTransfer"},
173 {0x000E0180, NULL, "SetTextureCopy"}, 187 {0x000E0180, nullptr, "SetTextureCopy"},
174 {0x000F0200, NULL, "SetMemoryFill"}, 188 {0x000F0200, nullptr, "SetMemoryFill"},
175 {0x00100040, NULL, "SetAxiConfigQoSMode"}, 189 {0x00100040, nullptr, "SetAxiConfigQoSMode"},
176 {0x00110040, NULL, "SetPerfLogMode"}, 190 {0x00110040, nullptr, "SetPerfLogMode"},
177 {0x00120000, NULL, "GetPerfLog"}, 191 {0x00120000, nullptr, "GetPerfLog"},
178 {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"}, 192 {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"},
179 {0x00140000, NULL, "UnregisterInterruptRelayQueue"}, 193 {0x00140000, nullptr, "UnregisterInterruptRelayQueue"},
180 {0x00150002, NULL, "TryAcquireRight"}, 194 {0x00150002, nullptr, "TryAcquireRight"},
181 {0x00160042, NULL, "AcquireRight"}, 195 {0x00160042, nullptr, "AcquireRight"},
182 {0x00170000, NULL, "ReleaseRight"}, 196 {0x00170000, nullptr, "ReleaseRight"},
183 {0x00180000, NULL, "ImportDisplayCaptureInfo"}, 197 {0x00180000, nullptr, "ImportDisplayCaptureInfo"},
184 {0x00190000, NULL, "SaveVramSysArea"}, 198 {0x00190000, nullptr, "SaveVramSysArea"},
185 {0x001A0000, NULL, "RestoreVramSysArea"}, 199 {0x001A0000, nullptr, "RestoreVramSysArea"},
186 {0x001B0000, NULL, "ResetGpuCore"}, 200 {0x001B0000, nullptr, "ResetGpuCore"},
187 {0x001C0040, NULL, "SetLedForceOff"}, 201 {0x001C0040, nullptr, "SetLedForceOff"},
188 {0x001D0040, NULL, "SetTestCommand"}, 202 {0x001D0040, nullptr, "SetTestCommand"},
189 {0x001E0080, NULL, "SetInternalPriorities"}, 203 {0x001E0080, nullptr, "SetInternalPriorities"},
190}; 204};
191 205
192//////////////////////////////////////////////////////////////////////////////////////////////////// 206////////////////////////////////////////////////////////////////////////////////////////////////////