[nvdrv] Implement SetErrorNotifier
Implements SetErrorNotifier() based on Switch kernel behavior. Only mem is used; other fields are ignored. Guest misuse of offset or size is logged as an error and rejected. Games like Super Mario Odyssey or Xenoblade may use this mechanism to detect timeouts.
This commit is contained in:
parent
4ea9664ff4
commit
f2a57a8553
2 changed files with 17 additions and 3 deletions
|
@ -161,8 +161,21 @@ NvResult nvhost_gpu::ZCullBind(IoctlZCullBind& params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
NvResult nvhost_gpu::SetErrorNotifier(IoctlSetErrorNotifier& params) {
|
NvResult nvhost_gpu::SetErrorNotifier(IoctlSetErrorNotifier& params) {
|
||||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset,
|
if (params.mem == 0) {
|
||||||
params.size, params.mem);
|
LOG_DEBUG(Service_NVDRV, "called, SetErrorNotifier deinitialized");
|
||||||
|
error_notifier_mem = 0;
|
||||||
|
return NvResult::Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.offset != 0 || params.size != 0) {
|
||||||
|
LOG_ERROR(Service_NVDRV,
|
||||||
|
"called, SetErrorNotifier received non-zero offset/size (ignored): offset=0x{:X}, size=0x{:X}",
|
||||||
|
params.offset, params.size);
|
||||||
|
return NvResult::BadParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_NVDRV, "called, SetErrorNotifier initialized, mem=0x{:X}", params.mem);
|
||||||
|
error_notifier_mem = params.mem;
|
||||||
return NvResult::Success;
|
return NvResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +241,7 @@ NvResult nvhost_gpu::AllocateObjectContext(IoctlAllocObjCtx& params) {
|
||||||
return NvResult::NotInitialized;
|
return NvResult::NotInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (static_cast<CtxClasses>(params.class_num)) {
|
switch (static_cast<CtxClasses>(params.class_num)) {
|
||||||
case CtxClasses::Ctx2D:
|
case CtxClasses::Ctx2D:
|
||||||
case CtxClasses::Ctx3D:
|
case CtxClasses::Ctx3D:
|
||||||
case CtxClasses::CtxCompute:
|
case CtxClasses::CtxCompute:
|
||||||
|
|
|
@ -172,6 +172,7 @@ private:
|
||||||
s32_le nvmap_fd{};
|
s32_le nvmap_fd{};
|
||||||
u64_le user_data{};
|
u64_le user_data{};
|
||||||
IoctlZCullBind zcull_params{};
|
IoctlZCullBind zcull_params{};
|
||||||
|
u32_le error_notifier_mem{};
|
||||||
std::vector<IoctlAllocObjCtx> ctxObj_params{};
|
std::vector<IoctlAllocObjCtx> ctxObj_params{};
|
||||||
u32_le channel_priority{};
|
u32_le channel_priority{};
|
||||||
u32_le channel_timeslice{};
|
u32_le channel_timeslice{};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue