Remove long <-> ulong casts from Nvservices code (#1848)
* Remove long <-> ulong casts from Nvservices code * review: fix lint
This commit is contained in:
parent
532b8cad13
commit
b9fd7c8b23
@ -97,12 +97,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
// the Offset field holds the alignment size instead.
|
// the Offset field holds the alignment size instead.
|
||||||
if ((arguments.Flags & AddressSpaceFlags.FixedOffset) != 0)
|
if ((arguments.Flags & AddressSpaceFlags.FixedOffset) != 0)
|
||||||
{
|
{
|
||||||
bool regionInUse = _memoryAllocator.IsRegionInUse((ulong)arguments.Offset, size, out ulong freeAddressStartPosition);
|
bool regionInUse = _memoryAllocator.IsRegionInUse(arguments.Offset, size, out ulong freeAddressStartPosition);
|
||||||
ulong address;
|
ulong address;
|
||||||
|
|
||||||
if (!regionInUse)
|
if (!regionInUse)
|
||||||
{
|
{
|
||||||
_memoryAllocator.AllocateRange((ulong)arguments.Offset, size, freeAddressStartPosition);
|
_memoryAllocator.AllocateRange(arguments.Offset, size, freeAddressStartPosition);
|
||||||
address = freeAddressStartPosition;
|
address = freeAddressStartPosition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -110,17 +110,17 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
address = NvMemoryAllocator.PteUnmapped;
|
address = NvMemoryAllocator.PteUnmapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
arguments.Offset = (long)address;
|
arguments.Offset = address;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulong address = _memoryAllocator.GetFreeAddress((ulong)size, out ulong freeAddressStartPosition, (ulong)arguments.Offset);
|
ulong address = _memoryAllocator.GetFreeAddress(size, out ulong freeAddressStartPosition, arguments.Offset);
|
||||||
if (address != NvMemoryAllocator.PteUnmapped)
|
if (address != NvMemoryAllocator.PteUnmapped)
|
||||||
{
|
{
|
||||||
_memoryAllocator.AllocateRange(address, (ulong)size, freeAddressStartPosition);
|
_memoryAllocator.AllocateRange(address, size, freeAddressStartPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
arguments.Offset = unchecked((long)address);
|
arguments.Offset = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.Offset < 0)
|
if (arguments.Offset < 0)
|
||||||
@ -133,7 +133,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
addressSpaceContext.AddReservation(arguments.Offset, (long)size);
|
addressSpaceContext.AddReservation(arguments.Offset, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,8 +152,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
|
|
||||||
if (addressSpaceContext.RemoveReservation(arguments.Offset))
|
if (addressSpaceContext.RemoveReservation(arguments.Offset))
|
||||||
{
|
{
|
||||||
_memoryAllocator.DeallocateRange((ulong)arguments.Offset, size);
|
_memoryAllocator.DeallocateRange(arguments.Offset, size);
|
||||||
addressSpaceContext.Gmm.Free((ulong)arguments.Offset, size);
|
addressSpaceContext.Gmm.Free(arguments.Offset, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -173,12 +173,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
|
|
||||||
lock (addressSpaceContext)
|
lock (addressSpaceContext)
|
||||||
{
|
{
|
||||||
if (addressSpaceContext.RemoveMap(arguments.Offset, out long size))
|
if (addressSpaceContext.RemoveMap(arguments.Offset, out ulong size))
|
||||||
{
|
{
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
{
|
{
|
||||||
_memoryAllocator.DeallocateRange((ulong)arguments.Offset, (ulong)size);
|
_memoryAllocator.DeallocateRange(arguments.Offset, size);
|
||||||
addressSpaceContext.Gmm.Free((ulong)arguments.Offset, (ulong)size);
|
addressSpaceContext.Gmm.Free(arguments.Offset, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -212,7 +212,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
pageSize = (ulong)map.Align;
|
pageSize = (ulong)map.Align;
|
||||||
}
|
}
|
||||||
|
|
||||||
long physicalAddress;
|
ulong physicalAddress;
|
||||||
|
|
||||||
if ((arguments.Flags & AddressSpaceFlags.RemapSubRange) != 0)
|
if ((arguments.Flags & AddressSpaceFlags.RemapSubRange) != 0)
|
||||||
{
|
{
|
||||||
@ -220,10 +220,10 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
{
|
{
|
||||||
if (addressSpaceContext.TryGetMapPhysicalAddress(arguments.Offset, out physicalAddress))
|
if (addressSpaceContext.TryGetMapPhysicalAddress(arguments.Offset, out physicalAddress))
|
||||||
{
|
{
|
||||||
long virtualAddress = arguments.Offset + arguments.BufferOffset;
|
ulong virtualAddress = arguments.Offset + arguments.BufferOffset;
|
||||||
|
|
||||||
physicalAddress += arguments.BufferOffset;
|
physicalAddress += arguments.BufferOffset;
|
||||||
addressSpaceContext.Gmm.Map((ulong)physicalAddress, (ulong)virtualAddress, (ulong)arguments.MappingSize);
|
addressSpaceContext.Gmm.Map(physicalAddress, virtualAddress, arguments.MappingSize);
|
||||||
|
|
||||||
if (virtualAddress < 0)
|
if (virtualAddress < 0)
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
|
|
||||||
physicalAddress = map.Address + arguments.BufferOffset;
|
physicalAddress = map.Address + arguments.BufferOffset;
|
||||||
|
|
||||||
long size = arguments.MappingSize;
|
ulong size = arguments.MappingSize;
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
@ -266,7 +266,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
{
|
{
|
||||||
if (addressSpaceContext.ValidateFixedBuffer(arguments.Offset, size, pageSize))
|
if (addressSpaceContext.ValidateFixedBuffer(arguments.Offset, size, pageSize))
|
||||||
{
|
{
|
||||||
addressSpaceContext.Gmm.Map((ulong)physicalAddress, (ulong)arguments.Offset, (ulong)size);
|
addressSpaceContext.Gmm.Map(physicalAddress, arguments.Offset, size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -279,14 +279,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulong va = _memoryAllocator.GetFreeAddress((ulong)size, out ulong freeAddressStartPosition, (ulong) pageSize);
|
ulong va = _memoryAllocator.GetFreeAddress(size, out ulong freeAddressStartPosition, pageSize);
|
||||||
if (va != NvMemoryAllocator.PteUnmapped)
|
if (va != NvMemoryAllocator.PteUnmapped)
|
||||||
{
|
{
|
||||||
_memoryAllocator.AllocateRange(va, (ulong)size, freeAddressStartPosition);
|
_memoryAllocator.AllocateRange(va, size, freeAddressStartPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
addressSpaceContext.Gmm.Map((ulong)physicalAddress, va, (ulong)size);
|
addressSpaceContext.Gmm.Map(physicalAddress, va, size);
|
||||||
arguments.Offset = (long)va;
|
arguments.Offset = va;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.Offset < 0)
|
if (arguments.Offset < 0)
|
||||||
@ -335,11 +335,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||||||
return NvInternalResult.InvalidInput;
|
return NvInternalResult.InvalidInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
long shiftedGpuOffset = (long)((ulong)arguments[index].GpuOffset << 16);
|
ulong shiftedGpuOffset = ((ulong)arguments[index].GpuOffset << 16);
|
||||||
|
|
||||||
gmm.Map(
|
gmm.Map(
|
||||||
((ulong)arguments[index].MapOffset << 16) + (ulong)map.Address,
|
((ulong)arguments[index].MapOffset << 16) + map.Address,
|
||||||
(ulong)shiftedGpuOffset,
|
shiftedGpuOffset,
|
||||||
(ulong)arguments[index].Pages << 16);
|
(ulong)arguments[index].Pages << 16);
|
||||||
|
|
||||||
if (shiftedGpuOffset < 0)
|
if (shiftedGpuOffset < 0)
|
||||||
|
@ -12,22 +12,22 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
public ulong Start { get; private set; }
|
public ulong Start { get; private set; }
|
||||||
public ulong End { get; private set; }
|
public ulong End { get; private set; }
|
||||||
|
|
||||||
public Range(long position, long size)
|
public Range(ulong position, ulong size)
|
||||||
{
|
{
|
||||||
Start = (ulong)position;
|
Start = position;
|
||||||
End = (ulong)size + Start;
|
End = size + Start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MappedMemory : Range
|
private class MappedMemory : Range
|
||||||
{
|
{
|
||||||
public long PhysicalAddress { get; private set; }
|
public ulong PhysicalAddress { get; private set; }
|
||||||
public bool VaAllocated { get; private set; }
|
public bool VaAllocated { get; private set; }
|
||||||
|
|
||||||
public MappedMemory(
|
public MappedMemory(
|
||||||
long position,
|
ulong position,
|
||||||
long size,
|
ulong size,
|
||||||
long physicalAddress,
|
ulong physicalAddress,
|
||||||
bool vaAllocated) : base(position, size)
|
bool vaAllocated) : base(position, size)
|
||||||
{
|
{
|
||||||
PhysicalAddress = physicalAddress;
|
PhysicalAddress = physicalAddress;
|
||||||
@ -35,8 +35,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SortedList<long, Range> _maps;
|
private SortedList<ulong, Range> _maps;
|
||||||
private SortedList<long, Range> _reservations;
|
private SortedList<ulong, Range> _reservations;
|
||||||
|
|
||||||
public MemoryManager Gmm { get; }
|
public MemoryManager Gmm { get; }
|
||||||
|
|
||||||
@ -44,22 +44,22 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
{
|
{
|
||||||
Gmm = context.Device.Gpu.MemoryManager;
|
Gmm = context.Device.Gpu.MemoryManager;
|
||||||
|
|
||||||
_maps = new SortedList<long, Range>();
|
_maps = new SortedList<ulong, Range>();
|
||||||
_reservations = new SortedList<long, Range>();
|
_reservations = new SortedList<ulong, Range>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ValidateFixedBuffer(long position, long size, ulong alignment)
|
public bool ValidateFixedBuffer(ulong position, ulong size, ulong alignment)
|
||||||
{
|
{
|
||||||
long mapEnd = position + size;
|
ulong mapEnd = position + size;
|
||||||
|
|
||||||
// Check if size is valid (0 is also not allowed).
|
// Check if size is valid (0 is also not allowed).
|
||||||
if ((ulong)mapEnd <= (ulong)position)
|
if (mapEnd <= position)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if address is aligned.
|
// Check if address is aligned.
|
||||||
if ((position & (long)(alignment - 1)) != 0)
|
if ((position & (alignment - 1)) != 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
// Check for overlap with already mapped buffers.
|
// Check for overlap with already mapped buffers.
|
||||||
Range map = BinarySearchLt(_maps, mapEnd);
|
Range map = BinarySearchLt(_maps, mapEnd);
|
||||||
|
|
||||||
if (map != null && map.End > (ulong)position)
|
if (map != null && map.End > position)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -82,15 +82,15 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void AddMap(
|
public void AddMap(
|
||||||
long position,
|
ulong position,
|
||||||
long size,
|
ulong size,
|
||||||
long physicalAddress,
|
ulong physicalAddress,
|
||||||
bool vaAllocated)
|
bool vaAllocated)
|
||||||
{
|
{
|
||||||
_maps.Add(position, new MappedMemory(position, size, physicalAddress, vaAllocated));
|
_maps.Add(position, new MappedMemory(position, size, physicalAddress, vaAllocated));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveMap(long position, out long size)
|
public bool RemoveMap(ulong position, out ulong size)
|
||||||
{
|
{
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
|
|
||||||
if (map.VaAllocated)
|
if (map.VaAllocated)
|
||||||
{
|
{
|
||||||
size = (long)(map.End - map.Start);
|
size = (map.End - map.Start);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetMapPhysicalAddress(long position, out long physicalAddress)
|
public bool TryGetMapPhysicalAddress(ulong position, out ulong physicalAddress)
|
||||||
{
|
{
|
||||||
Range map = BinarySearch(_maps, position);
|
Range map = BinarySearch(_maps, position);
|
||||||
|
|
||||||
@ -125,17 +125,17 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddReservation(long position, long size)
|
public void AddReservation(ulong position, ulong size)
|
||||||
{
|
{
|
||||||
_reservations.Add(position, new Range(position, size));
|
_reservations.Add(position, new Range(position, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveReservation(long position)
|
public bool RemoveReservation(ulong position)
|
||||||
{
|
{
|
||||||
return _reservations.Remove(position);
|
return _reservations.Remove(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Range BinarySearch(SortedList<long, Range> lst, long position)
|
private Range BinarySearch(SortedList<ulong, Range> lst, ulong position)
|
||||||
{
|
{
|
||||||
int left = 0;
|
int left = 0;
|
||||||
int right = lst.Count - 1;
|
int right = lst.Count - 1;
|
||||||
@ -148,12 +148,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
|
|
||||||
Range rg = lst.Values[middle];
|
Range rg = lst.Values[middle];
|
||||||
|
|
||||||
if ((ulong)position >= rg.Start && (ulong)position < rg.End)
|
if (position >= rg.Start && position < rg.End)
|
||||||
{
|
{
|
||||||
return rg;
|
return rg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ulong)position < rg.Start)
|
if (position < rg.Start)
|
||||||
{
|
{
|
||||||
right = middle - 1;
|
right = middle - 1;
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Range BinarySearchLt(SortedList<long, Range> lst, long position)
|
private Range BinarySearchLt(SortedList<ulong, Range> lst, ulong position)
|
||||||
{
|
{
|
||||||
Range ltRg = null;
|
Range ltRg = null;
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
|
|
||||||
Range rg = lst.Values[middle];
|
Range rg = lst.Values[middle];
|
||||||
|
|
||||||
if ((ulong)position < rg.Start)
|
if (position < rg.Start)
|
||||||
{
|
{
|
||||||
right = middle - 1;
|
right = middle - 1;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
{
|
{
|
||||||
left = middle + 1;
|
left = middle + 1;
|
||||||
|
|
||||||
if ((ulong)position > rg.Start)
|
if (position > rg.Start)
|
||||||
{
|
{
|
||||||
ltRg = rg;
|
ltRg = rg;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,6 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
public uint PageSize;
|
public uint PageSize;
|
||||||
public AddressSpaceFlags Flags;
|
public AddressSpaceFlags Flags;
|
||||||
public uint Padding;
|
public uint Padding;
|
||||||
public long Offset;
|
public ulong Offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
struct FreeSpaceArguments
|
struct FreeSpaceArguments
|
||||||
{
|
{
|
||||||
public long Offset;
|
public ulong Offset;
|
||||||
public uint Pages;
|
public uint Pages;
|
||||||
public uint PageSize;
|
public uint PageSize;
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu.Types
|
|||||||
public int Kind;
|
public int Kind;
|
||||||
public int NvMapHandle;
|
public int NvMapHandle;
|
||||||
public int PageSize;
|
public int PageSize;
|
||||||
public long BufferOffset;
|
public ulong BufferOffset;
|
||||||
public long MappingSize;
|
public ulong MappingSize;
|
||||||
public long Offset;
|
public ulong Offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
struct UnmapBufferArguments
|
struct UnmapBufferArguments
|
||||||
{
|
{
|
||||||
#pragma warning disable CS0649
|
#pragma warning disable CS0649
|
||||||
public long Offset;
|
public ulong Offset;
|
||||||
#pragma warning restore CS0649
|
#pragma warning restore CS0649
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
|
|||||||
{
|
{
|
||||||
NvMapHandle map = NvMapDeviceFile.GetMapFromHandle(Owner, commandBuffer.Mem);
|
NvMapHandle map = NvMapDeviceFile.GetMapFromHandle(Owner, commandBuffer.Mem);
|
||||||
|
|
||||||
var data = _memory.GetSpan((ulong)map.Address + commandBuffer.Offset, commandBuffer.WordsCount * 4);
|
var data = _memory.GetSpan(map.Address + commandBuffer.Offset, commandBuffer.WordsCount * 4);
|
||||||
|
|
||||||
_device.Host1x.Submit(MemoryMarshal.Cast<byte, int>(data));
|
_device.Host1x.Submit(MemoryMarshal.Cast<byte, int>(data));
|
||||||
}
|
}
|
||||||
@ -253,12 +253,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
|
|||||||
if (va != NvMemoryAllocator.PteUnmapped && va <= uint.MaxValue && (va + (uint)map.Size) <= uint.MaxValue)
|
if (va != NvMemoryAllocator.PteUnmapped && va <= uint.MaxValue && (va + (uint)map.Size) <= uint.MaxValue)
|
||||||
{
|
{
|
||||||
_memoryAllocator.AllocateRange(va, (uint)map.Size, freeAddressStartPosition);
|
_memoryAllocator.AllocateRange(va, (uint)map.Size, freeAddressStartPosition);
|
||||||
gmm.Map((ulong)map.Address, va, (uint)map.Size);
|
gmm.Map(map.Address, va, (uint)map.Size);
|
||||||
map.DmaMapAddress = (long)va;
|
map.DmaMapAddress = va;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
map.DmaMapAddress = unchecked((long)NvMemoryAllocator.PteUnmapped);
|
map.DmaMapAddress = NvMemoryAllocator.PteUnmapped;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
|
|||||||
|
|
||||||
int size = BitUtils.AlignUp(map.Size, (int)MemoryManager.PageSize);
|
int size = BitUtils.AlignUp(map.Size, (int)MemoryManager.PageSize);
|
||||||
|
|
||||||
long address = arguments.Address;
|
ulong address = arguments.Address;
|
||||||
|
|
||||||
if (address == 0)
|
if (address == 0)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,6 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
|
|||||||
public int Flags;
|
public int Flags;
|
||||||
public int Align;
|
public int Align;
|
||||||
public long Kind;
|
public long Kind;
|
||||||
public long Address;
|
public ulong Address;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
|
|||||||
{
|
{
|
||||||
public int Handle;
|
public int Handle;
|
||||||
public int Padding;
|
public int Padding;
|
||||||
public long Address;
|
public ulong Address;
|
||||||
public int Size;
|
public int Size;
|
||||||
public int Flags;
|
public int Flags;
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
|
|||||||
public int Size;
|
public int Size;
|
||||||
public int Align;
|
public int Align;
|
||||||
public int Kind;
|
public int Kind;
|
||||||
public long Address;
|
public ulong Address;
|
||||||
public bool Allocated;
|
public bool Allocated;
|
||||||
public long DmaMapAddress;
|
public ulong DmaMapAddress;
|
||||||
|
|
||||||
private long _dupes;
|
private long _dupes;
|
||||||
|
|
||||||
|
@ -308,11 +308,11 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|||||||
nvMapHandle = item.GraphicBuffer.Object.Buffer.NvMapId;
|
nvMapHandle = item.GraphicBuffer.Object.Buffer.NvMapId;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bufferOffset = item.GraphicBuffer.Object.Buffer.Surfaces[0].Offset;
|
ulong bufferOffset = (ulong)item.GraphicBuffer.Object.Buffer.Surfaces[0].Offset;
|
||||||
|
|
||||||
NvMapHandle map = NvMapDeviceFile.GetMapFromHandle(layer.Owner, nvMapHandle);
|
NvMapHandle map = NvMapDeviceFile.GetMapFromHandle(layer.Owner, nvMapHandle);
|
||||||
|
|
||||||
ulong frameBufferAddress = (ulong)(map.Address + bufferOffset);
|
ulong frameBufferAddress = map.Address + bufferOffset;
|
||||||
|
|
||||||
Format format = ConvertColorFormat(item.GraphicBuffer.Object.Buffer.Surfaces[0].ColorFormat);
|
Format format = ConvertColorFormat(item.GraphicBuffer.Object.Buffer.Surfaces[0].ColorFormat);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user