rsx/mm: Implement partial queue flush

This commit is contained in:
kd-11
2026-09-06 12:55:51 +03:00
committed by kd-11
parent 1559b15afe
commit 0ead9328f2
2 changed files with 23 additions and 1 deletions
+21 -1
View File
@@ -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);
}
}
}
+2
View File
@@ -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();
}