From 0a2536a0df1f4aea406f2132d3edda0430acc9d1 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Mon, 25 Dec 2023 07:32:16 +0100 Subject: SMMU: Initial adaptation to video_core. --- src/video_core/query_cache.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/video_core/query_cache.h') diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index a64404ce4..b01d843e4 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h @@ -21,6 +21,7 @@ #include "core/memory.h" #include "video_core/control/channel_state_cache.h" #include "video_core/engines/maxwell_3d.h" +#include "video_core/host1x/gpu_device_memory_manager.h" #include "video_core/memory_manager.h" #include "video_core/rasterizer_interface.h" #include "video_core/texture_cache/slot_vector.h" @@ -102,18 +103,19 @@ template { public: explicit QueryCacheLegacy(VideoCore::RasterizerInterface& rasterizer_, - Core::Memory::Memory& cpu_memory_) + Tegra::MaxwellDeviceMemoryManager& device_memory_) : rasterizer{rasterizer_}, // Use reinterpret_cast instead of static_cast as workaround for // UBSan bug (https://github.com/llvm/llvm-project/issues/59060) - cpu_memory{cpu_memory_}, streams{{ - {CounterStream{reinterpret_cast(*this), - VideoCore::QueryType::SamplesPassed}}, - {CounterStream{reinterpret_cast(*this), - VideoCore::QueryType::PrimitivesGenerated}}, - {CounterStream{reinterpret_cast(*this), - VideoCore::QueryType::TfbPrimitivesWritten}}, - }} { + device_memory{device_memory_}, + streams{{ + {CounterStream{reinterpret_cast(*this), + VideoCore::QueryType::SamplesPassed}}, + {CounterStream{reinterpret_cast(*this), + VideoCore::QueryType::PrimitivesGenerated}}, + {CounterStream{reinterpret_cast(*this), + VideoCore::QueryType::TfbPrimitivesWritten}}, + }} { (void)slot_async_jobs.insert(); // Null value } @@ -322,13 +324,14 @@ private: local_lock.unlock(); if (timestamp) { u64 timestamp_value = *timestamp; - cpu_memory.WriteBlockUnsafe(address + sizeof(u64), ×tamp_value, sizeof(u64)); - cpu_memory.WriteBlockUnsafe(address, &value, sizeof(u64)); + device_memory.WriteBlockUnsafe(address + sizeof(u64), ×tamp_value, + sizeof(u64)); + device_memory.WriteBlockUnsafe(address, &value, sizeof(u64)); rasterizer.InvalidateRegion(address, sizeof(u64) * 2, VideoCommon::CacheType::NoQueryCache); } else { u32 small_value = static_cast(value); - cpu_memory.WriteBlockUnsafe(address, &small_value, sizeof(u32)); + device_memory.WriteBlockUnsafe(address, &small_value, sizeof(u32)); rasterizer.InvalidateRegion(address, sizeof(u32), VideoCommon::CacheType::NoQueryCache); } @@ -342,7 +345,7 @@ private: SlotVector slot_async_jobs; VideoCore::RasterizerInterface& rasterizer; - Core::Memory::Memory& cpu_memory; + Tegra::MaxwellDeviceMemoryManager& device_memory; mutable std::recursive_mutex mutex; -- cgit v1.2.3