diff options
| author | 2018-08-13 14:00:27 +1000 | |
|---|---|---|
| committer | 2018-08-13 14:00:27 +1000 | |
| commit | 92492ee23be1a71eede7becbbea17994f9261022 (patch) | |
| tree | ab2ffadb9430b92814895fcbce0fc6b6c28a285f /src/core | |
| parent | Merge pull request #1044 from bunnei/linestrip (diff) | |
| download | yuzu-92492ee23be1a71eede7becbbea17994f9261022.tar.gz yuzu-92492ee23be1a71eede7becbbea17994f9261022.tar.xz yuzu-92492ee23be1a71eede7becbbea17994f9261022.zip | |
Added missing channel devices
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp | 34 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h | 36 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_vic.cpp | 34 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_vic.h | 36 |
5 files changed, 144 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index cceb1564b..0b0ae5ccc 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -249,6 +249,10 @@ add_library(core STATIC | |||
| 249 | hle/service/nvdrv/devices/nvhost_gpu.h | 249 | hle/service/nvdrv/devices/nvhost_gpu.h |
| 250 | hle/service/nvdrv/devices/nvhost_nvdec.cpp | 250 | hle/service/nvdrv/devices/nvhost_nvdec.cpp |
| 251 | hle/service/nvdrv/devices/nvhost_nvdec.h | 251 | hle/service/nvdrv/devices/nvhost_nvdec.h |
| 252 | hle/service/nvdrv/devices/nvhost_nvjpg.cpp | ||
| 253 | hle/service/nvdrv/devices/nvhost_nvjpg.h | ||
| 254 | hle/service/nvdrv/devices/nvhost_vic.cpp | ||
| 255 | hle/service/nvdrv/devices/nvhost_vic.h | ||
| 252 | hle/service/nvdrv/devices/nvmap.cpp | 256 | hle/service/nvdrv/devices/nvmap.cpp |
| 253 | hle/service/nvdrv/devices/nvmap.h | 257 | hle/service/nvdrv/devices/nvmap.h |
| 254 | hle/service/nvdrv/interface.cpp | 258 | hle/service/nvdrv/interface.cpp |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp new file mode 100644 index 000000000..51f01077b --- /dev/null +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <cstring> | ||
| 6 | |||
| 7 | #include "common/assert.h" | ||
| 8 | #include "common/logging/log.h" | ||
| 9 | #include "core/hle/service/nvdrv/devices/nvhost_nvjpg.h" | ||
| 10 | |||
| 11 | namespace Service::Nvidia::Devices { | ||
| 12 | |||
| 13 | u32 nvhost_nvjpg::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 14 | LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", | ||
| 15 | command.raw, input.size(), output.size()); | ||
| 16 | |||
| 17 | switch (static_cast<IoctlCommand>(command.raw)) { | ||
| 18 | case IoctlCommand::IocSetNVMAPfdCommand: | ||
| 19 | return SetNVMAPfd(input, output); | ||
| 20 | } | ||
| 21 | |||
| 22 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); | ||
| 23 | return 0; | ||
| 24 | } | ||
| 25 | |||
| 26 | u32 nvhost_nvjpg::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 27 | IoctlSetNvmapFD params{}; | ||
| 28 | std::memcpy(¶ms, input.data(), input.size()); | ||
| 29 | LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); | ||
| 30 | nvmap_fd = params.nvmap_fd; | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 34 | } // namespace Service::Nvidia::Devices | ||
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h new file mode 100644 index 000000000..2b0eb43ee --- /dev/null +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <vector> | ||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "common/swap.h" | ||
| 10 | #include "core/hle/service/nvdrv/devices/nvdevice.h" | ||
| 11 | |||
| 12 | namespace Service::Nvidia::Devices { | ||
| 13 | |||
| 14 | class nvhost_nvjpg final : public nvdevice { | ||
| 15 | public: | ||
| 16 | nvhost_nvjpg() = default; | ||
| 17 | ~nvhost_nvjpg() override = default; | ||
| 18 | |||
| 19 | u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; | ||
| 20 | |||
| 21 | private: | ||
| 22 | enum class IoctlCommand : u32_le { | ||
| 23 | IocSetNVMAPfdCommand = 0x40044801, | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct IoctlSetNvmapFD { | ||
| 27 | u32_le nvmap_fd; | ||
| 28 | }; | ||
| 29 | static_assert(sizeof(IoctlSetNvmapFD) == 4, "IoctlSetNvmapFD is incorrect size"); | ||
| 30 | |||
| 31 | u32_le nvmap_fd{}; | ||
| 32 | |||
| 33 | u32 SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 34 | }; | ||
| 35 | |||
| 36 | } // namespace Service::Nvidia::Devices | ||
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp new file mode 100644 index 000000000..fcb488d50 --- /dev/null +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <cstring> | ||
| 6 | |||
| 7 | #include "common/assert.h" | ||
| 8 | #include "common/logging/log.h" | ||
| 9 | #include "core/hle/service/nvdrv/devices/nvhost_vic.h" | ||
| 10 | |||
| 11 | namespace Service::Nvidia::Devices { | ||
| 12 | |||
| 13 | u32 nvhost_vic::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 14 | LOG_DEBUG(Service_NVDRV, "called, command=0x{:08X}, input_size=0x{:X}, output_size=0x{:X}", | ||
| 15 | command.raw, input.size(), output.size()); | ||
| 16 | |||
| 17 | switch (static_cast<IoctlCommand>(command.raw)) { | ||
| 18 | case IoctlCommand::IocSetNVMAPfdCommand: | ||
| 19 | return SetNVMAPfd(input, output); | ||
| 20 | } | ||
| 21 | |||
| 22 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); | ||
| 23 | return 0; | ||
| 24 | } | ||
| 25 | |||
| 26 | u32 nvhost_vic::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 27 | IoctlSetNvmapFD params{}; | ||
| 28 | std::memcpy(¶ms, input.data(), input.size()); | ||
| 29 | LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); | ||
| 30 | nvmap_fd = params.nvmap_fd; | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 34 | } // namespace Service::Nvidia::Devices | ||
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.h b/src/core/hle/service/nvdrv/devices/nvhost_vic.h new file mode 100644 index 000000000..c7d681e52 --- /dev/null +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <vector> | ||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "common/swap.h" | ||
| 10 | #include "core/hle/service/nvdrv/devices/nvdevice.h" | ||
| 11 | |||
| 12 | namespace Service::Nvidia::Devices { | ||
| 13 | |||
| 14 | class nvhost_vic final : public nvdevice { | ||
| 15 | public: | ||
| 16 | nvhost_vic() = default; | ||
| 17 | ~nvhost_vic() override = default; | ||
| 18 | |||
| 19 | u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override; | ||
| 20 | |||
| 21 | private: | ||
| 22 | enum class IoctlCommand : u32_le { | ||
| 23 | IocSetNVMAPfdCommand = 0x40044801, | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct IoctlSetNvmapFD { | ||
| 27 | u32_le nvmap_fd; | ||
| 28 | }; | ||
| 29 | static_assert(sizeof(IoctlSetNvmapFD) == 4, "IoctlSetNvmapFD is incorrect size"); | ||
| 30 | |||
| 31 | u32_le nvmap_fd{}; | ||
| 32 | |||
| 33 | u32 SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 34 | }; | ||
| 35 | |||
| 36 | } // namespace Service::Nvidia::Devices | ||