diff options
| author | 2019-06-07 22:13:40 -0400 | |
|---|---|---|
| committer | 2019-07-05 15:49:16 -0400 | |
| commit | eef55f493b636bfc57389e9c541ddf2c39f6f826 (patch) | |
| tree | db7e0db06edb8dc80b67b111b4fdb06d464a1eb5 /src/core | |
| parent | nv_services: Stub CtrlEventSignal (diff) | |
| download | yuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.tar.gz yuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.tar.xz yuzu-eef55f493b636bfc57389e9c541ddf2c39f6f826.zip | |
Gpu: Mark areas as protected.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index 8f47d63e3..8e28c2fa4 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | |||
| @@ -60,10 +60,12 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | auto& gpu = Core::System::GetInstance().GPU(); | 62 | auto& gpu = Core::System::GetInstance().GPU(); |
| 63 | gpu.Guard(true); | ||
| 63 | u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); | 64 | u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); |
| 64 | if (current_syncpoint_value >= params.threshold) { | 65 | if (current_syncpoint_value >= params.threshold) { |
| 65 | params.value = current_syncpoint_value; | 66 | params.value = current_syncpoint_value; |
| 66 | std::memcpy(output.data(), ¶ms, sizeof(params)); | 67 | std::memcpy(output.data(), ¶ms, sizeof(params)); |
| 68 | gpu.Guard(false); | ||
| 67 | return NvResult::Success; | 69 | return NvResult::Success; |
| 68 | } | 70 | } |
| 69 | 71 | ||
| @@ -73,6 +75,7 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& | |||
| 73 | 75 | ||
| 74 | if (params.timeout == 0) { | 76 | if (params.timeout == 0) { |
| 75 | std::memcpy(output.data(), ¶ms, sizeof(params)); | 77 | std::memcpy(output.data(), ¶ms, sizeof(params)); |
| 78 | gpu.Guard(false); | ||
| 76 | return NvResult::Timeout; | 79 | return NvResult::Timeout; |
| 77 | } | 80 | } |
| 78 | 81 | ||
| @@ -81,6 +84,7 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& | |||
| 81 | event_id = params.value & 0x00FF; | 84 | event_id = params.value & 0x00FF; |
| 82 | if (event_id >= 64) { | 85 | if (event_id >= 64) { |
| 83 | std::memcpy(output.data(), ¶ms, sizeof(params)); | 86 | std::memcpy(output.data(), ¶ms, sizeof(params)); |
| 87 | gpu.Guard(false); | ||
| 84 | return NvResult::BadParameter; | 88 | return NvResult::BadParameter; |
| 85 | } | 89 | } |
| 86 | } else { | 90 | } else { |
| @@ -100,9 +104,11 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& | |||
| 100 | params.value |= event_id; | 104 | params.value |= event_id; |
| 101 | gpu.RegisterEvent(event_id, params.syncpt_id, params.threshold); | 105 | gpu.RegisterEvent(event_id, params.syncpt_id, params.threshold); |
| 102 | std::memcpy(output.data(), ¶ms, sizeof(params)); | 106 | std::memcpy(output.data(), ¶ms, sizeof(params)); |
| 107 | gpu.Guard(false); | ||
| 103 | return NvResult::Timeout; | 108 | return NvResult::Timeout; |
| 104 | } | 109 | } |
| 105 | std::memcpy(output.data(), ¶ms, sizeof(params)); | 110 | std::memcpy(output.data(), ¶ms, sizeof(params)); |
| 111 | gpu.Guard(false); | ||
| 106 | return NvResult::BadParameter; | 112 | return NvResult::BadParameter; |
| 107 | } | 113 | } |
| 108 | 114 | ||