From ad900aba7a924c5e3ab70918f78301a1cc95dd94 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 30 Oct 2021 19:32:59 +0100 Subject: [PATCH] s/Host1X/Host1x/ as per Nvidia naming --- .../services/hosbinder/android_types.h | 2 +- .../services/nvdrv/devices/nvhost/ctrl.cpp | 4 +-- .../services/nvdrv/devices/nvhost/ctrl.h | 4 +-- .../nvdrv/devices/nvhost/host1x_channel.cpp | 32 +++++++++---------- .../nvdrv/devices/nvhost/host1x_channel.h | 6 ++-- .../cpp/skyline/services/nvdrv/driver.cpp | 6 ++-- app/src/main/cpp/skyline/soc.h | 2 +- app/src/main/cpp/skyline/soc/host1x.h | 4 +-- .../cpp/skyline/soc/host1x/classes/host1x.cpp | 4 +-- .../cpp/skyline/soc/host1x/classes/host1x.h | 4 +-- .../cpp/skyline/soc/host1x/command_fifo.h | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/src/main/cpp/skyline/services/hosbinder/android_types.h b/app/src/main/cpp/skyline/services/hosbinder/android_types.h index 9df8826f..3335d304 100644 --- a/app/src/main/cpp/skyline/services/hosbinder/android_types.h +++ b/app/src/main/cpp/skyline/services/hosbinder/android_types.h @@ -59,7 +59,7 @@ namespace skyline::service::hosbinder { /** * @brief Wait on all native fences in this Android fence till they're signalled */ - void Wait(soc::host1x::Host1X &host1x) const { + void Wait(soc::host1x::Host1x &host1x) const { if (fenceCount > fences.size()) throw exception("Wait has larger fence count ({}) than storage size ({})", fenceCount, fences.size()); for (auto it{fences.begin()}, end{fences.begin() + fenceCount}; it < end; it++) diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp index 41e02dc3..40846df8 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.cpp @@ -17,12 +17,12 @@ namespace skyline::service::nvdrv::device::nvhost { state = State::Signalled; } - void Ctrl::SyncpointEvent::Cancel(soc::host1x::Host1X &host1x) { + void Ctrl::SyncpointEvent::Cancel(soc::host1x::Host1x &host1x) { host1x.syncpoints.at(fence.id).DeregisterWaiter(waiterHandle); waiterHandle = {}; } - void Ctrl::SyncpointEvent::RegisterWaiter(soc::host1x::Host1X &host1x, const Fence &pFence) { + void Ctrl::SyncpointEvent::RegisterWaiter(soc::host1x::Host1x &host1x, const Fence &pFence) { fence = pFence; state = State::Waiting; waiterHandle = host1x.syncpoints.at(fence.id).RegisterWaiter(fence.threshold, [this] { Signal(); }); diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.h b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.h index d596571f..2eda6eac 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.h +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/ctrl.h @@ -63,13 +63,13 @@ namespace skyline::service::nvdrv::device::nvhost { * @brief Removes any wait requests on a syncpoint event and resets its state * @note Accesses to this function for a specific event should be locked */ - void Cancel(soc::host1x::Host1X &host1x); + void Cancel(soc::host1x::Host1x &host1x); /** * @brief Asynchronously waits on a syncpoint event using the given fence * @note Accesses to this function for a specific event should be locked */ - void RegisterWaiter(soc::host1x::Host1X &host1x, const Fence &fence); + void RegisterWaiter(soc::host1x::Host1x &host1x, const Fence &fence); bool IsInUse(); }; diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.cpp index 1a5ddf40..7e2d0f9d 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.cpp @@ -6,7 +6,7 @@ #include "host1x_channel.h" namespace skyline::service::nvdrv::device::nvhost { - Host1XChannel::Host1XChannel(const DeviceState &state, + Host1xChannel::Host1xChannel(const DeviceState &state, Driver &driver, Core &core, const SessionContext &ctx, @@ -16,12 +16,12 @@ namespace skyline::service::nvdrv::device::nvhost { state.soc->host1x.channels[static_cast(channelType)].Start(); } - PosixResult Host1XChannel::SetNvmapFd(In fd) { + PosixResult Host1xChannel::SetNvmapFd(In fd) { state.logger->Debug("fd: {}", fd); return PosixResult::Success; } - PosixResult Host1XChannel::Submit(span cmdBufs, + PosixResult Host1xChannel::Submit(span cmdBufs, span relocs, span relocShifts, span syncpointIncrs, span fenceThresholds) { state.logger->Debug("numCmdBufs: {}, numRelocs: {}, numSyncpointIncrs: {}, numFenceThresholds: {}", @@ -58,7 +58,7 @@ namespace skyline::service::nvdrv::device::nvhost { return PosixResult::Success; } - PosixResult Host1XChannel::GetSyncpoint(In channelSyncpointIdx, Out syncpointId) { + PosixResult Host1xChannel::GetSyncpoint(In channelSyncpointIdx, Out syncpointId) { state.logger->Debug("channelSyncpointIdx: {}", channelSyncpointIdx); if (channelSyncpointIdx > 0) @@ -73,18 +73,18 @@ namespace skyline::service::nvdrv::device::nvhost { return PosixResult::Success; } - PosixResult Host1XChannel::GetWaitBase(In pChannelType, Out waitBase) { + PosixResult Host1xChannel::GetWaitBase(In pChannelType, Out waitBase) { state.logger->Debug("channelType: {}", static_cast(pChannelType)); waitBase = 0; return PosixResult::Success; } - PosixResult Host1XChannel::SetSubmitTimeout(In timeout) { + PosixResult Host1xChannel::SetSubmitTimeout(In timeout) { state.logger->Debug("timeout: {}", timeout); return PosixResult::Success; } - PosixResult Host1XChannel::MapBuffer(u8 compressed, span handles) { + PosixResult Host1xChannel::MapBuffer(u8 compressed, span handles) { state.logger->Debug("compressed: {}", compressed); for (auto &bufferHandle : handles) { @@ -95,7 +95,7 @@ namespace skyline::service::nvdrv::device::nvhost { return PosixResult::Success; } - PosixResult Host1XChannel::UnmapBuffer(u8 compressed, span handles) { + PosixResult Host1xChannel::UnmapBuffer(u8 compressed, span handles) { state.logger->Debug("compressed: {}", compressed); for (auto &bufferHandle : handles) { @@ -106,27 +106,27 @@ namespace skyline::service::nvdrv::device::nvhost { return PosixResult::Success; } #include - static constexpr u32 Host1XChannelMagic{0x00}; + static constexpr u32 Host1xChannelMagic{0x00}; static constexpr u32 GpuChannelMagic{0x48}; //!< Used for SetNvmapFd which is needed in both GPU and host1x channels - VARIABLE_IOCTL_HANDLER_FUNC(Host1XChannel, ({ + VARIABLE_IOCTL_HANDLER_FUNC(Host1xChannel, ({ IOCTL_CASE_ARGS(IN, SIZE(0x4), MAGIC(GpuChannelMagic), FUNC(0x1), SetNvmapFd, ARGS(In)) - IOCTL_CASE_ARGS(INOUT, SIZE(0x8), MAGIC(Host1XChannelMagic), FUNC(0x2), + IOCTL_CASE_ARGS(INOUT, SIZE(0x8), MAGIC(Host1xChannelMagic), FUNC(0x2), GetSyncpoint, ARGS(In, Out)) - IOCTL_CASE_ARGS(INOUT, SIZE(0x8), MAGIC(Host1XChannelMagic), FUNC(0x3), + IOCTL_CASE_ARGS(INOUT, SIZE(0x8), MAGIC(Host1xChannelMagic), FUNC(0x3), GetWaitBase, ARGS(In, Out)) - IOCTL_CASE_ARGS(IN, SIZE(0x4), MAGIC(Host1XChannelMagic), FUNC(0x7), + IOCTL_CASE_ARGS(IN, SIZE(0x4), MAGIC(Host1xChannelMagic), FUNC(0x7), SetSubmitTimeout, ARGS(In)) }), ({ - VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1XChannelMagic), FUNC(0x1), + VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1xChannelMagic), FUNC(0x1), Submit, ARGS(Save, Save, Save, Save, SlotSizeSpan, SlotSizeSpan, SlotSizeSpan, SlotSizeSpan, SlotSizeSpan)) - VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1XChannelMagic), FUNC(0x9), + VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1xChannelMagic), FUNC(0x9), MapBuffer, ARGS(Save, Pad, In, Pad, SlotSizeSpan)) - VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1XChannelMagic), FUNC(0xA), + VARIABLE_IOCTL_CASE_ARGS(INOUT, MAGIC(Host1xChannelMagic), FUNC(0xA), UnmapBuffer, ARGS(Save, Pad, In, Pad, SlotSizeSpan)) })) #include diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.h b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.h index 175d5f0d..662a9c30 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.h +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/host1x_channel.h @@ -9,10 +9,10 @@ namespace skyline::service::nvdrv::device::nvhost { /** - * @brief nvhost::Host1XChannel is used by applications to interface with host1x channels, such as VIC and NVDEC + * @brief nvhost::Host1xChannel is used by applications to interface with host1x channels, such as VIC and NVDEC * @url https://switchbrew.org/wiki/NV_services#Channels */ - class Host1XChannel : public NvDevice { + class Host1xChannel : public NvDevice { private: core::ChannelType channelType; //!< The specific host1x channel that this instance refers to std::mutex channelMutex; //!< Synchronises submit operations @@ -55,7 +55,7 @@ namespace skyline::service::nvdrv::device::nvhost { u32 address; //!< The output IOVA that the handle was pinned too }; - Host1XChannel(const DeviceState &state, + Host1xChannel(const DeviceState &state, Driver &driver, Core &core, const SessionContext &ctx, diff --git a/app/src/main/cpp/skyline/services/nvdrv/driver.cpp b/app/src/main/cpp/skyline/services/nvdrv/driver.cpp index 15e48fdf..d65fdf5d 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/driver.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/driver.cpp @@ -45,13 +45,13 @@ namespace skyline::service::nvdrv { } if (ctx.perms.AccessJpeg) - DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-nvjpg", nvhost::Host1XChannel, core::ChannelType::NvJpg)) + DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-nvjpg", nvhost::Host1xChannel, core::ChannelType::NvJpg)) if (ctx.perms.AccessVic) - DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-vic", nvhost::Host1XChannel, core::ChannelType::Vic)) + DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-vic", nvhost::Host1xChannel, core::ChannelType::Vic)) if (ctx.perms.AccessVideoDecoder) - DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-nvdec", nvhost::Host1XChannel, core::ChannelType::NvDec)) + DEVICE_SWITCH(DEVICE_CASE("/dev/nvhost-nvdec", nvhost::Host1xChannel, core::ChannelType::NvDec)) #undef DEVICE_CASE #undef DEVICE_SWITCH diff --git a/app/src/main/cpp/skyline/soc.h b/app/src/main/cpp/skyline/soc.h index 3ac43b08..1e5052e3 100644 --- a/app/src/main/cpp/skyline/soc.h +++ b/app/src/main/cpp/skyline/soc.h @@ -15,7 +15,7 @@ namespace skyline::soc { class SOC { public: SMMU smmu; - host1x::Host1X host1x; + host1x::Host1x host1x; SOC(const DeviceState &state) : host1x(state) {} }; diff --git a/app/src/main/cpp/skyline/soc/host1x.h b/app/src/main/cpp/skyline/soc/host1x.h index d58464fb..4134e4f3 100644 --- a/app/src/main/cpp/skyline/soc/host1x.h +++ b/app/src/main/cpp/skyline/soc/host1x.h @@ -13,11 +13,11 @@ namespace skyline::soc::host1x { * @brief An abstraction for the graphics host, this handles DMA on behalf of the CPU when communicating to it's clients alongside handling syncpts * @note This is different from the GM20B Host, it serves a similar function and has an interface for accessing host1x syncpts */ - class Host1X { + class Host1x { public: SyncpointSet syncpoints; std::array channels; - Host1X(const DeviceState &state) : channels{util::MakeFilledArray(state, syncpoints)} {} + Host1x(const DeviceState &state) : channels{util::MakeFilledArray(state, syncpoints)} {} }; } diff --git a/app/src/main/cpp/skyline/soc/host1x/classes/host1x.cpp b/app/src/main/cpp/skyline/soc/host1x/classes/host1x.cpp index b65d0af3..074af98c 100644 --- a/app/src/main/cpp/skyline/soc/host1x/classes/host1x.cpp +++ b/app/src/main/cpp/skyline/soc/host1x/classes/host1x.cpp @@ -6,9 +6,9 @@ #include "host1x.h" namespace skyline::soc::host1x { - Host1XClass::Host1XClass(const DeviceState &state, SyncpointSet &syncpoints) : state(state), syncpoints(syncpoints) {} + Host1xClass::Host1xClass(const DeviceState &state, SyncpointSet &syncpoints) : state(state), syncpoints(syncpoints) {} - void Host1XClass::CallMethod(u32 method, u32 argument) { + void Host1xClass::CallMethod(u32 method, u32 argument) { constexpr static u32 LoadSyncpointPayload32MethodId{0x4E}; //!< See '14.3.2.12 32-Bit Sync Point Comparison Methods' in TRM constexpr static u32 WaitSyncpoint32MethodId{0x50}; //!< As above diff --git a/app/src/main/cpp/skyline/soc/host1x/classes/host1x.h b/app/src/main/cpp/skyline/soc/host1x/classes/host1x.h index 0134466d..012c953f 100644 --- a/app/src/main/cpp/skyline/soc/host1x/classes/host1x.h +++ b/app/src/main/cpp/skyline/soc/host1x/classes/host1x.h @@ -10,14 +10,14 @@ namespace skyline::soc::host1x { /** * @brief A class internal to Host1x, used for performing syncpoint waits and other general operations */ - class Host1XClass { + class Host1xClass { private: const DeviceState &state; SyncpointSet &syncpoints; u32 syncpointPayload{}; //!< Holds the current payload for the 32-bit syncpoint comparison methods public: - Host1XClass(const DeviceState &state, SyncpointSet &syncpoints); + Host1xClass(const DeviceState &state, SyncpointSet &syncpoints); void CallMethod(u32 method, u32 argument); }; diff --git a/app/src/main/cpp/skyline/soc/host1x/command_fifo.h b/app/src/main/cpp/skyline/soc/host1x/command_fifo.h index 5eb2cca9..2d0523b6 100644 --- a/app/src/main/cpp/skyline/soc/host1x/command_fifo.h +++ b/app/src/main/cpp/skyline/soc/host1x/command_fifo.h @@ -26,7 +26,7 @@ namespace skyline::soc::host1x { std::thread thread; //!< The thread that manages processing of pushbuffers within gathers std::mutex threadStartMutex; //!< Protects the thread from being started multiple times - Host1XClass host1XClass; //!< The internal Host1x class, used for performing syncpoint waits and other general operations + Host1xClass host1XClass; //!< The internal Host1x class, used for performing syncpoint waits and other general operations TegraHostInterface nvDecClass; //!< The THI wrapped NVDEC class for video decoding TegraHostInterface vicClass; //!< The THI wrapped VIC class for acceleration of image operations