video_core: Fix gpu thread deadlock

This commit is contained in:
FengChen
2022-07-13 15:07:51 +08:00
parent 802bbb2263
commit 539ee9f4e8
4 changed files with 3 additions and 19 deletions
-1
View File
@@ -34,7 +34,6 @@ void DmaPusher::DispatchCalls() {
} }
gpu.FlushCommands(); gpu.FlushCommands();
gpu.SyncGuestHost(); gpu.SyncGuestHost();
gpu.OnCommandListEnd();
} }
bool DmaPusher::Step() { bool DmaPusher::Step() {
-12
View File
@@ -107,14 +107,6 @@ struct GPU::Impl {
rasterizer->SyncGuestHost(); rasterizer->SyncGuestHost();
} }
/// Signal the ending of command list.
void OnCommandListEnd() {
if (is_async) {
// This command only applies to asynchronous GPU mode
gpu_thread.OnCommandListEnd();
}
}
/// Request a host GPU memory flush from the CPU. /// Request a host GPU memory flush from the CPU.
[[nodiscard]] u64 RequestFlush(VAddr addr, std::size_t size) { [[nodiscard]] u64 RequestFlush(VAddr addr, std::size_t size) {
std::unique_lock lck{flush_request_mutex}; std::unique_lock lck{flush_request_mutex};
@@ -765,10 +757,6 @@ void GPU::SyncGuestHost() {
impl->SyncGuestHost(); impl->SyncGuestHost();
} }
void GPU::OnCommandListEnd() {
impl->OnCommandListEnd();
}
u64 GPU::RequestFlush(VAddr addr, std::size_t size) { u64 GPU::RequestFlush(VAddr addr, std::size_t size) {
return impl->RequestFlush(addr, size); return impl->RequestFlush(addr, size);
} }
+3 -4
View File
@@ -77,6 +77,9 @@ void ThreadManager::StartThread(VideoCore::RendererBase& renderer,
void ThreadManager::SubmitList(Tegra::CommandList&& entries) { void ThreadManager::SubmitList(Tegra::CommandList&& entries) {
PushCommand(SubmitListCommand(std::move(entries))); PushCommand(SubmitListCommand(std::move(entries)));
if (is_async) {
PushCommand(OnCommandListEndCommand());
}
} }
void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { void ThreadManager::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
@@ -107,10 +110,6 @@ void ThreadManager::FlushAndInvalidateRegion(VAddr addr, u64 size) {
rasterizer->OnCPUWrite(addr, size); rasterizer->OnCPUWrite(addr, size);
} }
void ThreadManager::OnCommandListEnd() {
PushCommand(OnCommandListEndCommand());
}
u64 ThreadManager::PushCommand(CommandData&& command_data, bool block) { u64 ThreadManager::PushCommand(CommandData&& command_data, bool block) {
if (!is_async) { if (!is_async) {
// In synchronous GPU mode, block the caller until the command has executed // In synchronous GPU mode, block the caller until the command has executed
-2
View File
@@ -129,8 +129,6 @@ public:
/// Notify rasterizer that any caches of the specified region should be flushed and invalidated /// Notify rasterizer that any caches of the specified region should be flushed and invalidated
void FlushAndInvalidateRegion(VAddr addr, u64 size); void FlushAndInvalidateRegion(VAddr addr, u64 size);
void OnCommandListEnd();
private: private:
/// Pushes a command to be executed by the GPU thread /// Pushes a command to be executed by the GPU thread
u64 PushCommand(CommandData&& command_data, bool block = false); u64 PushCommand(CommandData&& command_data, bool block = false);