From 703880c9ab4212f728496185ff73023012e141e5 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 7 Feb 2018 21:31:06 -0500 Subject: nvhost_as_gpu: Add nvmap as a class member. --- src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 1 + src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h | 8 +++++++- src/core/hle/service/nvdrv/nvdrv.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 11ab25545..3701c182f 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.h index 06c256d5d..6b3b67113 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 +#include #include #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_dev) : nvdevice(), nvmap_dev(std::move(nvmap_dev)) {} ~nvhost_as_gpu() override = default; u32 ioctl(Ioctl command, const std::vector& input, std::vector& output) override; @@ -92,6 +96,8 @@ private: u32 MapBufferEx(const std::vector& input, std::vector& output); u32 BindChannel(const std::vector& input, std::vector& output); u32 GetVARegions(const std::vector& input, std::vector& output); + + std::shared_ptr nvmap_dev; }; } // namespace Devices diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 1cf8f3175..a98634422 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["/dev/nvhost-as-gpu"] = std::make_shared(); + devices["/dev/nvhost-as-gpu"] = std::make_shared(nvmap_dev); devices["/dev/nvhost-ctrl-gpu"] = std::make_shared(); devices["/dev/nvmap"] = nvmap_dev; devices["/dev/nvdisp_disp0"] = std::make_shared(nvmap_dev); -- cgit v1.2.3