video_core: Fix gpu thread deadlock
This commit is contained in:
@@ -34,7 +34,6 @@ void DmaPusher::DispatchCalls() {
|
|||||||
}
|
}
|
||||||
gpu.FlushCommands();
|
gpu.FlushCommands();
|
||||||
gpu.SyncGuestHost();
|
gpu.SyncGuestHost();
|
||||||
gpu.OnCommandListEnd();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DmaPusher::Step() {
|
bool DmaPusher::Step() {
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user