0
0
Fork 0

Fix remap ioctl map offset (#852)

* Fix remap ioctl map offset

* Correct offset type
This commit is contained in:
gdkchan 2019-12-24 22:54:26 -03:00 committed by Ac_K
parent 17b2be7174
commit 87bfe681ef
2 changed files with 7 additions and 5 deletions

View file

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

View file

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