summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-19 02:53:21 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-05 21:49:32 +0200
commitd20ede40b1e9cd0539982fb1feb3b13af3501ea2 (patch)
treea084fedd90a6a3cc3e11b099f4ddfe194d49c8ea /src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
parentNVFlinger: Correct GCC compile error (diff)
downloadyuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar.gz
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar.bz2
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar.lz
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar.xz
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.tar.zst
yuzu-d20ede40b1e9cd0539982fb1feb3b13af3501ea2.zip
Diffstat (limited to 'src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
index a5a4f8c7b..749aa71d4 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
@@ -15,7 +15,7 @@
namespace Service::Nvidia::Devices {
-nvhost_ctrl::nvhost_ctrl(Core::System& system, EventsInterface& events_interface)
+nvhost_ctrl::nvhost_ctrl(Core::System& system, EventInterface& events_interface)
: nvdevice(system), events_interface{events_interface} {}
nvhost_ctrl::~nvhost_ctrl() = default;
@@ -67,12 +67,11 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
if (!gpu.IsAsync()) {
return NvResult::Success;
}
- gpu.Guard(true);
+ auto lock = gpu.LockSync();
u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id);
if (current_syncpoint_value >= params.threshold) {
params.value = current_syncpoint_value;
std::memcpy(output.data(), &params, sizeof(params));
- gpu.Guard(false);
return NvResult::Success;
}
@@ -82,7 +81,6 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
if (params.timeout == 0) {
std::memcpy(output.data(), &params, sizeof(params));
- gpu.Guard(false);
return NvResult::Timeout;
}
@@ -91,7 +89,6 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
event_id = params.value & 0x00FF;
if (event_id >= 64) {
std::memcpy(output.data(), &params, sizeof(params));
- gpu.Guard(false);
return NvResult::BadParameter;
}
} else {
@@ -119,15 +116,12 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
ctrl.must_delay = true;
ctrl.timeout = params.timeout;
ctrl.event_id = event_id;
- gpu.Guard(false);
return NvResult::Timeout;
}
std::memcpy(output.data(), &params, sizeof(params));
- gpu.Guard(false);
return NvResult::Timeout;
}
std::memcpy(output.data(), &params, sizeof(params));
- gpu.Guard(false);
return NvResult::BadParameter;
}