summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2025-01-21 16:07:44 +1000
committerZephyron <zephyron@citron-emu.org>2025-01-21 16:07:44 +1000
commit774d8d9eba6225570689fb4d2a2af73e15c66d6d (patch)
treec2b903aadf79abf3c24ba0a62365e5320829b8ee /src/core/hle
parentd7dc87bbf3a9c515c96f7734df34b31810540c50 (diff)
service/nvdrv: Relax GPU validation and improve error handling
Relaxes validation checks in the NVDRV GPU service and improves error notifier handling to prevent potential hangs. Key changes: - Remove strict size validation in SetErrorNotifier - Relax GPFIFO entry count validation to only check for non-zero values - Add proper error notifier state tracking in GPU class - Improve debug logging messages The previous strict validation was causing issues with some games like ACNH. These changes maintain necessary checks while being more permissive with edge cases that don't impact functionality. Technical changes: - Store error notifier state in GPU class for future implementation - Remove upper bound check on GPFIFO entries - Simplify error notifier setup flow This should resolve hanging issues while maintaining core functionality.
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 88d6c771c..d9458ab2f 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -159,17 +159,11 @@ NvResult nvhost_gpu::SetErrorNotifier(IoctlSetErrorNotifier& params) {
LOG_DEBUG(Service_NVDRV, "called, offset={:X}, size={:X}, mem={:X}", params.offset,
params.size, params.mem);
- // Validate parameters
- if (params.size == 0) {
- return NvResult::BadParameter;
- }
-
- // Store error notifier configuration
error_notifier_offset = params.offset;
error_notifier_size = params.size;
- error_notifier_memory = static_cast<u32_le>(params.mem); // Explicit conversion
+ error_notifier_memory = static_cast<u32_le>(params.mem);
- // Enable error notifications in the GPU
+ // Always enable error notifier in GPU
system.GPU().EnableErrorNotifier(static_cast<u32>(error_notifier_memory),
static_cast<u32>(error_notifier_offset),
static_cast<u32>(error_notifier_size));
@@ -193,9 +187,9 @@ NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params, DeviceFD fd) {
return NvResult::AlreadyAllocated;
}
- // Validate parameters
- if (params.num_entries == 0 || params.num_entries > 0x10000) {
- LOG_ERROR(Service_NVDRV, "Invalid GPFIFO entry count!");
+ // Relax validation to allow any non-zero value
+ if (params.num_entries == 0) {
+ LOG_WARNING(Service_NVDRV, "Zero GPFIFO entries requested");
return NvResult::BadParameter;
}