Fix remap ioctl map offset (#852)

* Fix remap ioctl map offset

* Correct offset type
This commit is contained in:
gdkchan authored and Ac_K committed 2019-12-25 02:54:26 +01:00
1 parent 17b2be7174
commit 87bfe681ef
2 files changed
+7 -5

No files matched your search

@@ -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;
}
@@ -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;
}
}