From bda177ef409242c7ce200f55c1d8eea0e5aba6d3 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 22 Jan 2021 18:31:08 -0300 Subject: video_core/memory_manager: Add BytesToMapEnd Track map address sizes in a flat ordered map and add a method to query the number of bytes until the end of a map in a given address. --- src/video_core/memory_manager.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/video_core/memory_manager.h') diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index c35e57689..ca8e8328e 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -85,6 +85,9 @@ public: [[nodiscard]] u8* GetPointer(GPUVAddr addr); [[nodiscard]] const u8* GetPointer(GPUVAddr addr) const; + /// Returns the number of bytes until the end of the memory map containing the given GPU address + [[nodiscard]] size_t BytesToMapEnd(GPUVAddr gpu_addr) const noexcept; + /** * ReadBlock and WriteBlock are full read and write operations over virtual * GPU Memory. It's important to use these when GPU memory may not be continuous @@ -150,6 +153,9 @@ private: VideoCore::RasterizerInterface* rasterizer = nullptr; std::vector page_table; + + using MapRange = std::pair; + std::vector map_ranges; }; } // namespace Tegra -- cgit v1.2.3