diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/nvdrv/interface.cpp | 17 |
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) { | |||
| 22 | 22 | ||
| 23 | void NVDRV::Open(Kernel::HLERequestContext& ctx) { | 23 | void NVDRV::Open(Kernel::HLERequestContext& ctx) { |
| 24 | LOG_DEBUG(Service_NVDRV, "called"); | 24 | LOG_DEBUG(Service_NVDRV, "called"); |
| 25 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 26 | rb.Push(RESULT_SUCCESS); | ||
| 25 | 27 | ||
| 26 | if (!is_initialized) { | 28 | if (!is_initialized) { |
| 27 | ServiceError(ctx, NvResult::NotInitialized); | 29 | rb.Push<DeviceFD>(0); |
| 30 | rb.PushEnum(NvResult::NotInitialized); | ||
| 31 | |||
| 28 | LOG_ERROR(Service_NVDRV, "NvServices is not initalized!"); | 32 | LOG_ERROR(Service_NVDRV, "NvServices is not initalized!"); |
| 29 | return; | 33 | return; |
| 30 | } | 34 | } |
| 31 | 35 | ||
| 32 | const auto& buffer = ctx.ReadBuffer(); | 36 | const auto& buffer = ctx.ReadBuffer(); |
| 33 | const std::string device_name(buffer.begin(), buffer.end()); | 37 | const std::string device_name(buffer.begin(), buffer.end()); |
| 38 | |||
| 39 | if (device_name == "/dev/nvhost-prof-gpu") { | ||
| 40 | rb.Push<DeviceFD>(0); | ||
| 41 | rb.PushEnum(NvResult::NotSupported); | ||
| 42 | |||
| 43 | LOG_WARNING(Service_NVDRV, "/dev/nvhost-prof-gpu cannot be opened in production"); | ||
| 44 | return; | ||
| 45 | } | ||
| 46 | |||
| 34 | DeviceFD fd = nvdrv->Open(device_name); | 47 | DeviceFD fd = nvdrv->Open(device_name); |
| 35 | 48 | ||
| 36 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 37 | rb.Push(RESULT_SUCCESS); | ||
| 38 | rb.Push<DeviceFD>(fd); | 49 | rb.Push<DeviceFD>(fd); |
| 39 | rb.PushEnum(fd != INVALID_NVDRV_FD ? NvResult::Success : NvResult::FileOperationFailed); | 50 | rb.PushEnum(fd != INVALID_NVDRV_FD ? NvResult::Success : NvResult::FileOperationFailed); |
| 40 | } | 51 | } |