VERY experimental Nintendo Switch 2 emulator
C++
nvhost_as_gpu: Add nvmap as a class member.
bunnei49929e4a6b9b
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cppindex 11ab25545d..3701c182fa 100644--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp@@ -5,6 +5,7 @@#include "common/assert.h"#include "common/logging/log.h"#include "core/hle/service/nvdrv/devices/nvhost_as_gpu.h"+#include "core/hle/service/nvdrv/devices/nvmap.h"namespace Service {namespace Nvidia {diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.hindex 06c256d5da..6b3b67113e 100644--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h@@ -4,6 +4,8 @@#pragma once+#include <memory>+#include <utility>#include <vector>#include "common/common_types.h"#include "common/swap.h"@@ -13,9 +15,11 @@ namespace Service {namespace Nvidia {namespace Devices {+class nvmap;+class nvhost_as_gpu final : public nvdevice {public:- nvhost_as_gpu() = default;+ nvhost_as_gpu(std::shared_ptr<nvmap> nvmap_dev) : nvdevice(), nvmap_dev(std::move(nvmap_dev)) {}~nvhost_as_gpu() override = default;u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;@@ -92,6 +96,8 @@ private:u32 MapBufferEx(const std::vector<u8>& input, std::vector<u8>& output);u32 BindChannel(const std::vector<u8>& input, std::vector<u8>& output);u32 GetVARegions(const std::vector<u8>& input, std::vector<u8>& output);++ std::shared_ptr<nvmap> nvmap_dev;};} // namespace Devicesdiff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cppindex 1cf8f3175a..a98634422f 100644--- a/src/core/hle/service/nvdrv/nvdrv.cpp+++ b/src/core/hle/service/nvdrv/nvdrv.cpp@@ -31,7 +31,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {Module::Module() {auto nvmap_dev = std::make_shared<Devices::nvmap>();- devices["/dev/nvhost-as-gpu"] = std::make_shared<Devices::nvhost_as_gpu>();+ devices["/dev/nvhost-as-gpu"] = std::make_shared<Devices::nvhost_as_gpu>(nvmap_dev);devices["/dev/nvhost-ctrl-gpu"] = std::make_shared<Devices::nvhost_ctrl_gpu>();devices["/dev/nvmap"] = nvmap_dev;devices["/dev/nvdisp_disp0"] = std::make_shared<Devices::nvdisp_disp0>(nvmap_dev);