summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-05-20 21:21:06 +0200
committerSubv <subv2112@gmail.com>2018-05-20 21:25:56 +0200
commit72b5c448cfe5d21fea9dd7a996ca8b50539ec64a (patch)
tree7cd6e266d128e057791033c74af65b3666b31953 /src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
parentMerge pull request #436 from bunnei/multi-core (diff)
downloadyuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar.gz
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar.bz2
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar.lz
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar.xz
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.tar.zst
yuzu-72b5c448cfe5d21fea9dd7a996ca8b50539ec64a.zip
Diffstat (limited to 'src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h17
1 files changed, 17 insertions, 0 deletions
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 f2dd0c3b3..d4c4b4db3 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
@@ -5,6 +5,7 @@
#pragma once
#include <memory>
+#include <unordered_map>
#include <utility>
#include <vector>
#include "common/common_types.h"
@@ -30,6 +31,7 @@ private:
IocMapBufferExCommand = 0xC0284106,
IocBindChannelCommand = 0x40044101,
IocGetVaRegionsCommand = 0xC0404108,
+ IocUnmapBufferCommand = 0xC0084105,
};
struct IoctlInitalizeEx {
@@ -76,6 +78,11 @@ private:
};
static_assert(sizeof(IoctlMapBufferEx) == 40, "IoctlMapBufferEx is incorrect size");
+ struct IoctlUnmapBuffer {
+ u64_le offset;
+ };
+ static_assert(sizeof(IoctlUnmapBuffer) == 8, "IoctlUnmapBuffer is incorrect size");
+
struct IoctlBindChannel {
u32_le fd;
};
@@ -98,12 +105,22 @@ private:
static_assert(sizeof(IoctlGetVaRegions) == 16 + sizeof(IoctlVaRegion) * 2,
"IoctlGetVaRegions is incorrect size");
+ struct BufferMapping {
+ u64 offset;
+ u64 size;
+ u32 nvmap_handle;
+ };
+
+ /// Map containing the nvmap object mappings in GPU memory.
+ std::unordered_map<u64, BufferMapping> buffer_mappings;
+
u32 channel{};
u32 InitalizeEx(const std::vector<u8>& input, std::vector<u8>& output);
u32 AllocateSpace(const std::vector<u8>& input, std::vector<u8>& output);
u32 Remap(const std::vector<u8>& input, std::vector<u8>& output);
u32 MapBufferEx(const std::vector<u8>& input, std::vector<u8>& output);
+ u32 UnmapBuffer(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);