From bca95916603ad5913281c72c2a0620bddf2f3010 Mon Sep 17 00:00:00 2001 From: Levi Behunin Date: Sun, 1 Nov 2020 01:24:17 -0700 Subject: Rename to align with switchbrew and remove gpu function (#4714) * Rename to align with switchbrew * Rename to align with switchbrew and remove gpu function that checks if clearing should be done. --- src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 20 +++++++------------- src/core/hle/service/nvdrv/devices/nvhost_ctrl.h | 6 +++--- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index b27ee0502..75d9191ff 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -36,8 +36,8 @@ u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector& input, const std::v return IocCtrlEventRegister(input, output); case IoctlCommand::IocCtrlEventUnregisterCommand: return IocCtrlEventUnregister(input, output); - case IoctlCommand::IocCtrlEventSignalCommand: - return IocCtrlEventSignal(input, output); + case IoctlCommand::IocCtrlClearEventWaitCommand: + return IocCtrlClearEventWait(input, output); default: UNIMPLEMENTED_MSG("Unimplemented ioctl"); return 0; @@ -154,23 +154,17 @@ u32 nvhost_ctrl::IocCtrlEventUnregister(const std::vector& input, std::vecto return NvResult::Success; } -u32 nvhost_ctrl::IocCtrlEventSignal(const std::vector& input, std::vector& output) { +u32 nvhost_ctrl::IocCtrlClearEventWait(const std::vector& input, std::vector& output) { IocCtrlEventSignalParams params{}; std::memcpy(¶ms, input.data(), sizeof(params)); - // TODO(Blinkhawk): This is normally called when an NvEvents timeout on WaitSynchronization - // It is believed from RE to cancel the GPU Event. However, better research is required - u32 event_id = params.user_event_id & 0x00FF; - LOG_WARNING(Service_NVDRV, "(STUBBED) called, user_event_id: {:X}", event_id); + u32 event_id = params.event_id & 0x00FF; + LOG_WARNING(Service_NVDRV, "cleared event wait on, event_id: {:X}", event_id); if (event_id >= MaxNvEvents) { return NvResult::BadParameter; } if (events_interface.status[event_id] == EventState::Waiting) { - auto& gpu = system.GPU(); - if (gpu.CancelSyncptInterrupt(events_interface.assigned_syncpt[event_id], - events_interface.assigned_value[event_id])) { - events_interface.LiberateEvent(event_id); - events_interface.events[event_id].writable->Signal(); - } + events_interface.LiberateEvent(event_id); + events_interface.events[event_id].writable->Signal(); } return NvResult::Success; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h index 9898623de..f7b04d9f1 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.h @@ -31,7 +31,7 @@ private: IocSyncptWaitexCommand = 0xC0100019, IocSyncptReadMaxCommand = 0xC008001A, IocGetConfigCommand = 0xC183001B, - IocCtrlEventSignalCommand = 0xC004001C, + IocCtrlClearEventWaitCommand = 0xC004001C, IocCtrlEventWaitCommand = 0xC010001D, IocCtrlEventWaitAsyncCommand = 0xC010001E, IocCtrlEventRegisterCommand = 0xC004001F, @@ -94,7 +94,7 @@ private: static_assert(sizeof(IocGetConfigParams) == 387, "IocGetConfigParams is incorrect size"); struct IocCtrlEventSignalParams { - u32_le user_event_id; + u32_le event_id; }; static_assert(sizeof(IocCtrlEventSignalParams) == 4, "IocCtrlEventSignalParams is incorrect size"); @@ -142,7 +142,7 @@ private: u32 IocCtrlEventUnregister(const std::vector& input, std::vector& output); - u32 IocCtrlEventSignal(const std::vector& input, std::vector& output); + u32 IocCtrlClearEventWait(const std::vector& input, std::vector& output); EventInterface& events_interface; }; -- cgit v1.2.3