Display services: Difference between revisions

No edit summary
Line 36: Line 36:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 0 || GetDisplayService ||
| 0 || [[#GetDisplayService]]
|-
|-
|}
|}
Line 52: Line 52:
! Cmd || Name
! Cmd || Name
|-
|-
| 1 || GetDisplayService || Returns an [[#IApplicationDisplayService]]. Same input as vi:u.
| 1 || [[#GetDisplayService]]
|-
|-
| 3 || GetDisplayServiceWithProxyNameExchange || Returns an [[#IApplicationDisplayService]].
| 3 || [[#GetDisplayServiceWithProxyNameExchange]]
|-
|-
|}
|}
== GetDisplayService ==
Returns an [[#IApplicationDisplayService]]. Same input as vi:u.
== GetDisplayServiceWithProxyNameExchange ==
Returns an [[#IApplicationDisplayService]].


= vi:m =
= vi:m =
Line 63: Line 69:
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 2 || GetDisplayService || Returns an [[#IApplicationDisplayService]]. Same input as vi:u.
| 2 || [[#GetDisplayService]]
|-
|-
| 3 || GetDisplayServiceWithProxyNameExchange || Takes an input u64 and u32. Returns an [[#IApplicationDisplayService]].
| 3 || [[#GetDisplayServiceWithProxyNameExchange]]
|-
|-
|}
|}
== GetDisplayService ==
Returns an [[#IApplicationDisplayService]]. Same input as vi:u.
== GetDisplayServiceWithProxyNameExchange ==
Takes an input u64 and u32. Returns an [[#IApplicationDisplayService]].


= IApplicationDisplayService =
= IApplicationDisplayService =
Line 76: Line 88:
! Cmd || Name || Notes
! Cmd || Name || Notes
|-
|-
| 100 || GetRelayService || Returns an [[#IHOSBinderDriver]].
| 100 || [[#GetRelayService]]
|-
|-
| 101 || GetSystemDisplayService || Returns an [[#ISystemDisplayService]].
| 101 || [[#GetSystemDisplayService]]
|-
|-
| 102 || GetManagerDisplayService || Returns an [[#IManagerDisplayService]].
| 102 || [[#GetManagerDisplayService]]
|-
|-
| 103 || GetIndirectDisplayTransactionService || Returns an [[#IHOSBinderDriver]].
| 103 || [[#GetIndirectDisplayTransactionService]]
|-
|-
| 1000 || ListDisplays ||
| 1000 || [[#ListDisplays]]
|-
|-
| 1010 || OpenDisplay ||
| 1010 || [[#OpenDisplay]]
|-
|-
| 1011 || OpenDefaultDisplay ||
| 1011 || [[#OpenDefaultDisplay]]
|-
|-
| 1020 || CloseDisplay ||
| 1020 || [[#CloseDisplay]]
|-
|-
| 1101 || SetDisplayEnabled ||
| 1101 || [[#SetDisplayEnabled]]
|-
|-
| 1102 || GetDisplayResolution ||
| 1102 || [[#GetDisplayResolution]]
|-
|-
| 2020 || OpenLayer ||
| 2020 || [[#OpenLayer]]
|-
|-
| 2021 || CloseLayer ||
| 2021 || [[#CloseLayer]]
|-
|-
| 2030 || CreateStrayLayer ||
| 2030 || [[#CreateStrayLayer]]
|-
|-
| 2031 || DestroyStrayLayer ||
| 2031 || [[#DestroyStrayLayer]]
|-
|-
| 2101 || SetLayerScalingMode ||
| 2101 || [[#SetLayerScalingMode]]
|-
|-
| 2450 || GetIndirectLayerImageMap ||
| 2450 || [[#GetIndirectLayerImageMap]]
|-
|-
| 2451 || GetIndirectLayerImageCropMap ||
| 2451 || [[#GetIndirectLayerImageCropMap]]
|-
|-
| 2460 || GetIndirectLayerImageRequiredMemoryInfo ||
| 2460 || [[#GetIndirectLayerImageRequiredMemoryInfo]]
|-
|-
| 5202 || GetDisplayVsyncEvent ||
| 5202 || [[#GetDisplayVsyncEvent]]
|-
|-
| 5203 || GetDisplayVsyncEventForDebug ||
| 5203 || [[#GetDisplayVsyncEventForDebug]]
|-
|-
|}
|}
Line 126: Line 138:


These commands using PIDs have AppletResourceUserId as the last input u64, hence AppletResourceUserId must [[IPC_Marshalling|match]] the user-process PID(no special handling for value 0).
These commands using PIDs have AppletResourceUserId as the last input u64, hence AppletResourceUserId must [[IPC_Marshalling|match]] the user-process PID(no special handling for value 0).
== GetRelayService ==
Returns an [[Nvnflinger_services#dispdrv|IHOSBinderDriver]] interface which abstracts "nn::visrv::service::RelayServiceImpl".
== GetIndirectDisplayTransactionService ==
Returns an [[Nvnflinger_services#dispdrv|IHOSBinderDriver]] interface which abstracts "nn::visrv::service::IndirectDisplayTransactionServiceImpl".
== GetSystemDisplayService ==
Returns an [[#ISystemDisplayService]].
== GetManagerDisplayService ==
Returns an [[#IManagerDisplayService]].


== ListDisplays ==
== ListDisplays ==
Line 186: Line 210:
== GetDisplayVsyncEventForDebug ==
== GetDisplayVsyncEventForDebug ==
Takes an input u64 DisplayId and returns a handle.
Takes an input u64 DisplayId and returns a handle.
== IHOSBinderDriver ==
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 0 || [[#TransactParcel]]
|-
| 1 || [[#AdjustRefcount]]
|-
| 2 || [[#GetNativeHandle]]
|-
| 3 || [[#TransactParcelAuto]]
|}
This uses Android code.
Command(s) from here are constantly used while displaying gfx.
TransactParcel is used by 1.0.0 official user-processes, while starting with {unknown version} TransactParcelAuto is used instead.
=== TransactParcel ===
Takes a s32, an u32, a type-0x5 input buffer, a type-0x6 output buffer, and an input u32. Each word is immediately after the previous word.
=== AdjustRefcount ===
Takes 3 input s32s, with each word immediately following the previous word. No additional output.
=== GetNativeHandle ===
Takes an input s32 and u32, with the latter immediately following the previous word. Returns an output event handle.
=== TransactParcelAuto ===
Takes a s32, an u32, a type-0x21 input buffer, a type-0x22 output buffer, and an input u32. Each word is immediately after the previous word.


== ISystemDisplayService ==
== ISystemDisplayService ==
Line 342: Line 334:
|}
|}


=DisplayInfo=
= DisplayInfo =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 362: Line 354:
The width/height for the "Default" Display is the resolution for 1080p even when in handheld-mode.
The width/height for the "Default" Display is the resolution for 1080p even when in handheld-mode.


=DisplayName=
= DisplayName =
This is a 0x40-byte block: a NUL-terminated string.
This is a 0x40-byte block: a NUL-terminated string.
Can be "Default", "External", "Edid", "Internal" or "Null".


= NativeWindow =
= NativeWindow =