mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	nvdrv: Move logging macros over to new fmt-compatible ones
This commit is contained in:
		
							parent
							
								
									022fc59dcd
								
							
						
					
					
						commit
						285d8d8b7d
					
				@ -20,9 +20,9 @@ u32 nvdisp_disp0::ioctl(Ioctl command, const std::vector<u8>& input, std::vector
 | 
				
			|||||||
void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u32 height,
 | 
					void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u32 height,
 | 
				
			||||||
                        u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) {
 | 
					                        u32 stride, NVFlinger::BufferQueue::BufferTransformFlags transform) {
 | 
				
			||||||
    VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle);
 | 
					    VAddr addr = nvmap_dev->GetObjectAddress(buffer_handle);
 | 
				
			||||||
    LOG_WARNING(Service,
 | 
					    NGLOG_WARNING(Service,
 | 
				
			||||||
                "Drawing from address %lx offset %08X Width %u Height %u Stride %u Format %u", addr,
 | 
					                  "Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}",
 | 
				
			||||||
                offset, width, height, stride, format);
 | 
					                  addr, offset, width, height, stride, format);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    using PixelFormat = Tegra::FramebufferConfig::PixelFormat;
 | 
					    using PixelFormat = Tegra::FramebufferConfig::PixelFormat;
 | 
				
			||||||
    const Tegra::FramebufferConfig framebuffer{
 | 
					    const Tegra::FramebufferConfig framebuffer{
 | 
				
			||||||
 | 
				
			|||||||
@ -12,8 +12,8 @@
 | 
				
			|||||||
namespace Service::Nvidia::Devices {
 | 
					namespace Service::Nvidia::Devices {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, command={:#010X}, input_size={:#X}, output_size={:#X}",
 | 
				
			||||||
              command.raw, input.size(), output.size());
 | 
					                command.raw, input.size(), output.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
					    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
				
			||||||
    case IoctlCommand::IocInitalizeExCommand:
 | 
					    case IoctlCommand::IocInitalizeExCommand:
 | 
				
			||||||
@ -38,7 +38,7 @@ u32 nvhost_as_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vecto
 | 
				
			|||||||
u32 nvhost_as_gpu::InitalizeEx(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_as_gpu::InitalizeEx(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlInitalizeEx params{};
 | 
					    IoctlInitalizeEx params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size=0x%x", params.big_page_size);
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size={:#X}", params.big_page_size);
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -46,8 +46,8 @@ u32 nvhost_as_gpu::InitalizeEx(const std::vector<u8>& input, std::vector<u8>& ou
 | 
				
			|||||||
u32 nvhost_as_gpu::AllocateSpace(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_as_gpu::AllocateSpace(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlAllocSpace params{};
 | 
					    IoctlAllocSpace params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, pages=%x, page_size=%x, flags=%x", params.pages,
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, pages={:X}, page_size={:X}, flags={:X}", params.pages,
 | 
				
			||||||
              params.page_size, params.flags);
 | 
					                params.page_size, params.flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto& gpu = Core::System::GetInstance().GPU();
 | 
					    auto& gpu = Core::System::GetInstance().GPU();
 | 
				
			||||||
    const u64 size{static_cast<u64>(params.pages) * static_cast<u64>(params.page_size)};
 | 
					    const u64 size{static_cast<u64>(params.pages) * static_cast<u64>(params.page_size)};
 | 
				
			||||||
@ -95,11 +95,11 @@ u32 nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8>& ou
 | 
				
			|||||||
    IoctlMapBufferEx params{};
 | 
					    IoctlMapBufferEx params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV,
 | 
					    NGLOG_DEBUG(Service_NVDRV,
 | 
				
			||||||
              "called, flags=%x, nvmap_handle=%x, buffer_offset=%" PRIu64 ", mapping_size=%" PRIu64
 | 
					                "called, flags={:X}, nvmap_handle={:X}, buffer_offset={}, mapping_size={}"
 | 
				
			||||||
              ", offset=%" PRIu64,
 | 
					                ", offset={}",
 | 
				
			||||||
              params.flags, params.nvmap_handle, params.buffer_offset, params.mapping_size,
 | 
					                params.flags, params.nvmap_handle, params.buffer_offset, params.mapping_size,
 | 
				
			||||||
              params.offset);
 | 
					                params.offset);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!params.nvmap_handle) {
 | 
					    if (!params.nvmap_handle) {
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
@ -133,7 +133,7 @@ u32 nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8>& ou
 | 
				
			|||||||
u32 nvhost_as_gpu::BindChannel(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_as_gpu::BindChannel(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlBindChannel params{};
 | 
					    IoctlBindChannel params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, fd=%x", params.fd);
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd);
 | 
				
			||||||
    channel = params.fd;
 | 
					    channel = params.fd;
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
@ -142,8 +142,8 @@ u32 nvhost_as_gpu::BindChannel(const std::vector<u8>& input, std::vector<u8>& ou
 | 
				
			|||||||
u32 nvhost_as_gpu::GetVARegions(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_as_gpu::GetVARegions(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlGetVaRegions params{};
 | 
					    IoctlGetVaRegions params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, buf_addr=%" PRIu64 ", buf_size=%x",
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, buf_addr={:X}, buf_size={:X}", params.buf_addr,
 | 
				
			||||||
                params.buf_addr, params.buf_size);
 | 
					                  params.buf_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    params.buf_size = 0x30;
 | 
					    params.buf_size = 0x30;
 | 
				
			||||||
    params.regions[0].offset = 0x04000000;
 | 
					    params.regions[0].offset = 0x04000000;
 | 
				
			||||||
 | 
				
			|||||||
@ -9,8 +9,8 @@
 | 
				
			|||||||
namespace Service::Nvidia::Devices {
 | 
					namespace Service::Nvidia::Devices {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, command={:#010X}, input_size={:#X}, output_size={:#X}",
 | 
				
			||||||
              command.raw, input.size(), output.size());
 | 
					                command.raw, input.size(), output.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
					    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
				
			||||||
    case IoctlCommand::IocGetConfigCommand:
 | 
					    case IoctlCommand::IocGetConfigCommand:
 | 
				
			||||||
@ -25,8 +25,8 @@ u32 nvhost_ctrl::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<
 | 
				
			|||||||
u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IocGetConfigParams params{};
 | 
					    IocGetConfigParams params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, setting=%s!%s", params.domain_str.data(),
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, setting={}!{}", params.domain_str.data(),
 | 
				
			||||||
              params.param_str.data());
 | 
					                params.param_str.data());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strcmp(params.domain_str.data(), "nv")) {
 | 
					    if (!strcmp(params.domain_str.data(), "nv")) {
 | 
				
			||||||
        if (!strcmp(params.param_str.data(), "NV_MEMORY_PROFILER")) {
 | 
					        if (!strcmp(params.param_str.data(), "NV_MEMORY_PROFILER")) {
 | 
				
			||||||
@ -48,8 +48,8 @@ u32 nvhost_ctrl::NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>&
 | 
				
			|||||||
u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IocCtrlEventWaitParams params{};
 | 
					    IocCtrlEventWaitParams params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, syncpt_id=%u threshold=%u timeout=%d",
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, syncpt_id={} threshold={} timeout={}",
 | 
				
			||||||
                params.syncpt_id, params.threshold, params.timeout);
 | 
					                  params.syncpt_id, params.threshold, params.timeout);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO(Subv): Implement actual syncpt waiting.
 | 
					    // TODO(Subv): Implement actual syncpt waiting.
 | 
				
			||||||
    params.value = 0;
 | 
					    params.value = 0;
 | 
				
			||||||
 | 
				
			|||||||
@ -10,8 +10,8 @@
 | 
				
			|||||||
namespace Service::Nvidia::Devices {
 | 
					namespace Service::Nvidia::Devices {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, command={:#010X}, input_size={:#X}, output_size={:#X}",
 | 
				
			||||||
              command.raw, input.size(), output.size());
 | 
					                command.raw, input.size(), output.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
					    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
				
			||||||
    case IoctlCommand::IocGetCharacteristicsCommand:
 | 
					    case IoctlCommand::IocGetCharacteristicsCommand:
 | 
				
			||||||
@ -30,7 +30,7 @@ u32 nvhost_ctrl_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vec
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl_gpu::GetCharacteristics(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::GetCharacteristics(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlCharacteristics params{};
 | 
					    IoctlCharacteristics params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    params.gc.arch = 0x120;
 | 
					    params.gc.arch = 0x120;
 | 
				
			||||||
@ -77,14 +77,14 @@ u32 nvhost_ctrl_gpu::GetCharacteristics(const std::vector<u8>& input, std::vecto
 | 
				
			|||||||
u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlGpuGetTpcMasksArgs params{};
 | 
					    IoctlGpuGetTpcMasksArgs params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, mask=0x%x, mask_buf_addr=0x%" PRIx64,
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, mask={:#X}, mask_buf_addr={:#X}",
 | 
				
			||||||
                params.mask_buf_size, params.mask_buf_addr);
 | 
					                  params.mask_buf_size, params.mask_buf_addr);
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, sizeof(params));
 | 
					    std::memcpy(output.data(), ¶ms, sizeof(params));
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlActiveSlotMask params{};
 | 
					    IoctlActiveSlotMask params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    params.slot = 0x07;
 | 
					    params.slot = 0x07;
 | 
				
			||||||
@ -94,7 +94,7 @@ u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlZcullGetCtxSize params{};
 | 
					    IoctlZcullGetCtxSize params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    params.size = 0x1;
 | 
					    params.size = 0x1;
 | 
				
			||||||
@ -103,7 +103,7 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlNvgpuGpuZcullGetInfoArgs params{};
 | 
					    IoctlNvgpuGpuZcullGetInfoArgs params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    params.width_align_pixels = 0x20;
 | 
					    params.width_align_pixels = 0x20;
 | 
				
			||||||
 | 
				
			|||||||
@ -12,8 +12,8 @@
 | 
				
			|||||||
namespace Service::Nvidia::Devices {
 | 
					namespace Service::Nvidia::Devices {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, command=0x%08x, input_size=0x%zx, output_size=0x%zx",
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, command={:#010X}, input_size={:#X}, output_size={:#X}",
 | 
				
			||||||
              command.raw, input.size(), output.size());
 | 
					                command.raw, input.size(), output.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
					    switch (static_cast<IoctlCommand>(command.raw)) {
 | 
				
			||||||
    case IoctlCommand::IocSetNVMAPfdCommand:
 | 
					    case IoctlCommand::IocSetNVMAPfdCommand:
 | 
				
			||||||
@ -47,14 +47,14 @@ u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u
 | 
				
			|||||||
u32 nvhost_gpu::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlSetNvmapFD params{};
 | 
					    IoctlSetNvmapFD params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, fd=%x", params.nvmap_fd);
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
 | 
				
			||||||
    nvmap_fd = params.nvmap_fd;
 | 
					    nvmap_fd = params.nvmap_fd;
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlClientData params{};
 | 
					    IoctlClientData params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    user_data = params.data;
 | 
					    user_data = params.data;
 | 
				
			||||||
@ -63,7 +63,7 @@ u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& out
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
    IoctlClientData params{};
 | 
					    IoctlClientData params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    params.data = user_data;
 | 
					    params.data = user_data;
 | 
				
			||||||
@ -73,8 +73,8 @@ u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& out
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    std::memcpy(&zcull_params, input.data(), input.size());
 | 
					    std::memcpy(&zcull_params, input.data(), input.size());
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, gpu_va=%" PRIx64 ", mode=%x", zcull_params.gpu_va,
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va,
 | 
				
			||||||
              zcull_params.mode);
 | 
					                zcull_params.mode);
 | 
				
			||||||
    std::memcpy(output.data(), &zcull_params, output.size());
 | 
					    std::memcpy(output.data(), &zcull_params, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -82,15 +82,15 @@ u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output)
 | 
				
			|||||||
u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlSetErrorNotifier params{};
 | 
					    IoctlSetErrorNotifier params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset=%" PRIx64 ", size=%" PRIx64 ", mem=%x",
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}",
 | 
				
			||||||
                params.offset, params.size, params.mem);
 | 
					                  params.offset, params.size, params.mem);
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 nvhost_gpu::SetChannelPriority(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::SetChannelPriority(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    std::memcpy(&channel_priority, input.data(), input.size());
 | 
					    std::memcpy(&channel_priority, input.data(), input.size());
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "(STUBBED) called, priority=%x", channel_priority);
 | 
					    NGLOG_DEBUG(Service_NVDRV, "(STUBBED) called, priority={:X}", channel_priority);
 | 
				
			||||||
    std::memcpy(output.data(), &channel_priority, output.size());
 | 
					    std::memcpy(output.data(), &channel_priority, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -98,10 +98,11 @@ u32 nvhost_gpu::SetChannelPriority(const std::vector<u8>& input, std::vector<u8>
 | 
				
			|||||||
u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlAllocGpfifoEx2 params{};
 | 
					    IoctlAllocGpfifoEx2 params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV,
 | 
					    NGLOG_WARNING(Service_NVDRV,
 | 
				
			||||||
                "(STUBBED) called, num_entries=%x, flags=%x, unk0=%x, unk1=%x, unk2=%x, unk3=%x",
 | 
					                  "(STUBBED) called, num_entries={:X}, flags={:X}, unk0={:X}, "
 | 
				
			||||||
                params.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
 | 
					                  "unk1={:X}, unk2={:X}, unk3={:X}",
 | 
				
			||||||
                params.unk3);
 | 
					                  params.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
 | 
				
			||||||
 | 
					                  params.unk3);
 | 
				
			||||||
    params.fence_out.id = 0;
 | 
					    params.fence_out.id = 0;
 | 
				
			||||||
    params.fence_out.value = 0;
 | 
					    params.fence_out.value = 0;
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
@ -111,8 +112,8 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& ou
 | 
				
			|||||||
u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
					u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			||||||
    IoctlAllocObjCtx params{};
 | 
					    IoctlAllocObjCtx params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), input.size());
 | 
					    std::memcpy(¶ms, input.data(), input.size());
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num=%x, flags=%x", params.class_num,
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num,
 | 
				
			||||||
                params.flags);
 | 
					                  params.flags);
 | 
				
			||||||
    params.obj_id = 0x0;
 | 
					    params.obj_id = 0x0;
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, output.size());
 | 
					    std::memcpy(output.data(), ¶ms, output.size());
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
@ -123,8 +124,8 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
 | 
				
			|||||||
        UNIMPLEMENTED();
 | 
					        UNIMPLEMENTED();
 | 
				
			||||||
    IoctlSubmitGpfifo params{};
 | 
					    IoctlSubmitGpfifo params{};
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo));
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo=%" PRIx64 ", num_entries=%x, flags=%x",
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
 | 
				
			||||||
                params.gpfifo, params.num_entries, params.flags);
 | 
					                  params.gpfifo, params.num_entries, params.flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto entries = std::vector<IoctlGpfifoEntry>();
 | 
					    auto entries = std::vector<IoctlGpfifoEntry>();
 | 
				
			||||||
    entries.resize(params.num_entries);
 | 
					    entries.resize(params.num_entries);
 | 
				
			||||||
 | 
				
			|||||||
@ -49,7 +49,7 @@ u32 nvmap::IocCreate(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			|||||||
    u32 handle = next_handle++;
 | 
					    u32 handle = next_handle++;
 | 
				
			||||||
    handles[handle] = std::move(object);
 | 
					    handles[handle] = std::move(object);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "size=0x%08X", params.size);
 | 
					    NGLOG_DEBUG(Service_NVDRV, "size={:#010X}", params.size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    params.handle = handle;
 | 
					    params.handle = handle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,7 +70,7 @@ u32 nvmap::IocAlloc(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			|||||||
    object->addr = params.addr;
 | 
					    object->addr = params.addr;
 | 
				
			||||||
    object->status = Object::Status::Allocated;
 | 
					    object->status = Object::Status::Allocated;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called, addr=0x%" PRIx64, params.addr);
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called, addr={:X}", params.addr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::memcpy(output.data(), ¶ms, sizeof(params));
 | 
					    std::memcpy(output.data(), ¶ms, sizeof(params));
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
@ -80,7 +80,7 @@ u32 nvmap::IocGetId(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			|||||||
    IocGetIdParams params;
 | 
					    IocGetIdParams params;
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "called");
 | 
					    NGLOG_WARNING(Service_NVDRV, "called");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto object = GetObject(params.handle);
 | 
					    auto object = GetObject(params.handle);
 | 
				
			||||||
    ASSERT(object);
 | 
					    ASSERT(object);
 | 
				
			||||||
@ -95,7 +95,7 @@ u32 nvmap::IocFromId(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			|||||||
    IocFromIdParams params;
 | 
					    IocFromIdParams params;
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto itr = std::find_if(handles.begin(), handles.end(),
 | 
					    auto itr = std::find_if(handles.begin(), handles.end(),
 | 
				
			||||||
                            [&](const auto& entry) { return entry.second->id == params.id; });
 | 
					                            [&](const auto& entry) { return entry.second->id == params.id; });
 | 
				
			||||||
@ -114,7 +114,7 @@ u32 nvmap::IocParam(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
				
			|||||||
    IocParamParams params;
 | 
					    IocParamParams params;
 | 
				
			||||||
    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
					    std::memcpy(¶ms, input.data(), sizeof(params));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called type=%u", params.type);
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called type={}", params.type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    auto object = GetObject(params.handle);
 | 
					    auto object = GetObject(params.handle);
 | 
				
			||||||
    ASSERT(object);
 | 
					    ASSERT(object);
 | 
				
			||||||
 | 
				
			|||||||
@ -12,7 +12,7 @@
 | 
				
			|||||||
namespace Service::Nvidia {
 | 
					namespace Service::Nvidia {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NVDRV::Open(Kernel::HLERequestContext& ctx) {
 | 
					void NVDRV::Open(Kernel::HLERequestContext& ctx) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const auto& buffer = ctx.ReadBuffer();
 | 
					    const auto& buffer = ctx.ReadBuffer();
 | 
				
			||||||
    std::string device_name(buffer.begin(), buffer.end());
 | 
					    std::string device_name(buffer.begin(), buffer.end());
 | 
				
			||||||
@ -25,7 +25,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
 | 
					void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    IPC::RequestParser rp{ctx};
 | 
					    IPC::RequestParser rp{ctx};
 | 
				
			||||||
    u32 fd = rp.Pop<u32>();
 | 
					    u32 fd = rp.Pop<u32>();
 | 
				
			||||||
@ -41,7 +41,7 @@ void NVDRV::Ioctl(Kernel::HLERequestContext& ctx) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NVDRV::Close(Kernel::HLERequestContext& ctx) {
 | 
					void NVDRV::Close(Kernel::HLERequestContext& ctx) {
 | 
				
			||||||
    LOG_DEBUG(Service_NVDRV, "called");
 | 
					    NGLOG_DEBUG(Service_NVDRV, "called");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    IPC::RequestParser rp{ctx};
 | 
					    IPC::RequestParser rp{ctx};
 | 
				
			||||||
    u32 fd = rp.Pop<u32>();
 | 
					    u32 fd = rp.Pop<u32>();
 | 
				
			||||||
@ -53,7 +53,7 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
 | 
					void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
				
			||||||
    IPC::ResponseBuilder rb{ctx, 3};
 | 
					    IPC::ResponseBuilder rb{ctx, 3};
 | 
				
			||||||
    rb.Push(RESULT_SUCCESS);
 | 
					    rb.Push(RESULT_SUCCESS);
 | 
				
			||||||
    rb.Push<u32>(0);
 | 
					    rb.Push<u32>(0);
 | 
				
			||||||
@ -63,7 +63,7 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
 | 
				
			|||||||
    IPC::RequestParser rp{ctx};
 | 
					    IPC::RequestParser rp{ctx};
 | 
				
			||||||
    u32 fd = rp.Pop<u32>();
 | 
					    u32 fd = rp.Pop<u32>();
 | 
				
			||||||
    u32 event_id = rp.Pop<u32>();
 | 
					    u32 event_id = rp.Pop<u32>();
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, fd=%x, event_id=%x", fd, event_id);
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, fd={:X}, event_id={:X}", fd, event_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    IPC::ResponseBuilder rb{ctx, 3, 1};
 | 
					    IPC::ResponseBuilder rb{ctx, 3, 1};
 | 
				
			||||||
    rb.Push(RESULT_SUCCESS);
 | 
					    rb.Push(RESULT_SUCCESS);
 | 
				
			||||||
@ -75,14 +75,14 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
 | 
				
			|||||||
    IPC::RequestParser rp{ctx};
 | 
					    IPC::RequestParser rp{ctx};
 | 
				
			||||||
    pid = rp.Pop<u64>();
 | 
					    pid = rp.Pop<u64>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x%" PRIx64, pid);
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, pid={:#X}", pid);
 | 
				
			||||||
    IPC::ResponseBuilder rb{ctx, 3};
 | 
					    IPC::ResponseBuilder rb{ctx, 3};
 | 
				
			||||||
    rb.Push(RESULT_SUCCESS);
 | 
					    rb.Push(RESULT_SUCCESS);
 | 
				
			||||||
    rb.Push<u32>(0);
 | 
					    rb.Push<u32>(0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) {
 | 
					void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) {
 | 
				
			||||||
    LOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
					    NGLOG_WARNING(Service_NVDRV, "(STUBBED) called");
 | 
				
			||||||
    IPC::ResponseBuilder rb{ctx, 2};
 | 
					    IPC::ResponseBuilder rb{ctx, 2};
 | 
				
			||||||
    rb.Push(RESULT_SUCCESS);
 | 
					    rb.Push(RESULT_SUCCESS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user