GSP Services: Difference between revisions
No edit summary  | 
				mNo edit summary  | 
				||
| (58 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
__TOC__  | |||
{{Anchor|GSPGPU}}{{Anchor|gsp::Gpu}}  | |||
= GSP service "gsp::Gpu" =  | = GSP service "gsp::Gpu" =  | ||
{| class="wikitable" border="1"  | {| class="wikitable" border="1"  | ||
|-  | |-  | ||
!  Command Header  | !  Command Header  | ||
!  Available since system version  | |||
!  GSP rights required  | |||
!  Description  | !  Description  | ||
|-  | |-  | ||
| 0x00010082  | | 0x00010082  | ||
|   | |||
| Yes  | |||
| [[GSPGPU:WriteHWRegs|WriteHWRegs]]  | | [[GSPGPU:WriteHWRegs|WriteHWRegs]]  | ||
|-  | |-  | ||
| 0x00020084  | | 0x00020084  | ||
|   | |||
| Yes  | |||
| [[GSPGPU:WriteHWRegsWithMask|WriteHWRegsWithMask]]  | | [[GSPGPU:WriteHWRegsWithMask|WriteHWRegsWithMask]]  | ||
|-  | |-  | ||
| 0x00030082  | | 0x00030082  | ||
|   | |||
| Yes  | |||
| [[GSPGPU:WriteHWRegRepeat|WriteHWRegRepeat]]  | | [[GSPGPU:WriteHWRegRepeat|WriteHWRegRepeat]]  | ||
|-  | |-  | ||
| 0x00040080  | | 0x00040080  | ||
| ReadHWRegs  | |    | ||
| Yes  | |||
| [[GSPGPU:ReadHWRegs|ReadHWRegs]]  | |||
|-  | |-  | ||
| 0x00050200  | | 0x00050200  | ||
| SetBufferSwap  | |    | ||
| Yes  | |||
| [[GSPGPU:SetBufferSwap|SetBufferSwap]]  | |||
|-  | |-  | ||
| 0x00060082  | | 0x00060082  | ||
| SetCommandList  | |   | ||
| No  | |||
| SetCommandList (Stubbed)  | |||
|-  | |-  | ||
| 0x000700C2  | | 0x000700C2  | ||
| RequestDma  | |   | ||
| No  | |||
| RequestDma (Stubbed)  | |||
|-  | |-  | ||
| 0x00080082  | | 0x00080082  | ||
| FlushDataCache  | |    | ||
| No  | |||
| [[GSPGPU:FlushDataCache|FlushDataCache]]  | |||
|-  | |-  | ||
| 0x00090082  | | 0x00090082  | ||
| InvalidateDataCache  | |    | ||
| No  | |||
| [[GSPGPU:InvalidateDataCache|InvalidateDataCache]]  | |||
|-  | |-  | ||
| 0x000A0044  | | 0x000A0044  | ||
| RegisterInterruptEvents  | |   | ||
| No  | |||
| RegisterInterruptEvents (Stubbed)  | |||
|-  | |-  | ||
| 0x000B0040  | | 0x000B0040  | ||
|   | |||
| Usually not (see below)  | |||
| [[GSPGPU:SetLcdForceBlack|SetLcdForceBlack]]  | | [[GSPGPU:SetLcdForceBlack|SetLcdForceBlack]]  | ||
|-  | |-  | ||
| 0x000C0000  | | 0x000C0000  | ||
| TriggerCmdReqQueue  | |    | ||
| No  | |||
| [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]]  | |||
|-  | |-  | ||
| 0x000D0140  | | 0x000D0140  | ||
| SetDisplayTransfer  | |    | ||
| No  | |||
| [[GSPGPU:SetDisplayTransfer|SetDisplayTransfer]]  | |||
|-  | |-  | ||
| 0x000E0180  | | 0x000E0180  | ||
| SetTextureCopy  | |    | ||
| No  | |||
| [[GSPGPU:SetTextureCopy|SetTextureCopy]]  | |||
|-  | |-  | ||
| 0x000F0200  | | 0x000F0200  | ||
| SetMemoryFill  | |    | ||
| No  | |||
| [[GSPGPU:SetMemoryFill|SetMemoryFill]]  | |||
|-  | |-  | ||
| 0x00100040  | | 0x00100040  | ||
| SetAxiConfigQoSMode  | |    | ||
| No  | |||
| [[GSPGPU:SetAxiConfigQoSMode|SetAxiConfigQoSMode]]  | |||
|-  | |-  | ||
| 0x00110040  | | 0x00110040  | ||
| SetPerfLogMode  | |    | ||
| No  | |||
| [[GSPGPU:SetPerfLogMode|SetPerfLogMode]]  | |||
|-  | |-  | ||
| 0x00120000  | | 0x00120000  | ||
| GetPerfLog  | |    | ||
| No  | |||
| [[GSPGPU:GetPerfLog|GetPerfLog]]  | |||
|-  | |-  | ||
| 0x00130042  | | 0x00130042  | ||
| RegisterInterruptRelayQueue  | |    | ||
| No  | |||
| [[GSPGPU:RegisterInterruptRelayQueue|RegisterInterruptRelayQueue]]  | |||
|-  | |-  | ||
| 0x00140000  | | 0x00140000  | ||
| UnregisterInterruptRelayQueue  | |    | ||
| No  | |||
| [[GSPGPU:UnregisterInterruptRelayQueue|UnregisterInterruptRelayQueue]]  | |||
|-  | |-  | ||
| 0x00150002  | | 0x00150002  | ||
| TryAcquireRight  | |    | ||
| No  | |||
| [[GSPGPU:TryAcquireRight|TryAcquireRight]]  | |||
|-  | |-  | ||
| 0x00160042  | | 0x00160042  | ||
| AcquireRight   | |    | ||
| No  | |||
| [[GSPGPU:AcquireRight|AcquireRight]]  | |||
|-  | |-  | ||
| 0x00170000  | | 0x00170000  | ||
| ReleaseRight  | |    | ||
| No  | |||
| [[GSPGPU:ReleaseRight|ReleaseRight]]  | |||
|-  | |-  | ||
| 0x00180000  | | 0x00180000  | ||
| ImportDisplayCaptureInfo  | |    | ||
| No  | |||
| [[GSPGPU:ImportDisplayCaptureInfo|ImportDisplayCaptureInfo]]  | |||
|-  | |-  | ||
| 0x00190000  | | 0x00190000  | ||
| SaveVramSysArea  | |    | ||
| See below  | |||
| [[GSPGPU:SaveVramSysArea|SaveVramSysArea]]  | |||
|-  | |-  | ||
| 0x001A0000  | | 0x001A0000  | ||
| RestoreVramSysArea  | |    | ||
| See below  | |||
| [[GSPGPU:RestoreVramSysArea|RestoreVramSysArea]]  | |||
|-  | |-  | ||
| 0x001B0000  | | 0x001B0000  | ||
| ResetGpuCore  | |    | ||
| Yes  | |||
| [[GSPGPU:ResetGpuCore|ResetGpuCore]]  | |||
|-  | |-  | ||
| 0x001C0040  | | 0x001C0040  | ||
| SetLedForceOff  | |    | ||
| No  | |||
| [[GSPGPU:SetLedForceOff|SetLedForceOff]]  | |||
|-  | |-  | ||
| 0x001D0040  | | 0x001D0040  | ||
| SetTestCommand  | |   | ||
| No  | |||
| SetTestCommand (Stubbed)  | |||
|-  | |-  | ||
| 0x001E0080  | | 0x001E0080  | ||
| SetInternalPriorities  | |    | ||
| No  | |||
| [[GSPGPU:SetInternalPriorities|SetInternalPriorities]]  | |||
|-  | |||
| 0x001F0082  | |||
| [[8.0.0-18]]  | |||
| No  | |||
| [[GSPGPU:StoreDataCache|StoreDataCache]]  | |||
|}  | |}  | ||
The   | The GSP module starts a thread for handling commands for each service session, a maximum of 4 processes can use this service at once. Official applications have an optional code-path which [[GSPGPU:WriteHWRegs|writes]] to registers during initialization, this is normally not used however.  | ||
If a process has forcefully acquired rights (ErrDisp), attempting [[GSPGPU:SetLcdForceBlack|unset LCDs black-fill]] from another process will fail.  | |||
Saving/restoring VRAM requires bit0 of process [[GSPGPU:RegisterInterruptRelayQueue|flags]] to be set.  | |||
{{Anchor|GSPLCD}}{{Anchor|gsp::Lcd}}  | |||
= GSP service "gsp::Lcd" =  | |||
{| class="wikitable" border="1"  | |||
|-  | |||
!  Command Header  | |||
!  Available since system version  | |||
!  Description  | |||
|-  | |||
| 0x00010040  | |||
|   | |||
| [[GSPLCD:EnableABL|EnableABL]]  | |||
|-  | |||
| 0x00020040  | |||
|   | |||
| [[GSPLCD:DisableABL|DisableABL]]  | |||
|-  | |||
| 0x00030080  | |||
|   | |||
| [[GSPLCD:SetRSLut|SetRSLut]]  | |||
|-  | |||
| 0x000400C0  | |||
|   | |||
| [[GSPLCD:SetRSParams|SetRSParams]]  | |||
|-  | |||
| 0x00050140  | |||
|   | |||
| [[GSPLCD:SetABLArea|SetABLArea]]  | |||
|-  | |||
| 0x00060140  | |||
|   | |||
| ?  | |||
|-  | |||
| 0x00070080  | |||
|   | |||
| [[GSPLCD:SetInertia|SetInertia]]  | |||
|-  | |||
| 0x000800C0  | |||
|   | |||
| [[GSPLCD:SetDitherMode|SetDitherMode]]  | |||
|-  | |||
| 0x00090140  | |||
|   | |||
| [[GSPLCD:SetDitherParams|SetDitherParams]]  | |||
|-  | |||
| 0x000A0080  | |||
|   | |||
| [[GSPLCD:SetBrightnessRaw|SetBrightnessRaw]]  | |||
|-  | |||
| 0x000B0080  | |||
|   | |||
| [[GSPLCD:SetBrightness|SetBrightness]]  | |||
|-  | |||
| 0x000C0040  | |||
|   | |||
| [[GSPLCD:ReloadConfig|ReloadConfig]]  | |||
|-  | |||
| 0x000D0040  | |||
|   | |||
| [[GSPLCD:RestoreConfig|RestoreConfig]]  | |||
|-  | |||
| 0x000E0000  | |||
|   | |||
| [[GSPLCD:GetPowerState|GetPowerState]]  | |||
|-  | |||
| 0x000F0000  | |||
|   | |||
| [[GSPLCD:PowerOnAllBacklights|PowerOnAllBacklights]]  | |||
|-  | |||
| 0x00100000  | |||
|   | |||
| [[GSPLCD:PowerOffAllBacklights|PowerOffAllBacklights]]  | |||
|-  | |||
| 0x00110040  | |||
|   | |||
| [[GSPLCD:PowerOnBacklight|PowerOnBacklight]]  | |||
|-  | |||
| 0x00120040  | |||
|   | |||
| [[GSPLCD:PowerOffBacklight|PowerOffBacklight]]  | |||
|-  | |||
| 0x00130040  | |||
|   | |||
| [[GSPLCD:SetLedForceOff|SetLedForceOff]]  | |||
|-  | |||
| 0x00140000  | |||
| [[8.0.0-18]]  | |||
| [[GSPLCD:GetVendor|GetVendor]] New3DS-only, stubbed on Old3DS: This only returns an error. Uninitialized data(not set by this command itself) is also written to u8 cmdreply_word[2].  | |||
|-  | |||
| 0x00150040  | |||
| [[8.0.0-18]]  | |||
| [[GSPLCD:GetBrightness|GetBrightness]] New3DS-only, stubbed on Old3DS: This only returns an error. Uninitialized data(not set by this command itself) is also written to u32 cmdreply_word[2].  | |||
|}  | |||
Unlike gsp::Gpu, GSP module does not start a separate thread for handling these service commands.  | |||
= Version history =  | |||
{| class="wikitable" border="1"  | |||
|-  | |||
!  Version  | |||
!  Changes  | |||
|-  | |||
| [[8.0.0-18|v8196]]  | |||
| Support for the new LINEAR memory region was implemented for cache commands and vaddr->paddr conversion. Support for the New3DS only [[Memory_layout#0x1F000000_.28New_3DS_only.29|QTM memory region]] was added for vaddr->paddr conversion. When vaddr->physaddr conversions fail while handling PSC commands, an error is now returned (see [[GSP_Shared_Memory#Command_Queue_Header|here]] regarding errors being written to GSP shared memory).  | |||
|}  | |||
=New3DS=  | |||
There's separate GSP-module titles for Old3DS and New3DS. PTM CheckNew3DS is only used by the New3DS title, for copying that flag into a state field. Elsewhere that field is checked for running additional code only on New3DS, for processing various state / using [[QTM_Services|QTM]] commands.  | |||
[[Category:Services]]  | |||
Latest revision as of 13:19, 1 May 2025
GSP service "gsp::Gpu"
| Command Header | Available since system version | GSP rights required | Description | 
|---|---|---|---|
| 0x00010082 | Yes | WriteHWRegs | |
| 0x00020084 | Yes | WriteHWRegsWithMask | |
| 0x00030082 | Yes | WriteHWRegRepeat | |
| 0x00040080 | Yes | ReadHWRegs | |
| 0x00050200 | Yes | SetBufferSwap | |
| 0x00060082 | No | SetCommandList (Stubbed) | |
| 0x000700C2 | No | RequestDma (Stubbed) | |
| 0x00080082 | No | FlushDataCache | |
| 0x00090082 | No | InvalidateDataCache | |
| 0x000A0044 | No | RegisterInterruptEvents (Stubbed) | |
| 0x000B0040 | Usually not (see below) | SetLcdForceBlack | |
| 0x000C0000 | No | TriggerCmdReqQueue | |
| 0x000D0140 | No | SetDisplayTransfer | |
| 0x000E0180 | No | SetTextureCopy | |
| 0x000F0200 | No | SetMemoryFill | |
| 0x00100040 | No | SetAxiConfigQoSMode | |
| 0x00110040 | No | SetPerfLogMode | |
| 0x00120000 | No | GetPerfLog | |
| 0x00130042 | No | RegisterInterruptRelayQueue | |
| 0x00140000 | No | UnregisterInterruptRelayQueue | |
| 0x00150002 | No | TryAcquireRight | |
| 0x00160042 | No | AcquireRight | |
| 0x00170000 | No | ReleaseRight | |
| 0x00180000 | No | ImportDisplayCaptureInfo | |
| 0x00190000 | See below | SaveVramSysArea | |
| 0x001A0000 | See below | RestoreVramSysArea | |
| 0x001B0000 | Yes | ResetGpuCore | |
| 0x001C0040 | No | SetLedForceOff | |
| 0x001D0040 | No | SetTestCommand (Stubbed) | |
| 0x001E0080 | No | SetInternalPriorities | |
| 0x001F0082 | 8.0.0-18 | No | StoreDataCache | 
The GSP module starts a thread for handling commands for each service session, a maximum of 4 processes can use this service at once. Official applications have an optional code-path which writes to registers during initialization, this is normally not used however.
If a process has forcefully acquired rights (ErrDisp), attempting unset LCDs black-fill from another process will fail. Saving/restoring VRAM requires bit0 of process flags to be set.
GSP service "gsp::Lcd"
| Command Header | Available since system version | Description | 
|---|---|---|
| 0x00010040 | EnableABL | |
| 0x00020040 | DisableABL | |
| 0x00030080 | SetRSLut | |
| 0x000400C0 | SetRSParams | |
| 0x00050140 | SetABLArea | |
| 0x00060140 | ? | |
| 0x00070080 | SetInertia | |
| 0x000800C0 | SetDitherMode | |
| 0x00090140 | SetDitherParams | |
| 0x000A0080 | SetBrightnessRaw | |
| 0x000B0080 | SetBrightness | |
| 0x000C0040 | ReloadConfig | |
| 0x000D0040 | RestoreConfig | |
| 0x000E0000 | GetPowerState | |
| 0x000F0000 | PowerOnAllBacklights | |
| 0x00100000 | PowerOffAllBacklights | |
| 0x00110040 | PowerOnBacklight | |
| 0x00120040 | PowerOffBacklight | |
| 0x00130040 | SetLedForceOff | |
| 0x00140000 | 8.0.0-18 | GetVendor New3DS-only, stubbed on Old3DS: This only returns an error. Uninitialized data(not set by this command itself) is also written to u8 cmdreply_word[2]. | 
| 0x00150040 | 8.0.0-18 | GetBrightness New3DS-only, stubbed on Old3DS: This only returns an error. Uninitialized data(not set by this command itself) is also written to u32 cmdreply_word[2]. | 
Unlike gsp::Gpu, GSP module does not start a separate thread for handling these service commands.
Version history
| Version | Changes | 
|---|---|
| v8196 | Support for the new LINEAR memory region was implemented for cache commands and vaddr->paddr conversion. Support for the New3DS only QTM memory region was added for vaddr->paddr conversion. When vaddr->physaddr conversions fail while handling PSC commands, an error is now returned (see here regarding errors being written to GSP shared memory). | 
New3DS
There's separate GSP-module titles for Old3DS and New3DS. PTM CheckNew3DS is only used by the New3DS title, for copying that flag into a state field. Elsewhere that field is checked for running additional code only on New3DS, for processing various state / using QTM commands.