Пример #1
0
        private static int SubmitGpfifo(ServiceCtx Context)
        {
            long InputPosition  = Context.Request.GetBufferType0x21().Position;
            long OutputPosition = Context.Request.GetBufferType0x22().Position;

            NvHostChannelSubmitGpfifo Args = AMemoryHelper.Read <NvHostChannelSubmitGpfifo>(Context.Memory, InputPosition);

            NvGpuVmm Vmm = NvGpuASIoctl.GetVmm(Context);

            for (int Index = 0; Index < Args.NumEntries; Index++)
            {
                long Gpfifo = Context.Memory.ReadInt64(InputPosition + 0x18 + Index * 8);

                long VA = Gpfifo & 0xff_ffff_ffff;

                int Size = (int)(Gpfifo >> 40) & 0x7ffffc;

                byte[] Data = Vmm.ReadBytes(VA, Size);

                NvGpuPBEntry[] PushBuffer = NvGpuPushBuffer.Decode(Data);

                Context.Ns.Gpu.Fifo.PushBuffer(Vmm, PushBuffer);
            }

            Args.SyncptId    = 0;
            Args.SyncptValue = 0;

            AMemoryHelper.Write(Context.Memory, OutputPosition, Args);

            return(NvResult.Success);
        }
Пример #2
0
        private static int SubmitGpfifo(ServiceCtx Context)
        {
            long InputPosition  = Context.Request.GetBufferType0x21().Position;
            long OutputPosition = Context.Request.GetBufferType0x22().Position;

            NvHostChannelSubmitGpfifo Args = AMemoryHelper.Read <NvHostChannelSubmitGpfifo>(Context.Memory, InputPosition);

            NvGpuVmm Vmm = NvGpuASIoctl.GetASCtx(Context).Vmm;;

            for (int Index = 0; Index < Args.NumEntries; Index++)
            {
                long Gpfifo = Context.Memory.ReadInt64(InputPosition + 0x18 + Index * 8);

                PushGpfifo(Context, Vmm, Gpfifo);
            }

            Args.SyncptId    = 0;
            Args.SyncptValue = 0;

            AMemoryHelper.Write(Context.Memory, OutputPosition, Args);

            return(NvResult.Success);
        }