From 7a9d1ad2f873003e6aad637e8749b77b91247da3 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 24 Dec 2023 18:20:02 +0100 Subject: NVDRV: Implement sessions and initial implementation of SMMU --- src/video_core/CMakeLists.txt | 2 ++ src/video_core/gpu.cpp | 2 +- src/video_core/host1x/host1x.cpp | 3 +-- src/video_core/host1x/host1x.h | 18 ++++-------------- 4 files changed, 8 insertions(+), 17 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index c22c7631c..2dda8ebc2 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -71,6 +71,8 @@ add_library(video_core STATIC host1x/ffmpeg/ffmpeg.h host1x/control.cpp host1x/control.h + host1x/gpu_device_memory_manager.cpp + host1x/gpu_device_memory_manager.h host1x/host1x.cpp host1x/host1x.h host1x/nvdec.cpp diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 11549d448..1e915682f 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -85,7 +85,7 @@ struct GPU::Impl { void BindRenderer(std::unique_ptr renderer_) { renderer = std::move(renderer_); rasterizer = renderer->ReadRasterizer(); - host1x.MemoryManager().BindRasterizer(rasterizer); + host1x.MemoryManager().BindInterface(rasterizer); } /// Flush all current written commands into the host GPU for execution. diff --git a/src/video_core/host1x/host1x.cpp b/src/video_core/host1x/host1x.cpp index 7c317a85d..d05bcaf26 100644 --- a/src/video_core/host1x/host1x.cpp +++ b/src/video_core/host1x/host1x.cpp @@ -9,8 +9,7 @@ namespace Tegra { namespace Host1x { Host1x::Host1x(Core::System& system_) - : system{system_}, syncpoint_manager{}, memory_manager{system, 32, 12}, - allocator{std::make_unique>(1 << 12)} {} + : system{system_}, syncpoint_manager{}, memory_manager(system.DeviceMemory()) {} } // namespace Host1x diff --git a/src/video_core/host1x/host1x.h b/src/video_core/host1x/host1x.h index 57082ae54..18f7389f6 100644 --- a/src/video_core/host1x/host1x.h +++ b/src/video_core/host1x/host1x.h @@ -5,9 +5,8 @@ #include "common/common_types.h" -#include "common/address_space.h" +#include "video_core/host1x/gpu_device_memory_manager.h" #include "video_core/host1x/syncpoint_manager.h" -#include "video_core/memory_manager.h" namespace Core { class System; @@ -29,27 +28,18 @@ public: return syncpoint_manager; } - Tegra::MemoryManager& MemoryManager() { + Tegra::MaxwellDeviceMemoryManager& MemoryManager() { return memory_manager; } - const Tegra::MemoryManager& MemoryManager() const { + const Tegra::MaxwellDeviceMemoryManager& MemoryManager() const { return memory_manager; } - Common::FlatAllocator& Allocator() { - return *allocator; - } - - const Common::FlatAllocator& Allocator() const { - return *allocator; - } - private: Core::System& system; SyncpointManager syncpoint_manager; - Tegra::MemoryManager memory_manager; - std::unique_ptr> allocator; + Tegra::MaxwellDeviceMemoryManager memory_manager; }; } // namespace Host1x -- cgit v1.2.3