From a2cc3b10bb6115b17d980fdb83ed5c561835eb3b Mon Sep 17 00:00:00 2001 From: David Marcec Date: Mon, 26 Nov 2018 17:06:13 +1100 Subject: Changed logging to be "Log before execution", Added more error logging, all services should now log on some level --- src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 2 ++ src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 7 +++++++ src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 10 ++++++++++ src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp | 1 + src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp | 1 + src/core/hle/service/nvdrv/devices/nvhost_vic.cpp | 1 + src/core/hle/service/nvdrv/devices/nvmap.cpp | 14 ++++++++++++++ src/core/hle/service/nvdrv/interface.cpp | 6 +++++- 8 files changed, 41 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/nvdrv') diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index c41ef7058..466db7ccd 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -54,6 +54,7 @@ u32 nvhost_as_gpu::InitalizeEx(const std::vector& input, std::vector& ou IoctlInitalizeEx params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size=0x{:X}", params.big_page_size); + return 0; } @@ -191,6 +192,7 @@ u32 nvhost_as_gpu::BindChannel(const std::vector& input, std::vector& ou IoctlBindChannel params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd); + channel = params.fd; return 0; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 792d26e52..d57a54ee8 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -103,6 +103,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector& input, std::vector& u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlActiveSlotMask params{}; if (input.size() > 0) { std::memcpy(¶ms, input.data(), input.size()); @@ -115,6 +116,7 @@ u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector& input, std::vector u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlZcullGetCtxSize params{}; if (input.size() > 0) { std::memcpy(¶ms, input.data(), input.size()); @@ -126,6 +128,7 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector& input, std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlNvgpuGpuZcullGetInfoArgs params{}; if (input.size() > 0) { @@ -148,6 +151,7 @@ u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector& input, std::vector& u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector& input, std::vector& output) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IoctlZbcSetTable params{}; std::memcpy(¶ms, input.data(), input.size()); // TODO(ogniK): What does this even actually do? @@ -157,6 +161,7 @@ u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector& input, std::vector& u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector& input, std::vector& output) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IoctlZbcQueryTable params{}; std::memcpy(¶ms, input.data(), input.size()); // TODO : To implement properly @@ -166,6 +171,7 @@ u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector& input, std::vector u32 nvhost_ctrl_gpu::FlushL2(const std::vector& input, std::vector& output) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IoctlFlushL2 params{}; std::memcpy(¶ms, input.data(), input.size()); // TODO : To implement properly @@ -175,6 +181,7 @@ u32 nvhost_ctrl_gpu::FlushL2(const std::vector& input, std::vector& outp u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlGetGpuTime params{}; std::memcpy(¶ms, input.data(), input.size()); params.gpu_time = CoreTiming::cyclesToNs(CoreTiming::GetTicks()); diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 874d5e1c3..dbeb26547 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp @@ -61,12 +61,14 @@ u32 nvhost_gpu::SetNVMAPfd(const std::vector& input, std::vector& output IoctlSetNvmapFD params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); + nvmap_fd = params.nvmap_fd; return 0; } u32 nvhost_gpu::SetClientData(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlClientData params{}; std::memcpy(¶ms, input.data(), input.size()); user_data = params.data; @@ -75,6 +77,7 @@ u32 nvhost_gpu::SetClientData(const std::vector& input, std::vector& out u32 nvhost_gpu::GetClientData(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called"); + IoctlClientData params{}; std::memcpy(¶ms, input.data(), input.size()); params.data = user_data; @@ -86,6 +89,7 @@ u32 nvhost_gpu::ZCullBind(const std::vector& input, std::vector& output) std::memcpy(&zcull_params, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va, zcull_params.mode); + std::memcpy(output.data(), &zcull_params, output.size()); return 0; } @@ -95,6 +99,7 @@ u32 nvhost_gpu::SetErrorNotifier(const std::vector& input, std::vector& std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset, params.size, params.mem); + std::memcpy(output.data(), ¶ms, output.size()); return 0; } @@ -102,6 +107,7 @@ u32 nvhost_gpu::SetErrorNotifier(const std::vector& input, std::vector& u32 nvhost_gpu::SetChannelPriority(const std::vector& input, std::vector& output) { std::memcpy(&channel_priority, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "(STUBBED) called, priority={:X}", channel_priority); + return 0; } @@ -113,6 +119,7 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector& input, std::vector& ou "unk1={:X}, unk2={:X}, unk3={:X}", params.num_entries, params.flags, params.unk0, params.unk1, params.unk2, params.unk3); + params.fence_out.id = 0; params.fence_out.value = 0; std::memcpy(output.data(), ¶ms, output.size()); @@ -124,6 +131,7 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector& input, std::vector< std::memcpy(¶ms, input.data(), input.size()); LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num, params.flags); + params.obj_id = 0x0; std::memcpy(output.data(), ¶ms, output.size()); return 0; @@ -179,6 +187,7 @@ u32 nvhost_gpu::GetWaitbase(const std::vector& input, std::vector& outpu IoctlGetWaitbase params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlGetWaitbase)); LOG_INFO(Service_NVDRV, "called, unknown=0x{:X}", params.unknown); + params.value = 0; // Seems to be hard coded at 0 std::memcpy(output.data(), ¶ms, output.size()); return 0; @@ -188,6 +197,7 @@ u32 nvhost_gpu::ChannelSetTimeout(const std::vector& input, std::vector& IoctlChannelSetTimeout params{}; std::memcpy(¶ms, input.data(), sizeof(IoctlChannelSetTimeout)); LOG_INFO(Service_NVDRV, "called, timeout=0x{:X}", params.timeout); + return 0; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 46dbbc37c..f5e8ea7c3 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -30,6 +30,7 @@ u32 nvhost_nvdec::SetNVMAPfd(const std::vector& input, std::vector& outp IoctlSetNvmapFD params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); + nvmap_fd = params.nvmap_fd; return 0; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp index c67f934f6..3e0951ab0 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp @@ -30,6 +30,7 @@ u32 nvhost_nvjpg::SetNVMAPfd(const std::vector& input, std::vector& outp IoctlSetNvmapFD params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); + nvmap_fd = params.nvmap_fd; return 0; } diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp index 727b9fee4..d544f0f31 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp @@ -30,6 +30,7 @@ u32 nvhost_vic::SetNVMAPfd(const std::vector& input, std::vector& output IoctlSetNvmapFD params{}; std::memcpy(¶ms, input.data(), input.size()); LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); + nvmap_fd = params.nvmap_fd; return 0; } diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp index 43651d8a6..85ba5d4b7 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.cpp +++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp @@ -54,6 +54,7 @@ u32 nvmap::IocCreate(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "size=0x{:08X}", params.size); if (!params.size) { + LOG_ERROR(Service_NVDRV, "Size is 0"); return static_cast(NvErrCodes::InvalidValue); } // Create a new nvmap object and obtain a handle to it. @@ -78,10 +79,12 @@ u32 nvmap::IocAlloc(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called, addr={:X}", params.addr); if (!params.handle) { + LOG_ERROR(Service_NVDRV, "Handle is zero"); return static_cast(NvErrCodes::InvalidValue); } if ((params.align - 1) & params.align) { + LOG_ERROR(Service_NVDRV, "Incorrect alignment"); return static_cast(NvErrCodes::InvalidValue); } @@ -92,10 +95,12 @@ u32 nvmap::IocAlloc(const std::vector& input, std::vector& output) { auto object = GetObject(params.handle); if (!object) { + LOG_ERROR(Service_NVDRV, "Object does not exist"); return static_cast(NvErrCodes::InvalidValue); } if (object->status == Object::Status::Allocated) { + LOG_ERROR(Service_NVDRV, "Object is already allocated"); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -116,11 +121,13 @@ u32 nvmap::IocGetId(const std::vector& input, std::vector& output) { LOG_WARNING(Service_NVDRV, "called"); if (!params.handle) { + LOG_ERROR(Service_NVDRV, "Handle is zero"); return static_cast(NvErrCodes::InvalidValue); } auto object = GetObject(params.handle); if (!object) { + LOG_ERROR(Service_NVDRV, "Object does not exist"); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -139,11 +146,13 @@ u32 nvmap::IocFromId(const std::vector& input, std::vector& output) { auto itr = std::find_if(handles.begin(), handles.end(), [&](const auto& entry) { return entry.second->id == params.id; }); if (itr == handles.end()) { + LOG_ERROR(Service_NVDRV, "Object does not exist"); return static_cast(NvErrCodes::InvalidValue); } auto& object = itr->second; if (object->status != Object::Status::Allocated) { + LOG_ERROR(Service_NVDRV, "Object is not allocated"); return static_cast(NvErrCodes::InvalidValue); } @@ -166,10 +175,12 @@ u32 nvmap::IocParam(const std::vector& input, std::vector& output) { auto object = GetObject(params.handle); if (!object) { + LOG_ERROR(Service_NVDRV, "Object does not exist"); return static_cast(NvErrCodes::InvalidValue); } if (object->status != Object::Status::Allocated) { + LOG_ERROR(Service_NVDRV, "Object is not allocated"); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -209,9 +220,12 @@ u32 nvmap::IocFree(const std::vector& input, std::vector& output) { auto itr = handles.find(params.handle); if (itr == handles.end()) { + LOG_ERROR(Service_NVDRV, "Object does not exist"); return static_cast(NvErrCodes::InvalidValue); } if (!itr->second->refcount) { + LOG_ERROR(Service_NVDRV, + "There is no references to this object. The object is already freed"); return static_cast(NvErrCodes::InvalidValue); } diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index 602086eed..ff76e0524 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp @@ -55,6 +55,7 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) { void NVDRV::Initialize(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(0); @@ -75,8 +76,8 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) { void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; pid = rp.Pop(); - LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid); + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(0); @@ -84,12 +85,14 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_NVDRV, "(STUBBED) called"); + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } @@ -98,6 +101,7 @@ void NVDRV::DumpGraphicsMemoryInfo(Kernel::HLERequestContext& ctx) { // According to SwitchBrew, this has no inputs and no outputs, so effectively does nothing on // retail hardware. LOG_DEBUG(Service_NVDRV, "called"); + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } -- cgit v1.2.3 From 3d627df4d8a682d39e94116b0fc094b752d8d49f Mon Sep 17 00:00:00 2001 From: David Marcec Date: Mon, 26 Nov 2018 20:05:09 +1100 Subject: Improved error messages in AM, HwOpus and NvMap --- src/core/hle/service/am/am.cpp | 15 +++++++++------ src/core/hle/service/audio/hwopus.cpp | 24 ++++++++++++++++-------- src/core/hle/service/nvdrv/devices/nvmap.cpp | 26 ++++++++++++++------------ 3 files changed, 39 insertions(+), 26 deletions(-) (limited to 'src/core/hle/service/nvdrv') diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 0bd52b602..f6757adab 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -616,7 +616,7 @@ private: const auto storage = applet->GetBroker().PopNormalDataToGame(); if (storage == nullptr) { - LOG_ERROR(Service_AM, "storage is a nullptr"); + LOG_ERROR(Service_AM, "storage is a nullptr. There is no data in the current channel"); rb.Push(ERR_NO_DATA_IN_CHANNEL); return; @@ -647,7 +647,7 @@ private: const auto storage = applet->GetBroker().PopInteractiveDataToGame(); if (storage == nullptr) { - LOG_ERROR(Service_AM, "storage is a nullptr"); + LOG_ERROR(Service_AM, "storage is a nullptr. There is no data in the current channel"); rb.Push(ERR_NO_DATA_IN_CHANNEL); return; @@ -718,7 +718,9 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) { const std::vector data{ctx.ReadBuffer()}; if (data.size() > backing.buffer.size() - offset) { - LOG_ERROR(Service_AM, "offset is out of bounds"); + LOG_ERROR(Service_AM, + "offset is out of bounds, backing_buffer_sz={}, data_size={}, offset={}", + backing.buffer.size(), data.size(), offset); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ERR_SIZE_OUT_OF_BOUNDS); @@ -739,7 +741,8 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { const std::size_t size{ctx.GetWriteBufferSize()}; if (size > backing.buffer.size() - offset) { - LOG_ERROR(Service_AM, "offset is out of bounds"); + LOG_ERROR(Service_AM, "offset is out of bounds, backing_buffer_sz={}, size={}, offset={}", + backing.buffer.size(), size, offset); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ERR_SIZE_OUT_OF_BOUNDS); @@ -787,7 +790,7 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) const auto applet = GetAppletFromId(applet_id); if (applet == nullptr) { - LOG_ERROR(Service_AM, "Applet doesn't exist!"); + LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", static_cast(applet_id)); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); @@ -825,7 +828,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex handle); if (shared_mem == nullptr) { - LOG_ERROR(Service_AM, "shared_mem is a nullpr"); + LOG_ERROR(Service_AM, "shared_mem is a nullpr for handle={:08X}", handle); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); return; diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index 832159394..5e3672dbd 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp @@ -95,13 +95,15 @@ private: const auto start_time = std::chrono::high_resolution_clock::now(); std::size_t raw_output_sz = output.size() * sizeof(opus_int16); if (sizeof(OpusHeader) > input.size()) { - LOG_ERROR(Audio, "Input is smaller than the header size"); + LOG_ERROR(Audio, "Input is smaller than the header size, header_sz={}, input_sz={}", + sizeof(OpusHeader), input.size()); return false; } OpusHeader hdr{}; std::memcpy(&hdr, input.data(), sizeof(OpusHeader)); if (sizeof(OpusHeader) + static_cast(hdr.sz) > input.size()) { - LOG_ERROR(Audio, "Input does not fit in the opus header size"); + LOG_ERROR(Audio, "Input does not fit in the opus header size. data_sz={}, input_sz={}", + sizeof(OpusHeader) + static_cast(hdr.sz), input.size()); return false; } auto frame = input.data() + sizeof(OpusHeader); @@ -109,14 +111,20 @@ private: frame, static_cast(input.size() - sizeof(OpusHeader)), static_cast(sample_rate)); if (decoded_sample_count * channel_count * sizeof(u16) > raw_output_sz) { - LOG_ERROR(Audio, "Decoded data does not fit into the output data"); + LOG_ERROR( + Audio, + "Decoded data does not fit into the output data, decoded_sz={}, raw_output_sz={}", + decoded_sample_count * channel_count * sizeof(u16), raw_output_sz); return false; } + const int frame_size = (static_cast(raw_output_sz / sizeof(s16) / channel_count)); auto out_sample_count = - opus_decode(decoder.get(), frame, hdr.sz, output.data(), - (static_cast(raw_output_sz / sizeof(s16) / channel_count)), 0); + opus_decode(decoder.get(), frame, hdr.sz, output.data(), frame_size, 0); if (out_sample_count < 0) { - LOG_ERROR(Audio, "Incorrect sample count received from opus_decode"); + LOG_ERROR(Audio, + "Incorrect sample count received from opus_decode, " + "output_sample_count={}, frame_size={}, data_sz_from_hdr={}", + out_sample_count, frame_size, hdr.sz); return false; } const auto end_time = std::chrono::high_resolution_clock::now() - start_time; @@ -181,8 +189,8 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) { ASSERT_MSG(buffer_sz >= worker_sz, "Worker buffer too large"); std::unique_ptr decoder{ static_cast(operator new(worker_sz))}; - if (opus_decoder_init(decoder.get(), sample_rate, channel_count)) { - LOG_ERROR(Audio, "Failed to init opus decoder"); + if (const int err = opus_decoder_init(decoder.get(), sample_rate, channel_count)) { + LOG_ERROR(Audio, "Failed to init opus decoder with error={}", err); IPC::ResponseBuilder rb{ctx, 2}; // TODO(ogniK): Use correct error code rb.Push(ResultCode(-1)); diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp index 85ba5d4b7..1ec796fc6 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.cpp +++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp @@ -79,12 +79,12 @@ u32 nvmap::IocAlloc(const std::vector& input, std::vector& output) { LOG_DEBUG(Service_NVDRV, "called, addr={:X}", params.addr); if (!params.handle) { - LOG_ERROR(Service_NVDRV, "Handle is zero"); + LOG_ERROR(Service_NVDRV, "Handle is 0"); return static_cast(NvErrCodes::InvalidValue); } if ((params.align - 1) & params.align) { - LOG_ERROR(Service_NVDRV, "Incorrect alignment"); + LOG_ERROR(Service_NVDRV, "Incorrect alignment used, alignment={:08X}", params.align); return static_cast(NvErrCodes::InvalidValue); } @@ -95,12 +95,12 @@ u32 nvmap::IocAlloc(const std::vector& input, std::vector& output) { auto object = GetObject(params.handle); if (!object) { - LOG_ERROR(Service_NVDRV, "Object does not exist"); + LOG_ERROR(Service_NVDRV, "Object does not exist, handle={:08X}", params.handle); return static_cast(NvErrCodes::InvalidValue); } if (object->status == Object::Status::Allocated) { - LOG_ERROR(Service_NVDRV, "Object is already allocated"); + LOG_ERROR(Service_NVDRV, "Object is already allocated, handle={:08X}", params.handle); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -127,7 +127,7 @@ u32 nvmap::IocGetId(const std::vector& input, std::vector& output) { auto object = GetObject(params.handle); if (!object) { - LOG_ERROR(Service_NVDRV, "Object does not exist"); + LOG_ERROR(Service_NVDRV, "Object does not exist, handle={:08X}", params.handle); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -146,13 +146,13 @@ u32 nvmap::IocFromId(const std::vector& input, std::vector& output) { auto itr = std::find_if(handles.begin(), handles.end(), [&](const auto& entry) { return entry.second->id == params.id; }); if (itr == handles.end()) { - LOG_ERROR(Service_NVDRV, "Object does not exist"); + LOG_ERROR(Service_NVDRV, "Object does not exist, handle={:08X}", params.handle); return static_cast(NvErrCodes::InvalidValue); } auto& object = itr->second; if (object->status != Object::Status::Allocated) { - LOG_ERROR(Service_NVDRV, "Object is not allocated"); + LOG_ERROR(Service_NVDRV, "Object is not allocated, handle={:08X}", params.handle); return static_cast(NvErrCodes::InvalidValue); } @@ -175,12 +175,12 @@ u32 nvmap::IocParam(const std::vector& input, std::vector& output) { auto object = GetObject(params.handle); if (!object) { - LOG_ERROR(Service_NVDRV, "Object does not exist"); + LOG_ERROR(Service_NVDRV, "Object does not exist, handle={:08X}", params.handle); return static_cast(NvErrCodes::InvalidValue); } if (object->status != Object::Status::Allocated) { - LOG_ERROR(Service_NVDRV, "Object is not allocated"); + LOG_ERROR(Service_NVDRV, "Object is not allocated, handle={:08X}", params.handle); return static_cast(NvErrCodes::OperationNotPermitted); } @@ -220,12 +220,14 @@ u32 nvmap::IocFree(const std::vector& input, std::vector& output) { auto itr = handles.find(params.handle); if (itr == handles.end()) { - LOG_ERROR(Service_NVDRV, "Object does not exist"); + LOG_ERROR(Service_NVDRV, "Object does not exist, handle={:08X}", params.handle); return static_cast(NvErrCodes::InvalidValue); } if (!itr->second->refcount) { - LOG_ERROR(Service_NVDRV, - "There is no references to this object. The object is already freed"); + LOG_ERROR( + Service_NVDRV, + "There is no references to this object. The object is already freed. handle={:08X}", + params.handle); return static_cast(NvErrCodes::InvalidValue); } -- cgit v1.2.3