From b905580202f0da5ca0a6268b176b4591e347fd8d Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Thu, 29 Oct 2026 05:46:59 -0400 Subject: video_core: compact the macro memo arena; download profiling counters Calls stored again with another shape leave their old record in the memo's arena; title 1 filled its 16 MiB every ~2 s and clearing it made the next ~20,000 calls interpret again. The live records are now copied to a new arena (a clear only when they alone fill three quarters of it). The memo statistics count hits on the last call's slot and compactions. With EDEN_NX2_GPU_PROFILE the GPU thread also reports how much downloaded buffer data lands on pages the native MME has DMA-read. --- src/video_core/buffer_cache/buffer_cache.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/video_core/buffer_cache/buffer_cache.h') diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index e2de0eede1..b909971e42 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -679,6 +679,19 @@ void BufferCache

::CommitAsyncFlushesHigh() { Buffer& buffer = slot_buffers[buffer_id]; second_copy.src_offset = static_cast(buffer.CpuAddr()) + copy.src_offset; const DAddr orig_device_addr = static_cast(second_copy.src_offset); + if (Nx2Profile::Enabled()) { + u64 on_dma_pages = 0; + const auto& pages = Nx2Profile::DmaReadPages(); + for (DAddr page = orig_device_addr >> 12; page <= (orig_device_addr + copy.size - 1) >> 12; + ++page) { + if (pages.contains(page)) { + const DAddr begin = (std::max)(orig_device_addr, page << 12); + const DAddr end = (std::min)(orig_device_addr + copy.size, (page + 1) << 12); + on_dma_pages += end - begin; + } + } + Nx2Profile::Add(Nx2Profile::Counter::DownloadBytesOnDmaPages, on_dma_pages); + } async_downloads.Add(orig_device_addr, copy.size); buffer.MarkUsage(copy.src_offset, copy.size); runtime.CopyBuffer(download_staging.buffer, buffer, copies, false); -- cgit v1.2.3