<br />

Added: 12

## **PROTOCOLS**

## DisplayPower

*Defined in [fuchsia.ui.display.singleton/power.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/power.fidl;l=48)*

Controls the power state of the default display device.
Added: HEAD

<br />

### SetPowerMode

Set the power state of the default connected display device to `power_mode`.

Errors:

- `ZX_ERR_NOT_FOUND`: There is no connected display.
- `ZX_ERR_NOT_SUPPORTED`: The default connected display driver or hardware does not support the requested power mode.
- `ZX_ERR_INTERNAL`: Operation failed for another reason.

#### Request

| Name | Type |
|---|---|
| `power_mode` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.display.singleton#PowerMode` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.display.singleton#DisplayPower_SetPowerMode_Result` |

## Info

*Defined in [fuchsia.ui.display.singleton/info.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/info.fidl;l=32)*

Get information about Scenic's primary display.

<br />

### GetMetrics

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `info` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.display.singleton#Metrics` |

## VsyncSource

*Defined in [fuchsia.ui.display.singleton/vsync_source.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/vsync_source.fidl;l=10)*
Added: NEXT

<br />

### OnVsync

Notifies the client that a vsync event has occurred.

#### Response

| Name | Type |
|---|---|
| `timestamp` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Time` |

### SetVsyncEnabled

Enables or disables receiving `OnVsync` for the given display.

The client receives `OnVsync` callbacks iff this function is called with `enabled=true`.
Calling this with `enabled=false` stops generating callbacks. Note that there may be a
race with a server receiving this and extra `OnVsync` may be received.

By default, the listener is assumed to have called `enabled=false`.

#### Request

| Name | Type |
|---|---|
| `enabled` | `bool` |

## **STRUCTS**

### DisplayPower_SetPowerMode_Response

*Defined in [fuchsia.ui.display.singleton/power.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/power.fidl;l=61)*

\<EMPTY\>

## **ENUMS**

### PowerMode [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.ui.display.singleton/power.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/power.fidl;l=10)*

The power mode of the display hardware.
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### OFF | `0` | The display is powered off. The hardware will not apply new display configs nor generate new VSync events. All display devices must support this power mode. |
| ### ON | `1` | The display is fully powered on. All display devices must support this power mode. |
| ### DOZE | `2` | The display is powered on and configured in a low power state that is suitable for presenting ambient information to the user, possibly with lower fidelity than ON, but with greater efficiency. A display device must support both `DOZE` and `DOZE_SUSPEND` power modes, or neither. |
| ### DOZE_SUSPEND | `3` | The display is configured as the same state in DOZE but may stop applying display updates from the client. This is effectively a hint to the device that drawing to the display has been suspended and that the device must remain in a low power state and continue displaying its current contents indefinitely until the power mode changes. A display device must support both `DOZE` and `DOZE_SUSPEND` power modes, or neither. When both modes are supported, the display device is allowed to not use the hint above, in which case `DOZE_SUSPEND` is identical to `DOZE`. |

## **TABLES**

### Metrics

*Defined in [fuchsia.ui.display.singleton/info.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/info.fidl;l=9)*

Describes the physical display, and how to map between physical and logical pixels.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `extent_in_px` | `https://fuchsia.dev/reference/fuchsia.math//https://fuchsia.dev/reference/fuchsia.math#SizeU` | Same meaning as `horizontal_resolution` and `vertical_resolution` in `fuchsia.hardware.display.Mode`. Given in physical pixels. |
| ### 2 | `extent_in_mm` | `https://fuchsia.dev/reference/fuchsia.math//https://fuchsia.dev/reference/fuchsia.math#SizeU` | Same meaning as `horizontal_size_mm` and `vertical_size_mm` in `fuchsia.hardware.display.Info`. |
| ### 3 | `recommended_device_pixel_ratio` | `https://fuchsia.dev/reference/fuchsia.math//https://fuchsia.dev/reference/fuchsia.math#VecF` | The number of physical pixels per "logical" pixel, for example as in `fuchsia.ui.composition.LayoutInfo.logical_size`. It provides an indication of the size of image buffers that should be allocated. This value would typically be used by a component near the root of the scene graph to set a scale for the rest of the scene beneath. |
| ### 4 | `maximum_refresh_rate_in_millihertz` | `uint32` | The maximum mumber of images transmitted to the display in 1000 seconds. This is the display's maximum vertical refresh rate, in millihertz (0.001 Hz). Added: 16 |

## **UNIONS**

### DisplayPower_SetPowerMode_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.ui.display.singleton/power.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.display.singleton/power.fidl;l=61)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.display.singleton#DisplayPower_SetPowerMode_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />