From 87bfe681ef65ed692aa1e46e3f5f8229013cf46a Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 24 Dec 2019 22:54:26 -0300 Subject: [PATCH] Fix remap ioctl map offset (#852) * Fix remap ioctl map offset * Correct offset type --- .../Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs | 8 +++++--- .../Nv/NvDrvServices/NvHostAsGpu/Types/RemapArguments.cs | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs index 70783b438..b48377a47 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs @@ -293,13 +293,15 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu return NvInternalResult.InvalidInput; } - long result = vmm.Map(map.Address, (long)arguments[index].Offset << 16, - (long)arguments[index].Pages << 16); + long result = vmm.Map( + ((long)arguments[index].MapOffset << 16) + map.Address, + (long)arguments[index].GpuOffset << 16, + (long)arguments[index].Pages << 16); if (result < 0) { Logger.PrintWarning(LogClass.ServiceNv, - $"Page 0x{arguments[index].Offset:x16} size 0x{arguments[index].Pages:x16} not allocated!"); + $"Page 0x{arguments[index].GpuOffset:x16} size 0x{arguments[index].Pages:x16} not allocated!"); return NvInternalResult.InvalidInput; } diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/Types/RemapArguments.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/Types/RemapArguments.cs index 0cf324b45..bc149d424 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/Types/RemapArguments.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/Types/RemapArguments.cs @@ -8,8 +8,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types public ushort Flags; public ushort Kind; public int NvMapHandle; - public int Padding; - public uint Offset; + public uint MapOffset; + public uint GpuOffset; public uint Pages; } }