Switch 2: GSV services: Difference between revisions

Created page with "= (S2) GraphicsSupervisor = This is a TIPC interface so the command numbers are subtracted by 16. {| class="wikitable" border="1" |- ! Cmd || Name |- | 1 || #InitializeGraphicsWithTransferMemory |- | 4 || #InitializeGraphics |- | 11 || #SetCurrentProcessHandle |- | 12 || |- | 101 || #StartGraphics |- | 111 || |- | 112 || |- | 114 || |- | 115 || |- | 187 || |- | 201 || |- | 301 || |- | 303 || |- | 311 || |- | 312 || |- | 314 || |- | 315 ||..."
 
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= (S2) GraphicsSupervisor =
= UserSession =
This is a TIPC interface so the command numbers are subtracted by 16.
This is a TIPC interface so the command numbers are subtracted by 16.
This multiplexes several interfaces into a single session that can be acquired through [[Applet_Manager_services|am]].


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name
! Cmd || Interface || Name
|-
| 1 || Gsv || [[#BootWithTransferMemory|BootWithTransferMemory]]
|-
| 4 || Gsv || [[#BootWithRemoteMemory|BootWithRemoteMemory]]
|-
| 11 || || [[#SetCurrentProcessHandle|SetCurrentProcessHandle]]
|-
| 12 || ||
|-
| 101 || || [[#CreateContext|CreateContext]]
|-
| 111 || NativeMemory || CreateNativeMemory
|-
| 112 || NativeMemory || DestroyNativeMemory
|-
| 113 || NativeMemory || CreateNativeMemoryBlockByTransferMemory
|-
| 114 || NativeMemory || CreateNativeMemoryBlock
|-
| 115 || NativeMemory || BootNativeMemoryManagement
|-
| 187 || NativeMemory || QueryNativeMemoryNvsNvRmMemIdForDebug
|-
| 201 || Syncpt || CreateSyncptContext
|-
| 202 || Syncpt || InitializeSyncptContext
|-
| 211 || Syncpt || CreateDebugSyncDevice
|-
| 213 || Syncpt || CreateDebugSyncCounter
|-
| 214 || Syncpt || DestroyDebugSyncCounter
|-
| 215 || Syncpt || ReportDebugSyncCounterValue
|-
| 301 || Display || CreateDisplayContext
|-
| 303 || Display || DestroyDisplayContext
|-
| 305 || Display || InitializeDisplayContext
|-
| 311 || Display ||
|-
| 312 || Display ||
|-
| 314 || Display ||
|-
| 315 || Display ||
|-
| 321 || Display ||
|-
| 327 || Display ||
|-
| 391 || Display || CalculateRequiredBufferMemory
|-
| 401 || Gpu || [[#CreateGpuContext|CreateGpuContext]]
|-
| 402 || Gpu || [[#InitializeGpuContext|InitializeGpuContext]]
|-
| 423 || Gpu ||
|-
| 426 || Gpu || MapNativeImage
|-
| 427 || Gpu || UnmapNativeImage
|-
| 428 || Gpu || [[#QueryNativeImage|QueryNativeImage]]
|-
| 429 || Gpu || [[#CreateNativeImage|CreateNativeImage]]
|-
| 430 || Gpu || DestroyNativeImage
|-
| 434 || Gpu || ExistsAddressSpace
|-
| 435 || Gpu || [[#CalculateNativeImageSize|CalculateNativeImageSize]]
|-
| 437 || Gpu || CreateNativeMemoryWithGpukMemHandle
|-
| 493 || Gpu || CreateUserlandDebuggerSession
|-
| 494 || Gpu ||
|-
| 496 || Gpu || [[#CreateGpuManagerSessionWithTransferMemory|CreateGpuManagerSessionWithTransferMemory]]
|-
| 497 || Gpu || [[#CreateGpuManagerSessionWithRemoteMemory|CreateGpuManagerSessionWithRemoteMemory]]
|-
| 498 || Gpu || TryQueryDonatedTransferMemoryUsage
|-
| 601 || Camera || CreateCameraContext
|-
| 602 || Camera || InitializeCameraContext
|-
| 603 || Camera || DestroyCameraContext
|-
| 612 || Camera || DestroyOutputBufferPool
|-
| 613 || Camera || CreateAliasOutputBufferPool
|-
| 614 || Camera || DestroyAliasOutputBufferPool
|-
| 615 || Camera || CreateOutputBufferPool
|-
| 616 || Camera || ReadFrameDataAsync
|-
| 620 || Camera || InitializeB
|-
| 621 || Camera || FinalizeB
|-
| 622 || Camera || ListCameras
|-
| 623 || Camera || OpenCamera
|-
| 624 || Camera || CloseCamera
|-
| 626 || Camera || ListSensorMode
|-
| 627 || Camera || SetSensorMode
|-
| 628 || Camera || GetAvailableStreams
|-
| 629 || Camera || GetRequiredWorkBufferSize
|-
| 630 || Camera || CreateStream
|-
| 632 || Camera || GetReadDoneEvent
|-
| 633 || Camera || GetStreamOutputSize
|-
| 634 || Camera || DestroyStream
|-
| 636 || Camera || ReadFrameDataAsync
|-
| 637 || Camera || GetAttachedEvent
|-
| 638 || Camera || GetDetachedEvent
|-
| 639 || Camera || GetFrameInfo
|-
| 640 || Camera || GetFrameInfo2
|-
| 641 || Camera || GetConnectionChangedEvent
|-
| 650 || Camera || SetPictureQualityConfig
|-
| 651 || Camera || GetPictureQualityConfig
|-
| 652 || Camera || SetDigitalWindow
|-
| 653 || Camera || GetDigitalWindow
|-
| 654 || Camera || GetDigitalWindowCapability
|-
| 655 || Camera || GetSupportedFunctions
|-
| 656 || Camera || GetSupportedDebugFunctions
|-
|-
| 1 || [[#InitializeGraphicsWithTransferMemory]]
| 657 || Camera || GetCameraPrivacyCoverStatus
|-
|-
| 4 || [[#InitializeGraphics]]
| 658 || Camera || GetCameraDeviceTemperature
|-
|-
| 11 || [[#SetCurrentProcessHandle]]
| 659 || Camera || GetDeviceUniqueId
|-
|-
| 12 ||  
| 660 || Camera || GetSensorMode
|-
|-
| 101 || [[#StartGraphics]]
| 661 || Camera || GetStride
|-
|-
| 111 ||  
| 662 || Camera || UnlinkSensor
|-
|-
| 112 ||  
| 663 || Camera || GetDeviceModel
|-
|-
| 114 ||  
| 664 || Camera || SetRawSensorMode
|-
|-
| 115 ||  
| 665 || Camera || GetAccessAllowed
|-
|-
| 187 ||  
| 666 || Camera || GetHostDrivenAeRegion
|-
|-
| 201 ||  
| 667 || Camera || SetHostDrivenAeRegion
|-
|-
| 301 ||  
| 691 || Camera || CalculateImageArraySize
|-
|-
| 303 ||  
| 901 || VideoDecoder || CreateVideoDecoderContext
|-
|-
| 311 ||  
| 902 || VideoDecoder || InitializeVideoDecoderContext
|-
|-
| 312 ||  
| 903 || VideoDecoder || DestroyVideoDecoderContext
|-
|-
| 314 ||  
| 904 || VideoDecoder || InitializeVideoDecoderContextForSystem
|-
|-
| 315 ||  
| 905 || VideoDecoder ||
|-
|-
| 321 ||  
| 911 || VideoDecoder || InitializeDecoderImagePool
|-
|-
| 327 ||  
| 912 || VideoDecoder || FinalizeDecoderImagePool
|-
|-
| 391 ||  
| 921 || VideoDecoderForSystem || InitializeDecoderAliasImagePool
|-
|-
| 401 || [[#PrepareGpuManagerSession]]
| 922 || VideoDecoderForSystem || FinalizeDecoderAliasImagePool
|-
|-
| 402 || [[#StartGpuManagerSession]]
| 961 || VideoDecoderForSystem || ReadDecoderOutput
|-
|-
| 423 ||  
| 991 || VideoDecoderForSystem || CalculateDecoderImagePoolBuffer
|-
|-
| 428 || [[#QueryNativeImage]]
| 1001 || VideoEncoder || CreateVideoEncoderContext
|-
|-
| 429 || [[#CreateNativeImage]]
| 1002 || VideoEncoder || InitializeVideoEncoderContext
|-
|-
| 434 ||  
| 1003 || VideoEncoder || DestroyVideoEncoderContext
|-
|-
| 435 || [[#CalculateNativeImageSize]]
| 1004 || VideoEncoder || InitializeVideoEncoderContextForSystem
|-
|-
| 494 ||  
| 1011 || VideoEncoder || InitializeEncoderImagePool
|-
|-
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]]
| 1012 || VideoEncoder || FinalizeEncoderImagePool
|-
|-
| 497 || [[#CreateGpuManagerSession]]
| 1021 || VideoEncoderForSystem || InitializeEncoderAliasImagePool
|-
|-
| 901 ||  
| 1022 || VideoEncoderForSystem || FinalizeEncoderAliasImagePool
|-
|-
| 902 ||  
| 1061 || VideoEncoderForSystem || WriteEncoderInput
|-
|-
| 903 ||  
| 1091 || VideoEncoderForSystem || CalculateEncoderImagePoolBuffer
|-
|-
| 905 ||  
| 1101 || GraphicsFrame || CreateGraphicsFrameContext
|-
|-
| 911 ||  
| 1102 || GraphicsFrame || InitializeGraphicsFrameContext
|-
|-
| 912 ||  
| 1111 || GraphicsFrame || SetGraphicsFrameLengthMode
|-
|-
| 922 ||  
| 1112 || GraphicsFrame || SetGraphicsFrameRestartMode
|-
|-
| 961 ||  
| 1113 || GraphicsFrame || SetGraphicsFrameGpuTimesliceMode
|-
|-
| 991 ||  
| 1201 || Chat || CreateChatContext
|-
|-
| 1001 ||  
| 1202 || Chat || InitializeChatContext
|-
|-
| 1002 ||  
| 1203 || Chat || DestroyChatContext
|-
|-
| 1003 ||  
| 1211 || Chat || CreateImagePool
|-
|-
| 1101 ||  
| 1212 || Chat || DestroyImagePool
|-
|-
| 1102 ||  
| 1291 || Chat || CalculateRequiredBufferMemory
|-
|-
| 1301 || [[#InitializeAdraw]]
| 1301 || Adraw || [[#CreateAdrawContext|CreateAdrawContext]]
|-
|-
| 1302 || [[#StartAdraw]]
| 1302 || Adraw || [[#InitializeAdrawContext|InitializeAdrawContext]]
|-
|-
| 1325 || [[#GetAdrawFrameBufferHandle]]
| 1325 || Adraw || [[#GetAdrawFrameBufferHandle|GetAdrawFrameBufferHandle]]
|-
|-
| 1326 || [[#GetAdrawImageHandle]]
| 1326 || Adraw || [[#GetAdrawImageHandle|GetAdrawImageHandle]]
|-
|-
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]]  
| 1401 || NvDrv || [[#CreateNvDrv2UserSessionWithTransferMemory|CreateNvDrv2UserSessionWithTransferMemory]]  
|-
|-
| 1402 || [[#CreateNvDrv2UserSession]]  
| 1402 || NvDrv || [[#CreateNvDrv2UserSessionWithRemoteMemory|CreateNvDrv2UserSessionWithRemoteMemory]]  
|-
|-
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]]
| 1411 || NvDrv || [[#GetNvDrv2UserTransferMemoryUsage|GetNvDrv2UserTransferMemoryUsage]]
|-
|-
| 1501 ||
| 1501 || InterModuleImage || CreateInterModuleImageContext
|-
|-
| 1502 ||  
| 1502 || InterModuleImage || InitializeInterModuleImageContext
|-
|-
| 1601 ||  
| 1601 || ||
|-
|-
| 1602 ||  
| 1602 || ||
|-
|-
| 1603 ||  
| 1603 || ||
|-
|-
| 1611 ||  
| 1611 || ||
|-
|-
| 1612 ||  
| 1612 || ||
|-
|-
| 1691 ||  
| 1691 || ||
|}
|}


== InitializeGraphicsWithTransferMemory ==
== BootWithTransferMemory ==
Unofficial name.
Unofficial name.


Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.
Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output.


== InitializeGraphics ==
== BootWithRemoteMemory ==
Unofficial name.
Unofficial name.


Line 142: Line 298:
Takes a Process handle. No output.
Takes a Process handle. No output.


Called directly after [[#InitializeGraphicsWithTransferMemory]] or [[#InitializeGraphics]].
Called directly after [[#BootWithTransferMemory]] or [[#BootWithRemoteMemory]].


== StartGraphics ==
== CreateContext ==
Unofficial name.
Unofficial name.


Line 151: Line 307:
Called directly after [[#SetCurrentProcessHandle]].
Called directly after [[#SetCurrentProcessHandle]].


== PrepareGpuManagerSession ==
== CreateGpuContext ==
Unofficial name.
Unofficial name.


No input/output.
No input/output.


Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSession]].
Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSessionWithRemoteMemory]].


== StartGpuManagerSession ==
== InitializeGpuContext ==
Unofficial name.
Unofficial name.


No input/output.
No input/output.


Called directly after [[#PrepareGpuManagerSession]].
Called directly after [[#CreateGpuContext]].


== GetImageInfo ==
== GetImageInfo ==
Line 177: Line 333:
[19.0.0] '''Version''' must be 2.
[19.0.0] '''Version''' must be 2.


== CreateGpuManagerSession ==
== CreateGpuManagerSessionWithRemoteMemory ==
Unofficial name.
Unofficial name.


Line 184: Line 340:
[19.0.0] '''Version''' must be 2.
[19.0.0] '''Version''' must be 2.


== InitializeAdraw ==
== CreateAdrawContext ==
Unofficial name.
Unofficial name.


No input/output.
No input/output.


== StartAdraw ==
== InitializeAdrawContext ==
Unofficial name.
Unofficial name.


No input/output.
No input/output.


Called directly after [[#InitializeAdraw]].
Called directly after [[#CreateAdrawContext]].


== GetAdrawFrameBufferHandle ==
== GetAdrawFrameBufferHandle ==
Line 215: Line 371:
Takes a TransferMemory handle, an input u64 '''TransferMemorySize''' and an input u8. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].
Takes a TransferMemory handle, an input u64 '''TransferMemorySize''' and an input u8. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]].


== CreateNvDrv2UserSession ==
== CreateNvDrv2UserSessionWithRemoteMemory ==
Unofficial name.
Unofficial name.


Line 234: Line 390:
! Cmd || Name
! Cmd || Name
|-
|-
| 11 || [[#GetEventIdRange]]
| 11 || [[#GetEventIdRange|GetEventIdRange]]
|-
|-
| 12 || [[#CreateEvent]]
| 12 || [[#CreateEvent|CreateEvent]]
|-
|-
| 21 || [[#RequestGpuSession]]
| 21 || [[#RequestKUserWorkerSession|RequestKUserWorkerSession]]
|-
|-
| 22 || [[#GetGpuSession]]
| 22 || [[#GetKUserWorkerSession|GetKUserWorkerSession]]
|-
|-
| 33 ||  
| 33 || CreateGpuAddressSpace
|-
|-
| 41 ||  
| 41 || CreateGraphicsDevice
|-
|-
| 42 ||  
| 42 || DestroyGraphicsDevice
|-
|-
| 102 ||  
| 102 ||  
|-
|-
| 200 ||  
| 200 || SynchronizeGpuAddressSpace
|-
|-
| 201 ||  
| 201 || GetUserPartitionGpuAddress
|-
|-
| 202 ||  
| 202 || GetGsvPartitionGpuAddress
|}
|}


Line 267: Line 423:
Takes an input u32 '''EventId'''. Returns an output Event handle.
Takes an input u32 '''EventId'''. Returns an output Event handle.


=== RequestGpuSession ===
=== RequestKUserWorkerSession ===
Unofficial name.
Unofficial name.


Line 274: Line 430:
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready.
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready.


=== GetGpuSession ===
=== GetKUserWorkerSession ===
Unofficial name.
Unofficial name.


No input. Returns a [[#GpuSession]].
No input. Returns a [[#GetKUserWorkerSession]].


Called after [[#RequestGpuSession]] and the Event handle has been signalled.
Called after [[#RequestKUserWorkerSession]] and the Event handle has been signalled.


=== GpuSession ===
=== KUserWorkerSession ===
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16.
This is "nn::gpuk::impl::kuser::KUserWorkerSession".
 
This is a TIPC interface so the command numbers are subtracted by 16.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 288: Line 446:
! Cmd || Name
! Cmd || Name
|-
|-
| 101 || [[#CreateGpuMemory]]
| 101 || [[#CreateGpuMemory|CreateGpuMemory]]
|-
| 102 || [[#DestroyGpuMemory|DestroyGpuMemory]]
|-
| 171 || EnsureGpuMemoryComptags
|-
| 172 || SetGpuMemoryUserDebugLabel
|-
|-
| 102 || [[#DestroyGpuMemory]]
| 173 || SetGpuMemorySdkDebugLabel
|-
|-
| 201 || [19.0.0-19.1.0] MapMemory
| 201 || [19.0.0-19.1.0] NormalMapGpuMemory4K
|-
|-
| 202 || [19.0.0-19.1.0] UnmapMemory
| 202 || [19.0.0-19.1.0] NormalUnmapGpuMemory4K
|-
|-
| 203 || [19.0.0-19.1.0] AllocateAddressSpace
| 203 || [19.0.0-19.1.0] CreateSparseRegion
|-
|-
| 204 || [19.0.0-19.1.0] FreeAddressSpace
| 204 || [19.0.0-19.1.0] DestroySparseRegion
|-
|-
| 205 || [19.0.0-19.1.0] RemapMemory
| 205 || [19.0.0-19.1.0] ExecuteSparseMapRequests
|-
|-
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping
| 207 || [19.0.0-19.1.0] NormalModifyMemoryKind4K
|-
|-
| 211 || [20.1.1+] MapMemoryV2
| 209 || [20.0.0+] SetGpuSegmentUserDebugLabel
|-
|-
| 212 || [20.1.1+] ModifyMemoryMappingV2
| 210 || [20.0.0+] SetGpuSegmentSdkDebugLabel
|-
|-
| 213 || [20.1.1+] UnmapMemoryV2
| 211 || [20.0.0+] NormalMapGpuMemory4K
|-
|-
| 214 || [20.1.1+] AllocateAddressSpaceV2
| 212 || [20.0.0+] NormalModifyMemoryKind4K
|-
|-
| 215 || [20.1.1+] FreeAddressSpaceV2
| 213 || [20.0.0+] NormalUnmapGpuMemory4K
|-
|-
| 216 || [20.1.1+] RemapMemoryV2
| 214 || [20.0.0+] CreateSparseRegion
|-
| 215 || [20.0.0+] DestroySparseRegion
|-
| 216 || [20.0.0+] ExecuteSparseMapRequests
|}
|}


Line 330: Line 498:


The Event handle associated with '''EventId''' will be signalled when the memory is released.
The Event handle associated with '''EventId''' will be signalled when the memory is released.
= gsv:m =
= gsv:t =
= gsv:sv =
= gsv:s3 =
= gsv:s4 =