summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-06 01:16:13 +0200
committerGitHub <noreply@github.com>2021-05-06 01:16:13 +0200
commit260b841dc30e642d00cff993276f2d9dc91fe04c (patch)
treec9aa120646b8c1486f3a0174d135c547db8f3585
parentMerge pull request #6283 from lioncash/unused-fields (diff)
parentUpdate src/core/hle/service/nvdrv/interface.cpp (diff)
downloadyuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar.gz
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar.bz2
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar.lz
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar.xz
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.tar.zst
yuzu-260b841dc30e642d00cff993276f2d9dc91fe04c.zip
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index 2e1150867..eff9c3cc9 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -22,19 +22,30 @@ void NVDRV::SignalGPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_NVDRV, "called");
+ IPC::ResponseBuilder rb{ctx, 4};
+ rb.Push(RESULT_SUCCESS);
if (!is_initialized) {
- ServiceError(ctx, NvResult::NotInitialized);
+ rb.Push<DeviceFD>(0);
+ rb.PushEnum(NvResult::NotInitialized);
+
LOG_ERROR(Service_NVDRV, "NvServices is not initalized!");
return;
}
const auto& buffer = ctx.ReadBuffer();
const std::string device_name(buffer.begin(), buffer.end());
+
+ if (device_name == "/dev/nvhost-prof-gpu") {
+ rb.Push<DeviceFD>(0);
+ rb.PushEnum(NvResult::NotSupported);
+
+ LOG_WARNING(Service_NVDRV, "/dev/nvhost-prof-gpu cannot be opened in production");
+ return;
+ }
+
DeviceFD fd = nvdrv->Open(device_name);
- IPC::ResponseBuilder rb{ctx, 4};
- rb.Push(RESULT_SUCCESS);
rb.Push<DeviceFD>(fd);
rb.PushEnum(fd != INVALID_NVDRV_FD ? NvResult::Success : NvResult::FileOperationFailed);
}