mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 18:22:47 +01:00
Merge pull request #6279 from ogniK5377/nvhost-prof
nvdrv: /dev/nvhost-prof-gpu for production
This commit is contained in:
commit
260b841dc3
1 changed files with 14 additions and 3 deletions
|
@ -22,19 +22,30 @@ void NVDRV::SignalGPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
|
||||||
|
|
||||||
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
|
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_NVDRV, "called");
|
LOG_DEBUG(Service_NVDRV, "called");
|
||||||
|
IPC::ResponseBuilder rb{ctx, 4};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
|
||||||
if (!is_initialized) {
|
if (!is_initialized) {
|
||||||
ServiceError(ctx, NvResult::NotInitialized);
|
rb.Push<DeviceFD>(0);
|
||||||
|
rb.PushEnum(NvResult::NotInitialized);
|
||||||
|
|
||||||
LOG_ERROR(Service_NVDRV, "NvServices is not initalized!");
|
LOG_ERROR(Service_NVDRV, "NvServices is not initalized!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& buffer = ctx.ReadBuffer();
|
const auto& buffer = ctx.ReadBuffer();
|
||||||
const std::string device_name(buffer.begin(), buffer.end());
|
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);
|
DeviceFD fd = nvdrv->Open(device_name);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 4};
|
|
||||||
rb.Push(RESULT_SUCCESS);
|
|
||||||
rb.Push<DeviceFD>(fd);
|
rb.Push<DeviceFD>(fd);
|
||||||
rb.PushEnum(fd != INVALID_NVDRV_FD ? NvResult::Success : NvResult::FileOperationFailed);
|
rb.PushEnum(fd != INVALID_NVDRV_FD ? NvResult::Success : NvResult::FileOperationFailed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue