mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
rsx/mm: Implement partial queue flush
This commit is contained in:
@@ -121,7 +121,7 @@ namespace rsx
|
||||
return;
|
||||
}
|
||||
|
||||
g_deferred_mprotect_queue.push_back({ range, prot });
|
||||
g_deferred_mprotect_queue.push_back({ range, prot, rsx::get_shared_tag() });
|
||||
}
|
||||
|
||||
void mm_protect(void* ptr, u64 length, utils::protection prot)
|
||||
@@ -222,4 +222,24 @@ namespace rsx
|
||||
auto& rsxdma = g_fxo->get<rsx::dma_manager>();
|
||||
rsxdma.backend_ctrl(mm_backend_ctrl::cmd_mm_flush, nullptr);
|
||||
}
|
||||
|
||||
void mm_flush_partial(u64 last_tag)
|
||||
{
|
||||
std::lock_guard lock(g_mprotect_queue_lock);
|
||||
|
||||
u32 count = 0;
|
||||
for (const auto& block : g_deferred_mprotect_queue)
|
||||
{
|
||||
if (block.sync_tag > last_tag)
|
||||
{
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count)
|
||||
{
|
||||
mm_flush_mprotect_queue_internal(count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace rsx
|
||||
{
|
||||
utils::address_range64 range;
|
||||
utils::protection prot;
|
||||
u64 sync_tag;
|
||||
|
||||
inline void merge(const utils::address_range64& other)
|
||||
{
|
||||
@@ -47,5 +48,6 @@ namespace rsx
|
||||
void mm_flush_lazy();
|
||||
void mm_flush(u32 vm_address);
|
||||
void mm_flush(const rsx::simple_array<utils::address_range64>& ranges);
|
||||
void mm_flush_partial(u64 tag);
|
||||
void mm_flush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user